简体   繁体   中英

Put password on google cloud function env

I want to put a password of other services on the environment variable of the Google cloud function. Does it safe?

And I saw a code like this:

exports.foo = (req,res) => {
  if(req.body.x !== "njajpgpwmda...mdjug")return;
  ...
}

I think author want to prevent others to use his function. Does it work?

Only collaborators on your project are able to see (or deploy) Cloud Functions. So both the code, and any values in there, are safe from prying eyes of the visitors of your site, or users of your app.

Whether keeping this value as plaintext in your source code is enough to meet your own security needs, only you can tell. Even if you're not worried about further securing this value though, I'd recommend storing it as an environment variable .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM