Skip to content

Comments

fix: defaultAwsSecurityCredentialSupplier fetches aws-credentials correctly from credential-url#901

Merged
vverman merged 3 commits intogoogleapis:mainfrom
vverman:fix-aws-imdsv2-default
Feb 20, 2026
Merged

fix: defaultAwsSecurityCredentialSupplier fetches aws-credentials correctly from credential-url#901
vverman merged 3 commits intogoogleapis:mainfrom
vverman:fix-aws-imdsv2-default

Conversation

@vverman
Copy link
Contributor

@vverman vverman commented Feb 18, 2026

In issue #898 a customer was facing issues when IMDSV1 was disabled and only IMDSV2 was enabled.

This is because currently the request to the AWS credentials endpoint returns a string as a response:

response = "{\n  \"Code\" : \"Success\",\n  \"LastUpdated\" : \"2026-02-18T00:10:44Z\",\n  \"Type\" : \"AWS-HMAC\", ,\n  \"AccessKeyId\" : \"ASxxx" ... }"

But we were accessing its properties as if it were a json response which was returning a null value.

response.AccessKeyId <- This would return null.

Now we make a call to get a json response, which can now be used to fetch the fields correctly:

response = "{"Code":"Success","LastUpdated":"2026-02-18T00:10:44Z","Type":"AWS-HMAC", "AccessKeyId":"ASxxx", ... "}

AWS credentials successfully fetched.
Successfully fetched bucket metadata:

P.S.: This was tested with the google-auth-lib 10.6.0 with the @google-cloud/storage.

@vverman vverman requested a review from a team as a code owner February 18, 2026 00:48
@vverman vverman requested a review from sofisl February 18, 2026 01:12
@vverman vverman merged commit 8c50526 into googleapis:main Feb 20, 2026
12 of 13 checks passed
@release-please release-please bot mentioned this pull request Feb 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants