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

feat: Support ID token for SAs in other than the default universe domain #2921

Merged
merged 2 commits into from
Jan 28, 2025

Conversation

amanda-tarafa
Copy link
Contributor

Closes b/333097506

These are truly general purpose requests to the IAM Service Credential API, we just happened to be using them for impersonation only.
@amanda-tarafa amanda-tarafa requested a review from jskeet January 28, 2025 00:49
@amanda-tarafa amanda-tarafa requested a review from a team as a code owner January 28, 2025 00:49
@@ -330,11 +330,11 @@ public Task<OidcToken> GetOidcTokenAsync(OidcTokenOptions options, CancellationT
// then initialize the token here.
TokenRefreshManager tokenRefreshManager = null;
tokenRefreshManager = new TokenRefreshManager(
ct => RefreshOidcTokenAsync(tokenRefreshManager, options, ct), Clock, Logger);
ct => RefreshDefultUniverseOidcTokenAsync(tokenRefreshManager, options, ct), Clock, Logger);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Defult => Default

public static TheoryData<string, string, string, string> OidcData => new TheoryData<string, string, string, string>
{
// universe domain, token URL, SA id, expected OIDC URL
{ null, "http://will.be.ignored", "MyId", "http://will.be.ignored/" },
Copy link
Collaborator

Choose a reason for hiding this comment

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

"will.be.ignored" sounds wrong if we're later asserting that we've actually made a call to it. (I'd expected tests which demonstrated the more radically different paths taken here, but maybe I just don't understand.)

Copy link
Contributor Author

@amanda-tarafa amanda-tarafa left a comment

Choose a reason for hiding this comment

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

@jskeet comments adressed and squashed in last commit.

Copy link
Collaborator

@jskeet jskeet left a comment

Choose a reason for hiding this comment

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

Much better, thanks :)

@amanda-tarafa amanda-tarafa merged commit ee422c6 into googleapis:main Jan 28, 2025
3 checks passed
@amanda-tarafa amanda-tarafa deleted the id-token branch January 28, 2025 08:38
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