GoogleCloudPlatform / cloud-run-proxy

Local proxy for authenticating requests to Cloud Run
Apache License 2.0
124 stars 20 forks source link

Feature request: command line flag to use access token instead of identity token #17

Closed nielm closed 1 year ago

nielm commented 1 year ago

Another use of this tool is to as an authentication proxy to cloud storage, but this requires the access-token instead of the authentication token.

This is useful to point 3rd party tools that use unauthenticated HTTP access to URLs to a Cloud Storage Bucket.

(for example a local cache of a external site)

Example usage (with workaround using gcloud auth)

cloud-run-proxy \
       -host https://storage.googleapis.com/  \
       -token  "$(gcloud auth print-access-token)" \
       -bind "127.0.0.1:8001" \
       -server-up-time 50m

curl -L "http://localhost:8001/${BUCKET_NAME}/${OBJECT_PATH}" -o object_name
sethvargo commented 1 year ago

Hi @nielm - this proxy is specifically designed to work with Cloud Run, which accepts OIDC tokens. As such, I'm not going to expand cloud-run-proxy to support other Google Cloud services.