0
votes

I have a Flex/Java application on Google App Engine and all I want is to load large images from Google Cloud Storage using URLRequest in Flex. I'm sure this is simple but I can't get it to work. I will manually upload the images using the Google APIs Console so I don't need to write anything from the App. The images can not be public.

I'm not 100% sure how to access the file so this may be the problem. I tried these:

  • "/gs/mybucket/myimage.jpg" : not found
  • "/mybucket/myimage.jpg" : not found
  • "http://commondatastorage.googleapis.com/mybucket/myimage.jpg" : denied

I added [email protected] in the Team tab in Google APIs Console with Can View permission and I used GSUtil to get and set ACLs on both mybucket and myimage.jpg to add a READ permission for [email protected] but that didn't help.

What am I doing wrong?

2
You say "the images can not be public" - how will the flex app access them, then?Nick Johnson
The Flex App is supposed to have a READ permission on them, but that's not working very well so far. Google Cloud Storage lets you control who can access or not your files. In this case I just need [email protected] but no one else to be able to read the files. It's described here, I just don't see what I missed: https://developers.google.com/storage/docs/accesscontroluser1394563
If the user can download the flex app, and the flex app is supposed to be able to download the images, then your images are public - there's no getting around that.Nick Johnson
Well there is a password protection inside the Flex App that does not work if the App isn't on the server so I guess this should be safe. I just didn't want the images to be accessible using their actual URL nor the images being indexed on Google etc.user1394563
You're sending the app to the user - it's trivial for them to determine what images are being fetched and how, or to extract the password from the flex app. Why do you want to show the images to the user, while trying to prevent them from downloading them themselves?Nick Johnson

2 Answers

0
votes

I'm not really sure how flex works or how it is trying to access the blobs.

However, if you want to respond to a http request with the content of a Google Storage object then you can use the serve method.

https://developers.google.com/appengine/docs/java/blobstore/overview#Serving_a_Blob

0
votes

Are you authorizing the URLRequest call with an OAuth token? If not, then even though the request is initiated from an app engine app, it'll look to Google Cloud Storage like an unauthenticated, public read. I don't know if flex has a trace option but if there's a way to examine the request details, I'd check to see if you're setting up the proper authentication.

If it turns out to be too difficult to get flex to play nicely with OAuth, you could also use signed URLs (a.k.a. query string authenticated URLs). This gives you the ability to create a URL with a special signature that implicitly conveys your authorization but only people with that link can access the object. The object's ACL can be be set to disallow public access but your signed URLs will be able to read the object. You can also time limit a signed URLs, if you like. Here's the documentation on how to use this technique.