fix: issue with aws credentials not being passed in correctly #1266
+44
−22
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.
Issue
Lendflow caught a bug where they were getting the error
The security token included in the request is invalid
when calling the baml client functions within the playground as well as their local environment while trying to use an assumed role. They were setting theAWS_ACCESS_KEY_ID
andAWS_SECRET_ACCESS_KEY
but did not have the ability to also setAWS_SESSION_TOKEN
which is required in the aws credentials chain.Root cause and fix
When assuming an IAM role, it’s required by the AWS credentials chain to supply the
AWS_ACCESS_KEY_ID
,AWS_SECRET_ACCESS_KEY
, as well asAWS_SESSION_TOKEN
. Previously, we did not pass theAWS_SESSION_TOKEN
into the credentials chain. I updated the code to do so.Additionally, I fixed another issue with
AWS_PROFILE
and SSO. There is now separate logic for whenAWS_PROFILE
is passed in that will use the credentials chain to grab the SSO token from disk (not available in WASM).Important
Fixes AWS credentials issue by including
AWS_SESSION_TOKEN
and handlingAWS_PROFILE
for SSO.AWS_SESSION_TOKEN
in credentials chain inaws_bedrock.rs
andaws_client.rs
.AWS_PROFILE
for SSO inaws_client.rs
.UnresolvedAwsBedrock
andResolvedAwsBedrock
structs inaws_bedrock.rs
to includesession_token
andprofile
.AwsClient::client_anyhow()
inaws_client.rs
to set credentials provider withsession_token
.patchelf
dependency frompyproject.toml
.This description was created by for bf6fc64. It will automatically update as commits are pushed.