pub struct ServiceAccountProviderInner { /* private fields */ }Expand description
A token provider for a GCP service account. Should not be used directly as it is not cached. Use ServiceAccountProvider instead.
Implementations§
source§impl ServiceAccountProviderInner
impl ServiceAccountProviderInner
sourcepub fn new(info: ServiceAccountInfo) -> Result<Self, Error>
pub fn new(info: ServiceAccountInfo) -> Result<Self, Error>
Creates a new ServiceAccountAccess given the provided service
account info. This can fail if the private key is encoded incorrectly.
sourcepub fn get_account_info(&self) -> &ServiceAccountInfo
pub fn get_account_info(&self) -> &ServiceAccountInfo
Gets the ServiceAccountInfo this was created for
Trait Implementations§
source§impl Debug for ServiceAccountProviderInner
impl Debug for ServiceAccountProviderInner
source§impl IdTokenProvider for ServiceAccountProviderInner
impl IdTokenProvider for ServiceAccountProviderInner
source§fn get_id_token(&self, _audience: &str) -> Result<IdTokenOrRequest, Error>
fn get_id_token(&self, _audience: &str) -> Result<IdTokenOrRequest, Error>
Attempts to retrieve an id token that can be used when communicating via IAP etc.
source§fn get_id_token_with_access_token<S>(
&self,
audience: &str,
response: AccessTokenResponse<S>
) -> Result<IdTokenRequest, Error>where
S: AsRef<[u8]>,
fn get_id_token_with_access_token<S>( &self, audience: &str, response: AccessTokenResponse<S> ) -> Result<IdTokenRequest, Error>where S: AsRef<[u8]>,
Some token sources require a access token to be used to generte a id token.
If
get_id_token returns a AccessTokenResponse, this method should be called.source§fn parse_id_token_response<S>(
&self,
_hash: u64,
response: IdTokenResponse<S>
) -> Result<IdToken, Error>where
S: AsRef<[u8]>,
fn parse_id_token_response<S>( &self, _hash: u64, response: IdTokenResponse<S> ) -> Result<IdToken, Error>where S: AsRef<[u8]>,
Once a
IdTokenResponse has been received for an id token request, call this method
to deserialize the token.source§impl TokenProvider for ServiceAccountProviderInner
impl TokenProvider for ServiceAccountProviderInner
source§fn get_token_with_subject<'a, S, I, T>(
&self,
subject: Option<T>,
scopes: I
) -> Result<TokenOrRequest, Error>where
S: AsRef<str> + 'a,
I: IntoIterator<Item = &'a S>,
T: Into<String>,
fn get_token_with_subject<'a, S, I, T>( &self, subject: Option<T>, scopes: I ) -> Result<TokenOrRequest, Error>where S: AsRef<str> + 'a, I: IntoIterator<Item = &'a S>, T: Into<String>,
Like ServiceAccountProviderInner::get_token, but allows the JWT “subject”
to be passed in.
source§fn parse_token_response<S>(
&self,
_hash: u64,
response: Response<S>
) -> Result<Token, Error>where
S: AsRef<[u8]>,
fn parse_token_response<S>( &self, _hash: u64, response: Response<S> ) -> Result<Token, Error>where S: AsRef<[u8]>,
Handle responses from the token URI request we generated in
get_token. This method deserializes the response and stores
the token in a local cache, so that future lookups for the
same scopes don’t require new http requests.
source§fn get_token<'a, S, I>(&self, scopes: I) -> Result<TokenOrRequest, Error>where
S: AsRef<str> + 'a,
I: IntoIterator<Item = &'a S> + Clone,
fn get_token<'a, S, I>(&self, scopes: I) -> Result<TokenOrRequest, Error>where S: AsRef<str> + 'a, I: IntoIterator<Item = &'a S> + Clone,
Attempts to retrieve a token that can be used in an API request, if we
haven’t already retrieved a token for the specified scopes, or the token
has expired, an HTTP request is returned that can be used to retrieve a
token. Read more