Repository navigation
fix: keep universe domain from source credentials in impersonated credentials - #3304
robertvoinescu-work wants to merge 2 commits into
Conversation
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Just double checking here, is parameters.UniverseDomain the top level universe domain in the json?
b/588886791