diff --git a/src/store.rs b/src/store.rs index 998681854..08702e903 100644 --- a/src/store.rs +++ b/src/store.rs @@ -179,13 +179,14 @@ pub struct PyAmazonS3Context { #[pymethods] impl PyAmazonS3Context { #[allow(clippy::too_many_arguments)] - #[pyo3(signature = (bucket_name, region=None, access_key_id=None, secret_access_key=None, endpoint=None, allow_http=false, imdsv1_fallback=false))] + #[pyo3(signature = (bucket_name, region=None, access_key_id=None, secret_access_key=None, session_token=None, endpoint=None, allow_http=false, imdsv1_fallback=false))] #[new] fn new( bucket_name: String, region: Option, access_key_id: Option, secret_access_key: Option, + session_token: Option, endpoint: Option, //retry_config: RetryConfig, allow_http: bool, @@ -206,6 +207,10 @@ impl PyAmazonS3Context { builder = builder.with_secret_access_key(secret_access_key); }; + if let Some(session_token) = session_token { + builder = builder.with_token(session_token); + } + if let Some(endpoint) = endpoint { builder = builder.with_endpoint(endpoint); };