Skip to content

Conversation

@kenttw
Copy link

@kenttw kenttw commented Mar 21, 2017

The current version could not support oauth2client version > 2.0
So i just modify some code that just use the oauth2client util function to get credential
such as below

from oauth2client.service_account import ServiceAccountCredentials
scopes = ['https://www.googleapis.com/auth/devstorage.full_control']
credentials = ServiceAccountCredentials.from_json_keyfile_name('key.json', scopes=scopes)
project = gcs_client.Project('pixnet-gt',credentials)

@Akrog
Copy link
Owner

Akrog commented Mar 25, 2017

@Texib thanks for the pull request!!

I think it's a great idea to update the library to support the latest version, but I would prefer if we could make it in a backwards compatible way so that the library still works with the older OAuth library.

I believe it won't be too complicated, unless I'm missing something, we would just need to import oauth2client, detect the current version and define the base class of the Credentials class based on it, and modify the init method to take this into consideration.

What do you think?

@Akrog Akrog self-requested a review March 25, 2017 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants