james-iceb opened a new issue, #538:
URL: https://github.com/apache/arrow-rs-object-store/issues/538

   **Describe the bug**
   
   AmazonS3ConfigKey::WebIdentityTokenFile and AmazonS3ConfigKey::RoleArn 
config is ignored when using AWS WebIdentity credential provider. It only works 
if you set the AWS_WEB_IDENTITY_TOKEN_FILE and AWS_ROLE_ARN environment 
variables.
   
   In src/aws/builder.rs it only checks the environment variables, not the 
config:
   ```
           } else if let (Ok(token_path), Ok(role_arn)) = (
               std::env::var("AWS_WEB_IDENTITY_TOKEN_FILE"),
               std::env::var("AWS_ROLE_ARN"),
           ) {
               debug!("Using WebIdentity credential provider");
   ```
   
   **To Reproduce**
   
   Do not set the environment variables and use a builder like the following:
   ```
           let builder = AmazonS3Builder::new()
               .with_bucket_name("some-bucket")
               .with_config(
                   AmazonS3ConfigKey::WebIdentityTokenFile,
                   "/tmp/fake-token-file",
               )
               .with_config(
                   AmazonS3ConfigKey::RoleArn,
                   "arn:aws:iam::123456789012:role/test-role",
               )
               .with_config(AmazonS3ConfigKey::RoleSessionName, "TestSession")
               .with_config(
                   AmazonS3ConfigKey::StsEndpoint,
                   "https://sts.us-west-2.amazonaws.com";,
               );
   ```
   
   
   **Expected behavior**
   
   It should try and get a key from the STS endpoint (but doesn't)
   
   


-- 
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]

Reply via email to