thomascjohnson commented on issue #7005: URL: https://github.com/apache/arrow-rs/issues/7005#issuecomment-2622260712
Thank you for your response Raphael, I had a look at the AWS Rust SDK and I can see that they handle this [here](https://github.com/awslabs/aws-sdk-rust/blob/main/sdk/aws-config/src/ecs.rs). It's a bit convoluted, so I checked some of the other SDKs and it seems that basically you need to GET the credentials URI (might need to build it if it's the relative variable) with the headers `{"Accept": "application/json", "Authorization": ${auth token from file}}`. So I suppose the way to go would be to adapt this: ``` pub fn from_env() -> Self { let mut builder: Self = Default::default(); for (os_key, os_value) in std::env::vars_os() { if let (Some(key), Some(value)) = (os_key.to_str(), os_value.to_str()) { if key.starts_with("AWS_") { if let Ok(config_key) = key.to_ascii_lowercase().parse() { builder = builder.with_config(config_key, value); } } } } builder } ``` So that if it has the combination of environment variables it makes the request to get the access key ID and secret. Or alternatively I could handle it in the builder. Neither of those approaches seem particularly elegant – do you have a better idea? I'm also wondering about refreshing the credentials... something else to think about. Anyway, what do you think about the right place for integrating this? `from_env`? The builder `with_config` method? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
