-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Specifying option.WithScopes is ignored when using option.WithTokenSource #1644
Comments
The end behavior is intentional here, but I agree this could lead to hard to track down bugs. I think we should have a fast fail here and disallow passing both of these options at the same time as whatever is specified in the TS will always win. |
It can be something analogous to this google-api-go-client/internal/settings.go Lines 107 to 109 in d6ee425
|
If both ds.TokenSource and ds.Scopes are set, then an error will be returned as Scopes will be ignored Fixes googleapis#1644
I commented this on the linked PR but wanted to make sure the same comment was captured in this issue as well
|
fwiw, i'd be happy if its just documented in the links above (no need at the moment to aggressively throw |
Yeah, I think that may be the best option for now. @eisandbar If you are willing to make that change I think that is a way we can move forward for now. |
Should I add it to both WithScopes and WithTokenSource, or only WithScopes? |
I think just withscopes would be fine -- noting that it has no effect when used with tokensource opt. |
Clarify that when both WithScopes and WithTokenSource are used, the scope settings will be taken from the token source and the WithScopes option will be ignored. Fixes googleapis#1644
Clarify that when both WithScopes and WithTokenSource are used, the scope settings will be taken from the token source and the WithScopes option will be ignored. Fixes googleapis#1644
Clarify that when both WithScopes and WithTokenSource are used, the scope settings will be taken from the token source and the WithScopes option will be ignored. Fixes #1644
If you use both
at the same time as shown below, the scopes settings from the tokensource is used.
The following works for cloudidentity api because the "books" api scope is simply ignored
but if you invert it, you'll see a scopes error since the actual token from the config is used
consider throwing an error if both are set
The text was updated successfully, but these errors were encountered: