Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ignore capitalization of aws_access_key_id and aws_secret_access_key elements in credentials file #2458

Closed
duffn opened this issue Jan 4, 2021 · 5 comments
Labels
feature-request A feature should be added or improved.

Comments

@duffn
Copy link

duffn commented Jan 4, 2021

Is your feature request related to a problem? Please describe.

The SDK does not behave the same way as the AWS CLI when reading credentials from the ~/.aws/credentials file in regards to the capitalization of the aws_access_key_id and aws_secret_access_key keys.

Example

The SDK will read this credential properly.

[default]
aws_access_key_id = abcd1234
aws_secret_access_key = abcd1234
region = us-east-1

The SDK will not read this credential as AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY are capitalized, though the AWS CLI will still read this credential properly.

[default]
AWS_ACCESS_KEY_ID = abcd1234
AWS_SECRET_ACCESS_KEY = abcd1234
region = us-east-1
/Users/me/.rbenv/versions/2.7.2/lib/ruby/gems/2.7.0/gems/aws-sigv4-1.2.2/lib/aws-sigv4/signer.rb:621:in `extract_credentials_provider': missing credentials, provide credentials with one of the following options: (Aws::Sigv4::Errors::MissingCredentialsError)
  - :access_key_id and :secret_access_key
  - :credentials
  - :credentials_provider

Describe the solution you'd like

I would like the SDK to read credentials from the ~/.aws/credentials file regardless of their capitalization.

Describe alternatives you've considered

The alternative is simple enough in that using only all lower case keys in ~/.aws/credentials is the solution, however, this tripped me up for a bit when using a downstream dependency of the SDK.

[x] 👋 I may be able to implement this feature request

Additional context

$ bundle list | grep aws-sdk-core
  * aws-sdk-core (3.110.0)
@duffn duffn added the feature-request A feature should be added or improved. label Jan 4, 2021
@mullermp
Copy link
Contributor

mullermp commented Jan 5, 2021

Thanks for reaching out. According to the design specification for this feature (written for SDKs and published internally) it does not specifically mention that these keys should be case insensitive. CLI may have broken that specification at some point and must continue to support it. I'll check with other teams on this. Is there a specific need to be case insensitive? You should be able to define these in lower case and it will work for both CLI and SDKs. Historically, we get many "CLI does this, why don't you?" type requests and they're not always the correct thing to do.

@duffn
Copy link
Author

duffn commented Jan 5, 2021

Using all lowercase for the credentials is the correct solution, it just caught me off guard. I can agree that this is indeed one of those CLI does this, why don't you? issues. It can be closed.

@duffn duffn closed this as completed Jan 5, 2021
@github-actions
Copy link

github-actions bot commented Jan 5, 2021

⚠️COMMENT VISIBILITY WARNING⚠️

Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.

@mullermp
Copy link
Contributor

mullermp commented Jan 5, 2021

Understood, and makes sense. I think that the specification we have can be amended to mention CLI's behavior or be broadened to case sensitive keys. I will follow up with that.

@debora-ito
Copy link
Member

For the ones who stumbled on this issue and still would like to see it supported, we are tracking a cross-SDK feature request here: aws/aws-sdk-java-v2#5689.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature-request A feature should be added or improved.
Projects
None yet
Development

No branches or pull requests

3 participants