Skip to content

Commit

Permalink
Merge pull request #993 from dhermes/fix-983
Browse files Browse the repository at this point in the history
Documenting exclusion of GCE for generate_signed_url.
  • Loading branch information
dhermes committed Jul 20, 2015
2 parents 8522653 + 98a8d19 commit c11d9b5
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
7 changes: 7 additions & 0 deletions gcloud/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,6 +301,13 @@ def generate_signed_url(credentials, resource, expiration,
content_type=None):
"""Generate signed URL to provide query-string auth'n to a resource.
.. note::
If you are on Google Compute Engine, you can't generate a signed URL.
Follow https://github.com/GoogleCloudPlatform/gcloud-python/issues/922
for updates on this. If you'd like to be able to generate a signed URL
from GCE, you can use a standard service account from a JSON file
rather than a GCE service account.
:type credentials: :class:`oauth2client.appengine.AppAssertionCredentials`
:param credentials: Credentials object with an associated private key to
sign text.
Expand Down
8 changes: 8 additions & 0 deletions gcloud/storage/blob.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,14 @@ def generate_signed_url(self, expiration, method='GET',
client=None, credentials=None):
"""Generates a signed URL for this blob.
.. note::
If you are on Google Compute Engine, you can't generate a signed URL.
Follow
https://github.com/GoogleCloudPlatform/gcloud-python/issues/922
for updates on this. If you'd like to be able to generate a signed
URL from GCE, you can use a standard service account from a JSON
file rather than a GCE service account.
If you have a blob that you want to allow access to for a set
amount of time, you can use this method to generate a URL that
is only valid within a certain time period.
Expand Down

0 comments on commit c11d9b5

Please sign in to comment.