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: support scopes for metadata credentials on GCF/Cloud Run/App Engine #376

Closed
wants to merge 4 commits into from

Conversation

sqrrrl
Copy link

@sqrrrl sqrrrl commented Oct 23, 2019

Based on PR #333 which has been sitting for a while and has some unresolved issues blocking merging.

Updates that code to be more conservative in terms of compatibility -- default case is same as before and no scopes param is included if with_scopes() never used.

Only thing I'd like to change, but has some compatibility risks, is how google.auth.default(scopes) works. Currently it only applies the scopes iff the credential requires scoping. This case is a little different -- the scoping is optional as the credential has default scopes.

So instead of:

credentials, project_id = google.auth.default(scopes)

Code currently needs to be:

credentials, project_id = google.auth.default()
credentials = credentials.with_scopes(scopes)

Minor difference, but kind of annoying that the short form doesn't work. Either requires changing the behavior of default() to always attempting scoping (which sounds like the right behavior anyway) or falsely reporting that scoping is required for the credentials.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Oct 23, 2019
@sqrrrl sqrrrl changed the title Support scopes for metadata credentials on GCF/Cloud Run/App Engine feat: Support scopes for metadata credentials on GCF/Cloud Run/App Engine Oct 23, 2019
@sqrrrl sqrrrl changed the title feat: Support scopes for metadata credentials on GCF/Cloud Run/App Engine feat: support scopes for metadata credentials on GCF/Cloud Run/App Engine Oct 23, 2019
@busunkim96 busunkim96 closed this Jul 31, 2020
@busunkim96 busunkim96 reopened this Jul 31, 2020
@tseaver
Copy link
Contributor

tseaver commented Nov 10, 2020

Superseded by #633.

@tseaver tseaver closed this Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants