Can wget / curl protect files from Google Cloud Storage without making them public? I am not against a fixed predefined token. I just want to avoid the case when my public file gets candy and I need good dollars.
In another way, if, as you say, you do not mind to get the token from the outside, you need to use curl to set the "Authorization" header in your GCS call as follows:
curl -H "Authorization: Bearer 1/fFBGRNJru1FQd44AzqT3Zg" https://www.googleapis.com/storage/v1/b/bucket/o/object?alt=media
The request parameter "alt = media" is required to directly download the object data instead of receiving a JSON response.
You can copy and paste the token obtained by authorizing with the Cloud Storage JSON API separately on the OAuth 2.0 Playground .
See also:https://cloud.google.com/storage/docs/access-control https://cloud.google.com/storage/docs/json_api/v1/objects/get
You can use Signed URLs . This allows you to create a signed URL that you can use to download the object without additional authentication.
You can also use curlwget chrome extension , so whenever you upload something to Chrome, it creates a url with headers, etc., so that you can wget your file.
wget
Source: https://habr.com/ru/post/1245461/More articles:iOS - Google admob SDK crashes after upgrading to version 7.7.0 - iosGolang Join array interface - mysqlAdding the MinGW Compiler to QT 5.6.0 Windows - c ++Kubernets start working with docker - dockerFace Detection with KinectV2 and OpenCV - c ++Checking a JSON request string as a query parameter using Joi - jsonCalling a PHP static method with a namespace in a member variable - phpGolang slicing efficiency - performanceWhy can't I use theano.tensor.argmax and theano.tensor.mean correctly - pythonCalling a PHP static method with a variable class name and namespaces - phpAll Articles