googleapis / google-cloud-cpp

C++ Client Libraries for Google Cloud Services
https://cloud.google.com/
Apache License 2.0
552 stars 373 forks source link

Add local signing to cloud storage signed urls #14597

Open ahyerman opened 3 months ago

ahyerman commented 3 months ago

What component of google-cloud-cpp is this feature request for? GCS (i.e., something in google/cloud/storage)

Is your feature request related to a problem? Please describe. GCS CLI supports local signing where a private key can be passed as part of command but client libraries do not support this (from what I can tell, this is true for all libraries- java, c++, etc.)

gsutil: https://cloud.google.com/storage/docs/gsutil/commands/signurl#usage gcloud: https://cloud.google.com/sdk/gcloud/reference/storage/sign-url

Describe the solution you'd like Support for local key usage and signing

Describe alternatives you've considered The only alternative now is to use CLI or write my own signing script.

dbolduc commented 3 months ago

Yeah, I think the client library only supports providing a service account as the google::cloud::storage::SigningAccount, e.g.:

https://github.com/googleapis/google-cloud-cpp/blob/main/google/cloud/storage/examples/storage_signed_url_v2_samples.cc

https://github.com/googleapis/google-cloud-cpp/blob/main/google/cloud/storage/examples/storage_signed_url_v4_samples.cc