8000 Merge pull request #993 from dhermes/fix-983 · googleapis/google-cloud-python@c11d9b5 · GitHub
[go: up one dir, main page]

Skip to content

Commit c11d9b5

Browse files
committed
Merge pull request #993 from dhermes/fix-983
Documenting exclusion of GCE for generate_signed_url.
2 parents 8522653 + 98a8d19 commit c11d9b5

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

gcloud/credentials.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,13 @@ def generate_signed_url(credentials, resource, expiration,
301301
content_type=None):
302302
"""Generate signed URL to provide query-string auth'n to a resource.
303303
304+
.. note::
305+
If you are on Google Compute Engine, you can't generate a signed URL.
306+
Follow https://github.com/GoogleCloudPlatform/gcloud-python/issues/922
307+
for updates on this. If you'd like to be able to generate a signed URL
308+
from GCE, you can use a standard service account from a JSON file
309+
rather than a GCE service account.
310+
304311
:type credentials: :class:`oauth2client.appengine.AppAssertionCredentials`
305312
:param credentials: Credentials object with an associated private key to
306313
sign text.

gcloud/storage/blob.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,14 @@ def generate_signed_url(self, expiration, method='GET',
157157
client=None, credentials=None):
158158
"""Generates a signed URL for this blob.
159159
160+
.. note::
161+
If you are on Google Compute Engine, you can't generate a signed URL.
162+
Follow
163+
https://github.com/GoogleCloudPlatform/gcloud-python/issues/922
164+
for updates on this. If you'd like to be able to generate a signed
165+
URL from GCE, you can use a standard service account from a JSON
166+
file rather than a GCE service account.
167+
160168
If you have a blob that you want to allow access to for a set
161169
amount of time, you can use this method to generate a URL that
162170
is only valid within a certain time period.

0 commit comments

Comments
 (0)
0