pub fn default_credentials() -> Result<Arc<dyn Credentials>, Error>Expand description
The first credentials found, in this order:
ORIGINCLOUD_ACCESS_TOKEN: an access token, sent as it is.ORIGINCLOUD_CLIENT_IDandORIGINCLOUD_CLIENT_SECRET: a service account’s credential, exchanged for access tokens as they expire. Only one of the two set is an error.- A CI job’s OIDC token, exchanged at the security token service
(
Federated): from the fileORIGINCLOUD_OIDC_TOKEN_FILEnames, or else from GitHub Actions, in a job grantedpermissions: id-token: write. Once found, its errors are returned, not passed over.ORIGINCLOUD_OIDC_DISABLED=trueleaves this step out;ORIGINCLOUD_STS_ENDPOINTasks another address thanSTS_ENDPOINT, andORIGINCLOUD_OIDC_AUDIENCErequests GitHub’s token for another audience thanOIDC_AUDIENCE. - The session the
originCLI stored at its last login (origin id login). - The instance’s metadata service, on an instance that runs as a
service account (
InstanceMetadata). Nothing is requested until a token is; off an instance, that fails withError::NoCredentialswithin about two seconds.ORIGINCLOUD_METADATA_DISABLED=trueleaves this step out;ORIGINCLOUD_METADATA_ENDPOINTasks another address thanMETADATA_ENDPOINT.
It fails with Error::NoCredentials when the metadata service is
left out and there are no others.