0

I have a bucket with a sub-folder structure to add media e.g. bucket/Org1/ ... bucket/Org2/ ... and I want to generate a signed url for all the media inside each subfolder, so users that belongs to organization 1 only can view they files.

Of course I don't want to generate a signed url for each file (can be a lot) and also ACL doesn't work, because my users are logged with a non-google account (and can haven't)

so there is any way to allow like bucket/Org1/* ?

Math
  • 768
  • 1
  • 8
  • 18

1 Answers1

2

Unfortunately, no. For retrieving objects, signed URLs need to be for exact objects. You'd need to generate one per object.

One way to accomplish this would be to write a small App Engine app that they attempt to download from instead of directly from GCS which would check authentication according to whatever mechanism you're using and then, if they pass, generate a signed URL for that resource and redirect the user.

Brandon Yarbrough
  • 37,021
  • 23
  • 116
  • 145