Skip to content

Version 0.17 breaks GCS blob signing #1964

Description

@dguaraglia

When trying to update our project to use gcloud 0.17, we found one of our tests which uses the generate_signed_url for GCS blobs started failing with the following error:

project/tests/common.py:302:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
project/gcs.py:159: inget_signed_urlreturnself._content.generate_signed_url(delta, method=method, content_type=content_type)
../../../../.virtualenvs/project/lib/python2.7/site-packages/gcloud/storage/blob.py:239: ingenerate_signed_urlgeneration=generation)
../../../../.virtualenvs/project/lib/python2.7/site-packages/gcloud/credentials.py:223: ingenerate_signed_urlstring_to_sign)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
credentials=<oauth2client.client.GoogleCredentialsobjectat0x10f435690>, expiration=1467937858string_to_sign='GET\n\napplication/json\n1467937858\n/project-test-hcpc74v437kuc-ops/file7jcwv4v437kuc'def_get_signed_query_params(credentials, expiration, string_to_sign):
"""Gets query parameters for creating a signed URL. :type credentials: :class:`oauth2client.client.AssertionCredentials` :param credentials: The credentials used to create a private key for signing text. :type expiration: int or long :param expiration: When the signed URL should expire. :type string_to_sign: string :param string_to_sign: The string to be signed by the credentials. :rtype: dict :returns: Query parameters matching the signing credentials with a signed payload. """>_, signature_bytes=credentials.sign_blob(string_to_sign)
EAttributeError: 'GoogleCredentials'objecthasnoattribute'sign_blob'

Metadata

Metadata

Assignees

Labels

api: storageIssues related to the Cloud Storage API.authtype: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions