Skip to content

Fix assume_role_with_web_identity not using botocore config for STS c…#64216

Merged
vincbeck merged 4 commits intoapache:mainfrom
piotrlinski:fix/web-identity-proxy-config
Mar 26, 2026
Merged

Fix assume_role_with_web_identity not using botocore config for STS c…#64216
vincbeck merged 4 commits intoapache:mainfrom
piotrlinski:fix/web-identity-proxy-config

Conversation

@piotrlinski
Copy link
Copy Markdown
Contributor

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.

@piotrlinski piotrlinski requested a review from o-nikolas as a code owner March 25, 2026 12:19
@boring-cyborg boring-cyborg bot added area:providers provider:amazon AWS/Amazon - related issues labels Mar 25, 2026
@eladkal eladkal requested a review from vincbeck March 25, 2026 12:48
Copy link
Copy Markdown
Contributor

@vincbeck vincbeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@piotrlinski piotrlinski force-pushed the fix/web-identity-proxy-config branch from c0e4e49 to 7bf45ba Compare March 25, 2026 13:58
@vincbeck vincbeck merged commit 853028b into apache:main Mar 26, 2026
93 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:providers provider:amazon AWS/Amazon - related issues

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants