I am using google storage Signed URL v4 to access the file via URL with expiry time, but I would like to specify the domain as well to restrict the URL to access everywhere on the internet. right now the google provides the fewer options to mention in the configurations of Signed URL.
I have referred this docs:
- https://cloud.google.com/storage/docs/access-control/signing-urls-manually
- https://cloud.google.com/storage/docs/access-control/signing-urls-with-helpers
Sample code for read access:
// These options will allow temporary read access to the file
const options = {
version: 'v4',
action: 'read',
expires: Date.now() + 15 * 60 * 1000, // 15 minutes
};
Is there any possibility to mention my hostname/domain name to restrict file access?, or How to access my storage files only in the specific websites?