GoogleCloudPlatform / gcs-oauth2-boto-plugin

Auth plugin allowing use the use of OAuth 2.0 credentials for Google Cloud Storage in the Boto library.
Apache License 2.0
21 stars 38 forks source link

Improve logic for detecting PKCS 12 keys #45

Closed catleeball closed 5 years ago

catleeball commented 5 years ago

When attempting to load a PKCS 12 key in Python 3, io.open would throw an error since it tried to apply UTF-8 text encoding to the key file, which was not a compatible text file.

Changes tested using .p12 key from our pre-release tests.

catleeball commented 5 years ago

@houglum Understood! A try / except is a more simple implementation. If we do ever have to deal with other binary key formats and need to distinguish PKCS 12 from them, the old functions are stashed in this gist: https://gist.github.com/catleeball/d69cd73ca545f8cb8f183dad33de9118

Submitted a patch. :)

catleeball commented 5 years ago

@houglum Once this is merged, should I point gsutil to the new head of this repo, or wait for us to do a new release in this repo? I'm not sure what the release process is like for gcs-oauth2-boto-plugin

houglum commented 5 years ago

We'll need to do a new release of this package. Once merged, I can take care of doing the release :)

catleeball commented 5 years ago

@houglum got it, fixed :)

houglum commented 5 years ago

Just did a release for v2.4 that should include these changes!