auth#
This module uses GCP’s default mechanisms to find account info. This mechanism works if the code is running on a GCP machine.
Code that runs on a GCP machine may be able to infer credentials and project_id
via google.auth.default().
If the code is running on a non-GCP machine but needs to interact with GCP, you can set up environment variables to “impersonate” a GCP machine.
- cloudly.gcp.auth.get_credentials(*, valid_for_seconds: int = 600, return_state: bool = False) Credentials | tuple[Credentials, bool][source]#
- valid_for_seconds: the credentials should be valid for at least this many seconds;
if the existing credential would expire sooner than this, renew it.
- return_state: if True, return whether credentials have been renewed in this call;
if False, do not return this info.