in src/store.rs [179:223]
fn new(
bucket_name: String,
region: Option<String>,
access_key_id: Option<String>,
secret_access_key: Option<String>,
endpoint: Option<String>,
//retry_config: RetryConfig,
allow_http: bool,
imdsv1_fallback: bool,
) -> Self {
// start w/ the options that come directly from the environment
let mut builder = AmazonS3Builder::from_env();
if let Some(region) = region {
builder = builder.with_region(region);
}
if let Some(access_key_id) = access_key_id {
builder = builder.with_access_key_id(access_key_id);
};
if let Some(secret_access_key) = secret_access_key {
builder = builder.with_secret_access_key(secret_access_key);
};
if let Some(endpoint) = endpoint {
builder = builder.with_endpoint(endpoint);
};
if imdsv1_fallback {
builder = builder.with_imdsv1_fallback();
};
let store = builder
.with_bucket_name(bucket_name.clone())
//.with_retry_config(retry_config) #TODO: add later
.with_allow_http(allow_http)
.build()
.expect("failed to build AmazonS3");
Self {
inner: Arc::new(store),
bucket_name,
}
}