-
Notifications
You must be signed in to change notification settings - Fork 146
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
Invalid use of service credentials return via 'google_default' #59
Comments
I think this should be easier to implement now, as As I mentioned elsewhere, the expiry of credentials should be checked on every |
My recommendation would be that any further development focus on moving to |
Yes, I see what you mean, it seems that Google have upped their game somewhat recently. I suggest that you do the minimum required to work with service account credentials for now, and then concentrate on the prefix/delimiter object listings, before returning to this. |
Primarily as a note to any interested parties, using the |
Opening as a tracking issue for follow-up discussed #58. I will be able to follow-up on this issue the week of 2018-01-28. From that thread:
[Testing #58] on a GCE instance I use as a dev box. On this machine I've the compute sdk installed and I'm I'm using the service account for application default credentials:
In this context
auth2client.client.GoogleCredentials.get_application_default
returns an token component that manages access to the service credentials and does not include arefresh_token
,client_secret
. It instead provides access tokens via theget_access_token
interface, which handles token expiration and refresh. It may also be used to retrieve auth headers for requests.This currently breaks the current
master
implementation, which expects a refresh token to be available.This will also break this implementation.After setting application default credentials to a user account via
gcloud auth application-default login
auth2client.client.GoogleCredentials.get_application_default
returns aGoogleCredentials
object exposingrefresh_token
et al. This credentials object is capable of handling access token and auth header generation.Given that behavior, my current recommendation would be to hold the credential object returned by the
get_application_default
and use the interfacecredential.get_access_token().access_token
to manage access.gcsfs
would then not be responsible for managing auth token management and refresh. It would also be desirable to wrap the device credentials generated via thebrowser
auth mode in a the same oauth handler and remove the token management logic currently implemented ingcsfs
.In a broader sense, I would suggest emphasizing use of the default app credentials instead of obtaining and directly caching a credential object for
gcsfs
. In "off cloud" contexts, the user can then manage authorization via thegcloud auth application-default
command, which provideslogin
,revoke
. In "on cloud" this then provides easy access to the default service account, with the option for a user to override this setting bygcloud auth login
.The text was updated successfully, but these errors were encountered: