rs_firebase_admin_sdk/credentials/gcp/
mod.rs1use super::{Credentials, CredentialsError};
2use crate::GcpCredentials;
3use error_stack::{Report, ResultExt};
4
5impl Credentials for GcpCredentials {
6 async fn get_access_token(&self, scopes: &[&str]) -> Result<String, Report<CredentialsError>> {
7 let token = self
8 .token(scopes)
9 .await
10 .change_context(CredentialsError::Internal)?;
11
12 Ok(token.as_str().into())
13 }
14
15 async fn get_project_id(&self) -> Result<String, Report<CredentialsError>> {
16 self.project_id()
17 .await
18 .change_context(CredentialsError::Internal)
19 .map(|t| (*t).to_owned())
20 }
21}