2
votes

I have been trying to create a signedurl using gsutil of google cloud storage, I have been using python from my windows machine Till now what I have done is

  • Created a service account from google's developer console
  • Then from my python I have executed this command to configure service account "gsutil config -e"
  • Then given my credential information as asked by the console
  • Then I tried to create a signed url for one of my object using following command
  • python gsutil signurl -d 10m -p notasecret p12file.p12 gs://{my bucket}/{my object}
  • This gave me this output with error message

https://storage.googleapis.com/support-videos/[email protected]&Expires=1409209504&Signature=GI5Uo8XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX4hHzPqq1c%3D

[email protected] does not have permissions on gs://{my bucket}/{my object} using this link will likely result in a 403 error until at least READ permissions are granted

I have given read permission to all users on object

Please, Help me out of this, I have been stuck on this for 2 days...

1
Is your long-term plan to restrict access to the object without a signed URL? If anonymous user have read access to the object, there's no reason you need to use signed URLs at all.Brandon Yarbrough
Also, followup question, does the generated URL work correctly?Brandon Yarbrough
I am facing this problem with space in file name I am using this python command python gsutil signurl -d 10m -p notasecret key.p12 "gs://bucket/File name with space check.txt" and it is giving me "SignatureDoesNotMatch" error <StringToSign> /buckethha/File%20name%20with%20space%20check.txt </StringToSign>Parag Bhayani
Interesting. I think you have discovered a gsutil bug. I will file it in the appropriate place. For now, can you try replacing the space with a %20 in the command line, as in the following and let me know if it works? gsutil signurl key.p12 gs://bucket/File%20name%20with%20spaces.txtBrandon Yarbrough
@BrandonYarbrough Nope that doesn't work, and it even doesn't show any error message, it just shows empty white browser page ... No XML Error Response –Parag Bhayani

1 Answers

0
votes

The file I was trying to access has spaces in its name due to some bugs with urlencoding I wasn't able to create proper url for it ...

So for files without spaces works fine with me

Reference -> Using google cloud storage and gsutil not able to generate valid signedurl