Skip to content

fix: keep universe domain from source credentials in impersonated credentials - #3304

Open
robertvoinescu-work wants to merge 2 commits into
mainfrom
fix/b588886791
Open

robertvoinescu-work wants to merge 2 commits into
mainfrom
fix/b588886791

Conversation

@robertvoinescu-work

Copy link
Copy Markdown
Contributor

b/588886791

@robertvoinescu-work
robertvoinescu-work requested a review from a team as a code owner November 23, 2026 19:50

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request ensures that an impersonated service account credential correctly inherits the universe domain from its source credential when the top-level universe domain is null, empty, or whitespace. This is achieved by updating the check in CredentialFactory.CreateImpersonatedServiceAccountCredential and adding corresponding unit tests and test data. I have no further feedback to provide as the changes are well-implemented and covered by tests.

@amanda-tarafa amanda-tarafa left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM as is, but either here or in a follow up PR can you confirm we are covering all bases, with tests:

  • Both the inner and outer universe domains are set to the same value. Good.
  • Both the inner and outer universe domains are set, but to different values. Fail on credential creation.
  • Only the inner one is set, use that one.
  • Only the outer one is set, use that one.
  • None is set, use default googleapis.com


var impersonatedCredential = ImpersonatedCredential.Create(sourceCredential.ToGoogleCredential(), initializer);
if (parameters.UniverseDomain != parameters.SourceCredential.UniverseDomain)
if (!string.IsNullOrWhiteSpace(parameters.UniverseDomain)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just double checking here, is parameters.UniverseDomain the top level universe domain in the json?

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