In GCS is it possible to provide Wild card permission for all subdomain under a domain. Have referred documentation but it was not provided. GCS CORS Docs
In GCS is it possible to provide Wild card permission for all subdomain under a domain. Have referred documentation but it was not provided. GCS CORS Docs
According to https://cloud.google.com/storage/docs/xml-api/put-bucket-cors wildcards are possible within Origin (but not within scheme, so https://*.stackoverflow.com works but http*://*.stackoverflow.com does not).
First you need a cors configuration file that will be applied to your bucket, you can create a wildcard one like this:
echo '[{"origin": ["*"], "responseHeader": ["Content-Type"], "method": ["GET", "HEAD"], "maxAgeSeconds": 3600}]' > cors-config.json
Then apply this new config file to your bucket:
gsutil cors set cors-config.json gs://YOUR_BUCKET_NAME
You can check that it has been applied by running the:
gsutil cors get gs://YOUR_BUCKET_NAME
command and verifying that the response matched your config file.