Fix assume_role_with_web_identity not using botocore config for STS c…#64216
Merged
vincbeck merged 4 commits intoapache:mainfrom Mar 26, 2026
Merged
Fix assume_role_with_web_identity not using botocore config for STS c…#64216vincbeck merged 4 commits intoapache:mainfrom
vincbeck merged 4 commits intoapache:mainfrom
Conversation
vincbeck
approved these changes
Mar 25, 2026
Contributor
vincbeck
left a comment
There was a problem hiding this comment.
Static checks are failing
…alls When `assume_role_method` is set to `assume_role_with_web_identity`, the STS client used to fetch credentials was created without the connection's botocore config. This meant proxy settings, timeouts, and other config from `config_kwargs` in the connection extra were silently ignored. The `assume_role` and `assume_role_with_saml` paths correctly pass `self.config` to the STS client, but the web identity path passed a raw `base_session.create_client` as `client_creator` to botocore's `AssumeRoleWithWebIdentityCredentialFetcher`, which never received the connection config. This wraps `client_creator` to merge the connection's botocore config into any config that botocore passes when creating the STS client, ensuring proxy and other settings are respected. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
c0e4e49 to
7bf45ba
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
When
assume_role_methodis set toassume_role_with_web_identity, the STS client used to fetch credentials was created without the connection's botocore config. This meant proxy settings, timeouts, and other config fromconfig_kwargsin the connection extra were silently ignored.The
assume_roleandassume_role_with_samlpaths correctly passself.configto the STS client, but the web identity path passed a rawbase_session.create_clientasclient_creatorto botocore'sAssumeRoleWithWebIdentityCredentialFetcher, which never received the connection config.This wraps
client_creatorto merge the connection's botocore config into any config that botocore passes when creating the STS client, ensuring proxy and other settings are respected.