Skip to content

[v2] Apply sigv4a_signing_region_set when SigV4A is resolved via auth scheme preference#10195

Merged
aemous merged 1 commit intov2from
fix/sigv4a-region-set-auth-preference
Apr 8, 2026
Merged

[v2] Apply sigv4a_signing_region_set when SigV4A is resolved via auth scheme preference#10195
aemous merged 1 commit intov2from
fix/sigv4a-region-set-auth-preference

Conversation

@jonathan343
Copy link
Copy Markdown
Contributor

This is a port of boto/botocore#3663 for AWS CLI v2

Overview

Fix sigv4a_signing_region_set being ignored when SigV4A is selected via auth_scheme_preference or explicit signature_version='v4a', causing X-Amz-Region-Set to fall back to the endpoint-derived region (e.g., us-west-2 instead of *).

Problem

SigV4A signing-context setup only ran inside set_operation_specific_signer() when auth_type == 'v4a'. This path isn't reached when SigV4A is resolved later by _set_auth_scheme_preference_signer() or configured directly on the client, so the region set was never applied.

Solution

Extract the SigV4A signing-context update into a shared helper and call it whenever the resolved signer is v4a, preserving existing region-set precedence.

Testing

Added unit coverage for:

  • auth_scheme_preference='sigv4a' applying the configured SigV4A region set
  • explicit signature_version='v4a' applying the configured SigV4A region set

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

@aemous aemous self-requested a review April 8, 2026 16:07
Copy link
Copy Markdown
Contributor

@aemous aemous left a comment

Choose a reason for hiding this comment

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

LGTM. I've also verified the signing region set config is correctly being used in AWS CLI v2 on this branch.

@aemous aemous added the v2 label Apr 8, 2026
@aemous aemous merged commit 794c5f3 into v2 Apr 8, 2026
145 of 148 checks passed
@jonathan343 jonathan343 deleted the fix/sigv4a-region-set-auth-preference branch April 8, 2026 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants