Repository navigation
fix(auth): strip -fips suffix from AWS service name in SigV4 signing - #18920
Merged
Merged
Conversation
Contributor
There was a problem hiding this comment.
Code Review
This pull request adds support for AWS FIPS endpoints (such as sts-fips) by stripping the -fips suffix from the host name when determining the AWS service name in _generate_authentication_header_map. It also includes a corresponding unit test to verify authentication header generation with a FIPS STS endpoint. No review comments were provided, so there is no additional feedback.
macastelaz
requested review from
nbayati and
viacheslav-rostovtsev
and removed request for
lsirac
October 29, 2026 20:29
nbayati
approved these changes
Oct 29, 2026
macastelaz
pushed a commit
that referenced
this pull request
Nov 3, 2026
🤖 I have created a release *beep* *boop* --- ## [2.62.1](google-auth-v2.62.0...google-auth-v2.62.1) (2026-11-02) ### Bug Fixes * **auth:** strip -fips suffix from AWS service name in SigV4 signing ([#18920](#18920)) ([2e1899e](2e1899e)) * **auth:** use an unencrypted key for mTLS certificate rotation ([#18709](#18709)) ([8166325](8166325)) --- This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please). Co-authored-by: release-please[bot] <55107282+release-please[bot]@users.noreply.github.com>
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 signing AWS STS GetCallerIdentity requests against regional FIPS endpoints (
sts-fips.{region}.amazonaws.com), theHostheader must remainsts-fips.{region}.amazonaws.com, whereas the AWS SigV4 credential scope and signing key derivation require the canonical service name (sts).Previously,
_generate_authentication_header_mapderivedservice_name = host.split(".")[0], which producedsts-fipsand caused AWS STS to reject the signed request withSignatureDoesNotMatch: Credential should be scoped to correct service: 'sts'.This change strips any trailing
-fipssuffix from the extracted hostname label when computingservice_name.Manual Testing
End-to-end reproduction script and observed pre-fix / post-fix output against GCP STS (
https://sts.googleapis.com/v1/token) and AWS STS (https://sts-fips.us-east-2.amazonaws.com):