GoogleCloudPlatform / cloud-run-proxy

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

Feature Request: Refresh token on expiry (or quit!) #18

Closed nielm closed 2 years ago

nielm commented 2 years ago

The requested token expires after 1hr normally. The tool knows this expire time, but will continue running.

If the tool could refresh the token automatically on expiry, or quit so that it could be relaunched automatically, then this would be a great additional feature.

Workaround:

while true ; do 
   ./cloud-run-proxy \
       -host "${SERVER_HOST}"  \
       -bind "127.0.0.1:8001" \
       -server-up-time 50m
done &
sethvargo commented 2 years ago

Hi @nielm

Thank you for opening an issue. The workaround you provided is the best option. Not all tokens are refreshable or inspectable by the client, and Go doesn't offer a great way to signal shutdown from inside the proxy.