feat: add difference between default and user-defined scope #306
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 PR allows the calling libraries (GAPIC, veneer, Apiary) to pass
$defaultScope
in separately from$scope
. This allowsServiceAccountCredentials
to use self-signed JWTs more frequently. Before, default scopes were preferred to self-signed JWTs, but if we can differentiate between user-defined and default scopes, we can prefer user-defined scopes to self-signed JWTs, but self-signed JWTs to default scopes.So in effect, our clients can use self-signed JWTs when:
Related PRs:
Note: In this implementation,
ServiceAccountCredentials
no longer callsfetchAuthToken
with default scopes. If they are invoked without an$authUri
, no credentials will be provided. This is not a BC break, as it only will take place if$defaultScopes
is utilized by the calling party. But we need to verify this is the correct behavior.