Repository navigation
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces support for non-default universe domains in service account credentials. Key changes include the addition of a resolution mechanism for universe domains, updates to credential parsing to reject legacy PKCS#12 (.p12) files in non-default universes, and modifications to service account credential logic to prevent unsupported OAuth2 token exchanges for non-default domains. Extensive testing has been added to verify these constraints and ensure correct behavior across different environments. I have no feedback to provide on these changes.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #16761 +/- ##
==========================================
+ Coverage 92.96% 92.99% +0.03%
==========================================
Files 2284 2284
Lines 234824 235229 +405
==========================================
+ Hits 218303 218755 +452
+ Misses 16521 16474 -47 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Legacy PKCS#12 (
.p12) service account keys do not carryuniverse_domainortoken_urimetadata and cannot mint self-signed JWTs (private_key_idisunknown). Previously, both the OpenSSL and Win32
.p12parsers hardcodedhttps://oauth2.googleapis.com/tokenwithout consulting the configured universedomain, so loading a
.p12key in a non-default universe environment causedtoken refreshes to post RS256 JWT assertions signed with the service account
private key to
https://oauth2.googleapis.com/token.Additionally,
ServiceAccountCredentials::UseOAuth()checkedDisableSelfSignedJWTOptionbefore checking whether the credential specifies anon-default
universe_domain, which could override self-signed JWT selectionand route non-GDU service account credentials through OAuth2 token exchange.
ParseServiceAccountCredentials()also defaulted an omittedtoken_uritohttps://oauth2.googleapis.com/tokeneven for non-GDU service accounts.