googleapis / nodejs-storage

Node.js client for Google Cloud Storage: unified object storage for developers and enterprises, from live data serving to data analytics/ML to data archiving.
https://cloud.google.com/storage/
Apache License 2.0
888 stars 367 forks source link

Signed URL prefix #2472

Open gabrielmcreynolds opened 1 month ago

gabrielmcreynolds commented 1 month ago

I would like the ability to generate a signed url that is valid for all files in a bucket with a given prefix.

There have been multiple issues requesting similar abilities, but it looks like the core ability of Google Cloud supports this. It looks the API allows creation of signed urls with a prefix. It would be nice if this functionality was built into the client library. I'm imagining something along the lines of:

  const [signedUrl] = await storage.bucket(bucketName).getSignedUrl({
    version: 'v4',
    expires: Date.now() + expirationSeconds * 1000,
    prefix: pathPrefix
  });
ddelgrosso1 commented 1 month ago

Thanks @gabrielmcreynolds we will take a look at adding this functionality.