Skip to content

Commit 6012349

Browse files
feat: support session token parameter for AmaoznS3 (#1275)
1 parent 030873b commit 6012349

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/store.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,13 +179,14 @@ pub struct PyAmazonS3Context {
179179
#[pymethods]
180180
impl PyAmazonS3Context {
181181
#[allow(clippy::too_many_arguments)]
182-
#[pyo3(signature = (bucket_name, region=None, access_key_id=None, secret_access_key=None, endpoint=None, allow_http=false, imdsv1_fallback=false))]
182+
#[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))]
183183
#[new]
184184
fn new(
185185
bucket_name: String,
186186
region: Option<String>,
187187
access_key_id: Option<String>,
188188
secret_access_key: Option<String>,
189+
session_token: Option<String>,
189190
endpoint: Option<String>,
190191
//retry_config: RetryConfig,
191192
allow_http: bool,
@@ -206,6 +207,10 @@ impl PyAmazonS3Context {
206207
builder = builder.with_secret_access_key(secret_access_key);
207208
};
208209

210+
if let Some(session_token) = session_token {
211+
builder = builder.with_token(session_token);
212+
}
213+
209214
if let Some(endpoint) = endpoint {
210215
builder = builder.with_endpoint(endpoint);
211216
};

0 commit comments

Comments
 (0)