awsutil: ensure GenerateCredentialChain checks envs #80
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#57 caused a regression in Vault. In that PR the AWS environment variable checks in GenerateCredentialChain were moved to NewCredentialsConfig for AWS_ROLE_ARN, AWS_WEB_IDENTITY_TOKEN_FILE, and AWS_ROLE_SESSION_NAME. This caused users of the awsutil library that call GenerateCredentialConfig to fail to set the above values if they are depending on env variables to be read.
Another solution could be to find all users of go-secure-stdlib’s awsutil and ensure env vars are properly read and set in the config before calling GenerateCredentialConfig like in hashicorp/vault#21930. However, I think a this PR is a better resolution. With this change we shouldn't have to make any changes anywhere else.
This change was tested with the following steps:
go get github.com/hashicorp/go-secure-stdlib/awsutil@d18ccdf3e9fb
Additionally, this has been tested against the Boundary E2E tests by @ddebko. Thanks!
Closes #71