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

Drop proactive scope validation in credentials_gce. #185

Merged
merged 1 commit into from Jul 3, 2021

Conversation

craigcitro
Copy link
Collaborator

Why? Avoid confusion like #161.

When adding support for fetching credentials on a GCE VM, I had originally
added a "guard rail": if the user was requesting scope(s) which weren't
included in the list of scopes the service account was granted, I'd return
NULL, letting the credential fetch fall back to another method (eg user
creds).

However, this can lead to confusion: most Google API calls are willing to
accept various scopes, and some scopes imply other scopes (eg an API asking
for a BQ scope will happily accept the cloud-platform scope).

This change removes any scope validation in credentials_gce. On the upside, it
should make it easier for users to use gargle from a GCE VM that has the
required scopes. Unfortunately, it does allow one new bit of confusion: a user
invoking gargle on a GCE VM without the scopes needed for an API would
previously fall through to fetching user creds; they'll now need to do so
explicitly.

Fixes #161.

Why? Avoid confusion like r-lib#161.

When adding support for fetching credentials on a GCE VM, I had originally
added a "guard rail": if the user was requesting scope(s) which weren't
included in the list of scopes the service account was granted, I'd return
`NULL`, letting the credential fetch fall back to another method (eg user
creds).

However, this can lead to confusion: most Google API calls are willing to
accept various scopes, and some scopes imply other scopes (eg an API asking
for a BQ scope will happily accept the cloud-platform scope).

This change removes any scope validation in credentials_gce. On the upside, it
should make it easier for users to use gargle from a GCE VM that *has* the
required scopes. Unfortunately, it does allow one new bit of confusion: a user
invoking gargle on a GCE VM *without* the scopes needed for an API would
previously fall through to fetching user creds; they'll now need to do so
explicitly.
@jennybc
Copy link
Member

jennybc commented Jul 3, 2021

Thanks for providing the context of the original decision and why we're OK with removing these checks. Sounds good to me.

A gargle release was in flight (actually completed) before this PR came in, so, for better or worse, this will get a chance to be road-tested in the dev version for a little while. Hopefully those who care, such as the participants in #161, will install a dev version and accumulate some usage with the guard rail removed.

@jmcarp
Copy link

jmcarp commented Nov 5, 2021

I think this will fix an issue I've had trying to use google drive with gce auth. Looking forward to the next release!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Why are allowed scopes limited for credentials_gce?
3 participants