feat: Disable universe domain check if credentials include an explicit request to do so #1119
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This is Ruby's response to internal issue b/349488459. In a separate PR for the auth library (googleapis/google-auth-library-ruby#493), we add a (temporary, optional) attribute (
disable_universe_domain_check
) to credential objects that signals the credential may incorrectly claim googleapis as its universe domain. This will be used for GCECredentials temporarily; when set (which for now it will be), GCECredentials will not query the metadata server for universe domain but will instead hard-codegoogleapis.com
. Then, this PR for gapic-common will check for thedisable_universe_domain_check
attribute, and if present and set, will not perform the universe domain consistency check. This will effectively stop universe domain MDS calls and checks for GCE credentials while leaving them active for all other credential types. It will also not break existing normal (googleapis) users because those credential objects will continue to reportgoogleapis.com
as the universe. Early testers of non-googleapis universes will simply have to update both the googleauth and gapic-common gems.