Module google_token

Module google_token 

Source
Expand description

OAuth2 access tokens for Google Cloud APIs, from wherever the process runs.

GoogleAccessToken::from_env finds a token the way Google’s client libraries do for a service: an explicit GOOGLE_ACCESS_TOKEN, else the metadata server that Cloud Run, GKE and Compute Engine provide, else the gcloud CLI on a developer machine. Tokens are cached until shortly before they expire, so calling token per request is cheap.

Structs§

GoogleAccessToken
A cached source of Google OAuth2 access tokens. See the module docs.