Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(auth): use the full format for the JWT payload in IAPToken #765

Merged
merged 1 commit into from
Jun 14, 2024

Conversation

juanamari94
Copy link
Contributor

Summary

Some of the GCP products when retrieving the JWT token from the GCE
Metadata Server come with the email claim, but some have recently
started not returning that claim as part of the JWT payload. Adding the
format=full query parameter to the GCE Metdata Server API seems to
return the email claim for these cases, along with other GCE Metadata
which for the time being we do not need and thus, we discard.

See these docs for more
information.

@juanamari94 juanamari94 requested review from TheKevJames and a team as code owners June 13, 2024 19:22
@juanamari94 juanamari94 requested review from cphoward and santiagofdialpad and removed request for a team June 13, 2024 19:22
@juanamari94 juanamari94 marked this pull request as draft June 13, 2024 19:23
@juanamari94 juanamari94 marked this pull request as ready for review June 13, 2024 19:29
@juanamari94 juanamari94 force-pushed the feat/iap-gce-metadata branch from 373225a to b3804a7 Compare June 13, 2024 20:30
Copy link
Contributor

@shaundialpad shaundialpad left a comment

Choose a reason for hiding this comment

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

Nice find!

@@ -1,6 +1,6 @@
[tool.poetry]
name = "gcloud-aio-auth"
version = "5.3.1"
version = "5.3.2a0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Friendly non alpha reminder

Copy link
Contributor

Choose a reason for hiding this comment

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

➕ HOSTILE PLUS ONE REPLY COMMENT

Copy link
Contributor

@eddiedialpad eddiedialpad left a comment

Choose a reason for hiding this comment

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

✅ approved: fix authentication

Some of the GCP products when retrieving the JWT token from the GCE
Metadata Server come with the `email` claim, but some have recently
started not returning that claim as part of the JWT payload. Adding the
`format=full` query parameter to the GCE Metadata Server API seems to
return the `email` claim for these cases, along with other GCE Metadata
which for the time being we do not need and thus, we discard.

[See these docs for more
information.](https://cloud.google.com/compute/docs/instances/verifying-instance-identity#request_signature)
@juanamari94 juanamari94 force-pushed the feat/iap-gce-metadata branch from b3804a7 to 864033e Compare June 14, 2024 14:10
Copy link
Member

@TheKevJames TheKevJames left a comment

Choose a reason for hiding this comment

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

Good find!

@juanamari94 juanamari94 merged commit b21ee3b into master Jun 14, 2024
85 checks passed
@juanamari94 juanamari94 deleted the feat/iap-gce-metadata branch June 14, 2024 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

4 participants