-
Notifications
You must be signed in to change notification settings - Fork 227
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: adds universe domain support for compute credentials #1346
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok
@@ -83,134 +85,152 @@ public void setIdToken(String idToken) { | |||
@Override | |||
public LowLevelHttpRequest buildRequest(String method, String url) throws IOException { | |||
if (url.equals(ComputeEngineCredentials.getTokenServerEncodedUrl())) { | |||
return getMockRequestForTokenEndpoint(url); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This diff might be tricky to read. What I did is I factored out all the if-statements contents in a separate private methods. Some are big statements that made this method hard to read.
oauth2_http/java/com/google/auth/oauth2/ComputeEngineCredentials.java
Outdated
Show resolved
Hide resolved
oauth2_http/java/com/google/auth/oauth2/ComputeEngineCredentials.java
Outdated
Show resolved
Hide resolved
oauth2_http/java/com/google/auth/oauth2/ComputeEngineCredentials.java
Outdated
Show resolved
Hide resolved
oauth2_http/java/com/google/auth/oauth2/ComputeEngineCredentials.java
Outdated
Show resolved
Hide resolved
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
This adds universe domain support to GCE credentials.
In case explicit universe_domain was provided - it takes priority
Otherwise - GCE credential tries to obtain a universe domain from Metadata service
If request fails with 404 or request returns an empty string - universe domain is set to GDU
If any other error - throws a retryable exception