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: add support for universe domain (phase 1) #477

Merged
merged 18 commits into from
Nov 28, 2023

Conversation

bshaffer
Copy link
Contributor

@bshaffer bshaffer commented Sep 7, 2023

Requirements:

  1. For all credentials: Create the universe_domain read property. The default value for the property is googleapis.com.
  2. For Service Account Credentials: Read the universe_domain from the credentials file and expose the value through the property created above. If the credentials file does not have the universe_domain value, the property should use the default value googleapis.com.

@bshaffer
Copy link
Contributor Author

bshaffer commented Nov 20, 2023

@vishwarajanand we won't cut a release until after the freeze, but I'd love to get an approval on this before the EOY

*/
public function getUniverseDomain(): string
{
if (null === $this->universeDomain) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you want to handle the case when universeDomain is an empty string? Or is it guaranteed to be having a valid value (eg. when always downloaded from gcp console)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good question. The spec does not provide any guidance around empty strings for universe domain (go/cloudsdk-tpc-authlibs), except when it is a 404 error from the MDS (which is handled in phase 2).

If we added special handling for empty strings, it would be to throw an exception. But as an empty string for a universe domain will throw an error in the client libraries anyway (because we throw an error for a user-supplied empty string, and also for a mismatch), I can't think of a real important reason why we need to throw an exception now, and would prefer to leave it out (unless we can think of a specific case where it would be important to do so).

Copy link
Contributor

@vishwarajanand vishwarajanand left a comment

Choose a reason for hiding this comment

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

Lgtm

bshaffer and others added 2 commits November 28, 2023 09:37
@bshaffer bshaffer enabled auto-merge (squash) November 28, 2023 15:46
@bshaffer bshaffer merged commit 35781ed into main Nov 28, 2023
11 checks passed
@bshaffer bshaffer deleted the add-universe-domain-phase1 branch November 28, 2023 15:47
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