GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||||||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||||||||||||||||||||
GeezerVison is showing github.com — feat: Support user defined or json defined scopes for impersonated token by lqiu96 · Pull Request #1815 · googleapis/google-auth-library-java
This repository was archived by the owner on May 12, 2026. It is now read-only.
Conversation
|
|
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| if (json.containsKey("scopes")) { | ||
| scopes = ImmutableList.copyOf((List<String>) json.get("scopes")); | ||
| } |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
This scopes field was recently added and may not exist in existing ImpersonatedCred Json files. Check if it exists
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| */ | ||
| @CanIgnoreReturnValue | ||
| public Builder setScopes(List<String> scopes) { | ||
| Preconditions.checkNotNull(scopes, "Scopes cannot be null"); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Constructor has a null check that threw a IllegalStateException runtime exception. Enforce this on the setter so users don't pass in an invalid data.
This never worked, so we don't expect any breakages or changes in behavior.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Change LGTM.
Got question about CLOUD_PLATFORM_SCOPE used for sourceCredentials, but I think it does not block this change.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
| this.sourceCredentials = | ||
| this.sourceCredentials.createScoped(Arrays.asList(CLOUD_PLATFORM_SCOPE)); | ||
| this.sourceCredentials.createScoped( | ||
| Collections.singletonList(OAuth2Utils.CLOUD_PLATFORM_SCOPE)); |
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
Does it work or is it better to switch to https://www.googleapis.com/auth/iam?
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
The reason will be displayed to describe this comment to others. Learn more.
I think either should work: https://cloud.google.com/iam/docs/reference/credentials/rest/v1/projects.serviceAccounts/generateAccessToken#authorization-scopes
Not sure if there is a preference. I can update if there is.
Sorry, something went wrong.
There was an error while loading. Please reload this page.
There was an error while loading. Please reload this page.
Successfully merging this pull request may close these issues.
There was an error while loading. Please reload this page.