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

Implement AuthHandler.sign_string #15

Open lalinsky opened 9 years ago

lalinsky commented 9 years ago

OAuth2ServiceAccountAuth should implement the sign_string method, so that generate_url can work. The code below works for me, but it should be abstracted and I'm not sure what are all the auth methods that the plugin supports:

  def sign_string(self, string_to_sign):
    import base64
    from oauth2client.crypt import Signer
    signer = Signer.from_string(self.oauth2_client._private_key)
    return base64.b64encode(signer.sign(string_to_sign))
bharris47 commented 7 years ago

Any plans to implement this? generate_url is broken even when generating an unsigned url.