pub struct MetadataServerProviderInner { /* private fields */ }
Expand description
Provides tokens
using the metadata server accessible when running from within GCP. Should not be used directly as it
is not cached. Use MetadataServerProvider
instead.
Implementations§
Trait Implementations§
source§impl Debug for MetadataServerProviderInner
impl Debug for MetadataServerProviderInner
source§impl IdTokenProvider for MetadataServerProviderInner
impl IdTokenProvider for MetadataServerProviderInner
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 parse_id_token_response<S>(
&self,
_hash: u64,
response: Response<S>
) -> Result<IdToken, Error>
fn parse_id_token_response<S>( &self, _hash: u64, response: Response<S> ) -> Result<IdToken, Error>
Once a
IdTokenResponse
has been received for an id token request, call this method
to deserialize the token.source§fn get_id_token_with_access_token<S>(
&self,
_audience: &str,
_access_token_resp: AccessTokenResponse<S>
) -> Result<IdTokenRequest, Error>
fn get_id_token_with_access_token<S>( &self, _audience: &str, _access_token_resp: AccessTokenResponse<S> ) -> Result<IdTokenRequest, Error>
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§impl TokenProvider for MetadataServerProviderInner
impl TokenProvider for MetadataServerProviderInner
source§fn get_token_with_subject<'a, S, I, T>(
&self,
subject: Option<T>,
scopes: I
) -> Result<TokenOrRequest, Error>
fn get_token_with_subject<'a, S, I, T>( &self, subject: Option<T>, scopes: I ) -> Result<TokenOrRequest, Error>
Like
TokenProvider::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>
fn parse_token_response<S>( &self, _hash: u64, response: Response<S> ) -> Result<Token, Error>
Once a response has been received for a token request, call this method
to deserialize the token (and potentially store it in a local cache for
reuse until it expires).
source§fn get_token<'a, S, I>(&self, scopes: I) -> Result<TokenOrRequest, Error>
fn get_token<'a, S, I>(&self, scopes: I) -> Result<TokenOrRequest, Error>
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
Auto Trait Implementations§
impl Freeze for MetadataServerProviderInner
impl RefUnwindSafe for MetadataServerProviderInner
impl Send for MetadataServerProviderInner
impl Sync for MetadataServerProviderInner
impl Unpin for MetadataServerProviderInner
impl UnwindSafe for MetadataServerProviderInner
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