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: multi universe support, adding universe_domain field #1282

Merged
merged 36 commits into from Dec 20, 2023

Conversation

TimurSadykov
Copy link
Member

@TimurSadykov TimurSadykov commented Sep 12, 2023

This adds a multi-universe support to all the credentials.
Also adds reading a universe_domain field from ServiceAccount and modifies it for ExternalAccounts

A related change is to manage (builder, toString/hashCode/equals) common fields: universeDomain and quotaProjectId in the base GoogleCredentials class so we don't manage them in all the Credentials like before.

@TimurSadykov TimurSadykov requested review from a team as code owners September 12, 2023 18:06
@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label Sep 12, 2023
Copy link
Contributor

@lsirac lsirac left a comment

Choose a reason for hiding this comment

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

I didn't comment on all of them, but lets be consistent with our java docs (capitalization, periods, etc)

TimurSadykov and others added 2 commits September 13, 2023 05:23
Co-authored-by: Leo <39062083+lsirac@users.noreply.github.com>
@product-auto-label product-auto-label bot added size: l Pull request size is large. and removed size: m Pull request size is medium. labels Sep 13, 2023
@sonarcloud
Copy link

sonarcloud bot commented Sep 13, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@TimurSadykov TimurSadykov changed the title feat: first draft of tpc support, adding universe_domain field feat: first draft of multi universe support, adding universe_domain field Sep 21, 2023
@product-auto-label product-auto-label bot added size: xl Pull request size is extra large. and removed size: l Pull request size is large. labels Nov 20, 2023
@TimurSadykov
Copy link
Member Author

I didn't comment on all of them, but lets be consistent with our java docs (capitalization, periods, etc)

Agree for the javadocs body, except single sentence @params and other keywords.. its is mostly lowcaps, no period now.

@TimurSadykov TimurSadykov changed the title feat: first draft of multi universe support, adding universe_domain field feat: multi universe support, adding universe_domain field Dec 12, 2023
@product-auto-label product-auto-label bot added size: xl Pull request size is extra large. and removed size: l Pull request size is large. labels Dec 12, 2023
@TimurSadykov TimurSadykov added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 12, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 12, 2023
Copy link

@westarle westarle left a comment

Choose a reason for hiding this comment

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

feel free to ignore nits; noticing that use of explicit "this." is pretty common and comes down to personal preference :)

@@ -54,6 +56,19 @@ public abstract class Credentials implements Serializable {
*/
public abstract String getAuthenticationType();

/**
* Returns the universe domain for the credential.

Choose a reason for hiding this comment

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

Similar to other APIs this should indicate that the call is blocking, and may refresh tokens as necessary to align them to the universe domain.

Copy link
Member Author

Choose a reason for hiding this comment

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

Added, thanks!

Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure I understand why we mention token refreshes or that is it blocking? Seems reasonable that all calls are blocking unless the API specifies otherwise.

@@ -71,7 +77,10 @@ public class GoogleCredentials extends OAuth2Credentials implements QuotaProject
* @return the credentials instance
*/
public static GoogleCredentials create(AccessToken accessToken) {
return GoogleCredentials.newBuilder().setAccessToken(accessToken).build();
return GoogleCredentials.newBuilder()

Choose a reason for hiding this comment

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

deprecate this constructor in favor of the builder?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done

Copy link
Contributor

Choose a reason for hiding this comment

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

I think you forgot to deprecate it?

Copy link

@westarle westarle left a comment

Choose a reason for hiding this comment

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

Just left a couple more nits to address, thank you.

Copy link

sonarcloud bot commented Dec 19, 2023

Quality Gate Passed Quality Gate passed

Kudos, no new issues were introduced!

0 New issues
0 Security Hotspots
No data about Coverage
No data about Duplication

See analysis details on SonarCloud

@TimurSadykov TimurSadykov added the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 20, 2023
@yoshi-kokoro yoshi-kokoro removed the kokoro:force-run Add this label to force Kokoro to re-run the tests. label Dec 20, 2023
@TimurSadykov TimurSadykov merged commit 7eb322e into main Dec 20, 2023
21 checks passed
@TimurSadykov TimurSadykov deleted the tpc-stage1 branch December 20, 2023 16:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: xl Pull request size is extra large.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants