Is there a way to create a gcs client with a signed url and then read it? The canonical way of creating a default client and doing ReadObject() doesn't work for me because the code can be executed by any service and not all of these services have access to the underlying GCS buckets. Giving access to these buckets to everyone is not practical and the easiest option for me would be to somehow use the signed URL that we get from upstream service and use that to create GCS client. The download of signed URL was working fine with curl, but it's too slow and I'm trying to parallelize it but hitting the permission issue with GCS client library.
void download(std::string signedUrl) {
auto client = gcs::Client::CreateDefaultClient().value();
// [bucket, object] = extractBucketAndObject(signedUrl);
auto is = client.ReadObject(
bucket, object, gcs::ReadRange(offset, offset + length));
}
I found online that we can set options for gcs client, e.g.
auto client = gcs::Client(g::Options{}.set<gcs::RestEndpointOption>(
"https://storage.googleapis.com"));
But I don't see an option to pass in the signature/expiry date attributes in options.h