GCP App Engine Access to GCloud Storage without sharing publicly

0 votes
In order to serve information from Google Cloud Storage without configuring the bucket's rights to "share publicly," I need to know how to grant a Google Cloud Platform App Engine project access.

Node JS is being used in my App engine project. I do not wish to set access on an individual user level using IAM because it uses Passport-SAML authentication to verify users before enabling them to view information. Currently, my app's private folder, which is only accessible after users have authenticated, is where images and videos are served. I want to transfer these assets to Google Cloud Storage so that the app may read the files without giving everyone access to them. How do I approach this?
Nov 10, 2022 in GCP by Tejashwini
• 3,470 points
145 views

1 answer to this question.

0 votes

I believe that https://cloud.google.com/storage/docs/access-control/create-signed-urls-program will work for you. I can't seem to locate the Node.js API documentation (google is really messing around with their doc urls). Here is a snippet of code:

bucket.upload(filename, options, function(err, file, apiResponse) {
var mil = Date.now()+60000;
var config = {
  action: 'read',
  expires: mil
};

file.getSignedUrl(config, function(err, url) {
  if (err) {
    return;
  }
  console.log(url);
});
answered Nov 10, 2022 by Ashwini
• 2,960 points

Related Questions In GCP

0 votes
1 answer

Can I give a user access to cloud storage who doesn't have a GCP account?

Yes, you could certainly do this.  You can ...READ MORE

answered Nov 5, 2019 in GCP by Sirajul
• 59,210 points
505 views
0 votes
1 answer

python-magic on GCP App Engine - failing to deploy

If you want to use the python-magic library you ...READ MORE

answered Apr 6, 2022 in GCP by Korak
• 5,820 points
519 views
0 votes
1 answer
0 votes
1 answer

Truffle tests not running after truffle init

This was a bug. They've fixed it. ...READ MORE

answered Sep 11, 2018 in Blockchain by Christine
• 15,790 points
1,208 views
0 votes
1 answer
0 votes
0 answers
0 votes
1 answer
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP