-
Notifications
You must be signed in to change notification settings - Fork 110
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
Fix GCE creds serialization w/ oauth2client >= 4.0 #195
Conversation
When updating gsutil to use oauth2client 4.1.2 and apitools 0.5.19, testing on GCE instances showed that GceAssertionCredentials were not being written to our credential storage file. Debugging showed that this was because of a KeyError when looking for the 'scope' attribute in a serialized credential (no longer included as of oauth2client 3.0). This change maintains backward compatibility for oauth2client versions that used the 'scope' attribute while also working for current versions that don't include 'scope' when constructing a GceAssertionCredentials object.
FYI: Fixed the linter errors and ensured credential serialization still works on GCE. |
Is it possible emulate each version (serializable/unserializable) of GceAssertionCredentials in a unit test to ensure to_json/from_json both work? |
Not sure how/why to test a version that doesn't support |
LGTM pending fixing the Travis CI lint errors. |
D'oh. Fixed. |
When updating gsutil to use oauth2client 4.1.2 and apitools 0.5.19,
testing on GCE instances showed that GceAssertionCredentials were not
being written to our credential storage file. Debugging showed that this
was because of a KeyError when looking for the 'scope' attribute in a
serialized credential (no longer included as of oauth2client 3.0). The
'scope' value was also mistakenly being passed in as an argument for
'email'. This change maintains backward compatibility for oauth2client
versions that used the 'scope' attribute while also working for current
versions that don't include 'scope' when constructing a
GceAssertionCredentials object.