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/oauth2adapt): convert token metadata where possible #11062

Merged
merged 1 commit into from
Oct 30, 2024

Conversation

codyoss
Copy link
Member

@codyoss codyoss commented Oct 30, 2024

This was missed in the orginal implmentation. The code is still not prefect as converting from an oauth2.Token to auth.Token is lossy because there is no way to extract out the whole metadata context. Converting from auth.Token -> oauth2.Token is not lossy though.

This bug was discovered because some direct path checks look for theses metadata values. Just to be safe we will preserve both forms of these values in the final token metadata, if present.

Internal Bug: 376281562

This was missed in the orginal implmentation. The code is still not
prefect as converting from an oauth2.Token to auth.Token is lossy
because there is no way to extract out the whole metadata context.
Converting from auth.Token -> oauth2.Token is not lossy though.

This bug was discovered because some direct path checks look for
theses metadata values. Just to be safe we will preserve both forms
of these values in the final token metadata, if present.

Internal Bug: 376281562
@codyoss codyoss requested a review from a team as a code owner October 30, 2024 14:08
Copy link
Contributor

@tritone tritone left a comment

Choose a reason for hiding this comment

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

Thanks for the quick fix Cody!

@codyoss codyoss merged commit 34bf1c1 into googleapis:main Oct 30, 2024
8 checks passed
@codyoss codyoss deleted the tok-metadata branch October 30, 2024 14:26
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.

3 participants