From 98a8d197e25feea1448b5edaf855ba6dd780c2ca Mon Sep 17 00:00:00 2001 From: Danny Hermes Date: Mon, 13 Jul 2015 20:46:05 -0700 Subject: [PATCH] Documenting exclusion of GCE for generate_signed_url. Fixes #983. --- gcloud/credentials.py | 7 +++++++ gcloud/storage/blob.py | 8 ++++++++ 2 files changed, 15 insertions(+) diff --git a/gcloud/credentials.py b/gcloud/credentials.py index 3fdcd39e2280..43a7a7bd790f 100644 --- a/gcloud/credentials.py +++ b/gcloud/credentials.py @@ -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. diff --git a/gcloud/storage/blob.py b/gcloud/storage/blob.py index 48dedf409310..8b56f252d0c8 100644 --- a/gcloud/storage/blob.py +++ b/gcloud/storage/blob.py @@ -157,6 +157,14 @@ def generate_signed_url(self, expiration, method='GET', connection=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.