Struct rs_firebase_admin_sdk::GcpCredentials
source · pub struct GcpCredentials { /* private fields */ }Expand description
Authentication manager is responsible for caching and obtaining credentials for the required scope
Construct the authentication manager with AuthenticationManager::new() or by creating
a CustomServiceAccount, then converting it into an AuthenticationManager using the From
impl.
Implementations§
source§impl AuthenticationManager
impl AuthenticationManager
sourcepub async fn new() -> impl Future<Output = Result<AuthenticationManager, Error>>
pub async fn new() -> impl Future<Output = Result<AuthenticationManager, Error>>
Finds a service account provider to get authentication tokens from
Tries the following approaches, in order:
- Check if the
GOOGLE_APPLICATION_CREDENTIALSenvironment variable if set; if so, use a custom service account as the token source. - Look for credentials in
.config/gcloud/application_default_credentials.json; if found, use these credentials to request refresh tokens. - Send a HTTP request to the internal metadata server to retrieve a token; if it succeeds, use the default service account as the token source.
- Check if the
gcloudtool is available on thePATH; if so, use thegcloud auth print-access-tokencommand as the token source.
Trait Implementations§
source§impl Credentials for GcpCredentials
impl Credentials for GcpCredentials
source§fn get_access_token<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
scopes: &'life1 [&'life2 str]
) -> Pin<Box<dyn Future<Output = Result<String, Report<CredentialsError>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_access_token<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, scopes: &'life1 [&'life2 str] ) -> Pin<Box<dyn Future<Output = Result<String, Report<CredentialsError>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,
Implementation for generation of OAuth2 access token
source§fn set_credentials<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
headers: &'life1 mut HeaderMap,
scopes: &'life2 [&'life3 str]
) -> Pin<Box<dyn Future<Output = Result<(), Report<CredentialsError>>> + Send + 'async_trait>>where
Self: Sync + 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn set_credentials<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 self, headers: &'life1 mut HeaderMap, scopes: &'life2 [&'life3 str] ) -> Pin<Box<dyn Future<Output = Result<(), Report<CredentialsError>>> + Send + 'async_trait>>where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,
Set credentials for a API request, by default use bearer authorization for passing access token
source§impl From<CustomServiceAccount> for AuthenticationManager
impl From<CustomServiceAccount> for AuthenticationManager
source§fn from(service_account: CustomServiceAccount) -> AuthenticationManager
fn from(service_account: CustomServiceAccount) -> AuthenticationManager
Converts to this type from the input type.
Auto Trait Implementations§
impl !RefUnwindSafe for AuthenticationManager
impl Send for AuthenticationManager
impl Sync for AuthenticationManager
impl Unpin for AuthenticationManager
impl !UnwindSafe for AuthenticationManager
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more