Forum Academy Marketplace Showcase Pricing Features

How to refresh temp Google storage URLs in a RG on page load?

Good day.

I am storing end-user images & other media in Google Cloud. Privacy issues have been difficult to sort in how I display them back to the end user in the Bubble UI.

If I have a repeating group, containing a list of images (and other artifacts). - Is there a way when the page is loaded to generate/refresh temporary URLs from Google storage to those images for the end users? They are viewing the end images, not clicking the URLs themselves. Seems the easiest way to maintain privacy as they would only get to those URLs by virtue of logging into their respective projects in the Bubble App (so random joe public can’t get to them).

If there is another option, happy to hear suggestions as well :slight_smile:

1 Like

What about a backend workflow running on the images list to generate those URLs upon user login?

Also, CORS configuration allowing only GET request from your app domain name sounds the way to go.

1 Like

Thanks, @redvivi if that is possible, that just may do it! It sounds like that would keep privacy secure by keeping the URLs temporary and tied to the individual user or project for a limited time.

Is there a good resource or tutorial on how to fetch and refresh the URLs? Searches for signed URL and Google don’t turn up much on the forums or maybe I am not searching by the right term.

Also happy to work with a coach if any are lurking and understand the issue.

Feel free to take inspiration on the Instructions section of the following plugin page, action #2 “Get Download Presigned Expiring Url”:

You have to pass the list of images (bucket and path) you want to regenerate to a recursive workflow on that list, hence generating an expiring download URL for each image.

Please DM me if you need advanced support on this.

1 Like

Much appreciated! Was able to sort it this weekend with your tips!

With your help I am now easily renewing those on the backend at time of login. If an number of users stay logged in for longer than the duration of the signed url, is there a best practice to poll and keep those refreshed?

Why not scheduling the next workflow to regenerate the URLs just before expiration time (scheduling itself) ?

Or you could check on each header page load the time remaining before expiry and act accordingly.

1 Like