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,820 points
854 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
• 5,430 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,230 points
1,032 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
1,551 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,946 views
0 votes
1 answer

Hyperledger Sawtooth vs Quorum in concurrency and speed Ask

Summary: Both should provide similar reliability of ...READ MORE

answered Sep 26, 2018 in IoT (Internet of Things) by Upasana
• 8,620 points
1,470 views
0 votes
0 answers
0 votes
1 answer
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