pub type TokenProviderWrapper = CachedTokenProvider<TokenProviderWrapperInner>;Aliased Type§
pub struct TokenProviderWrapper { /* private fields */ }Implementations§
Source§impl TokenProviderWrapper
impl TokenProviderWrapper
Sourcepub fn get_default_provider() -> Result<Option<Self>, Error>
pub fn get_default_provider() -> Result<Option<Self>, Error>
Get a TokenProvider following the “Google Default Credentials”
flow, in order:
-
If the
GOOGLE_APPLICATION_CREDENTIALSenvironment variable is set, use that as a path to aServiceAccountInfo. -
Check for a gcloud’s Application Default Credentials for
EndUserCredentials -
If we’re running on GCP, use the local metadata server.
-
Otherwise, return None.
If it appears that a method is being used, but is actually invalid,
eg GOOGLE_APPLICATION_CREDENTIALS is set but the file doesn’t exist or
contains invalid JSON, an error is returned with the details