Struct tame_oauth::gcp::ServiceAccountProvider
source · [−]pub struct ServiceAccountProvider { /* private fields */ }
Expand description
A token provider for a GCP service account.
Implementations
Creates a new ServiceAccountAccess
given the provided service
account info. This can fail if the private key is encoded incorrectly.
Gets the ServiceAccountInfo
this was created for
Trait Implementations
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 ServiceAccountProvider::get_token
, but allows the JWT “subject”
to be passed in.
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.
fn get_token<'a, S, I>(&self, scopes: I) -> Result<TokenOrRequest, Error> where
S: AsRef<str> + 'a,
I: IntoIterator<Item = &'a S>,
fn get_token<'a, S, I>(&self, scopes: I) -> Result<TokenOrRequest, Error> where
S: AsRef<str> + 'a,
I: IntoIterator<Item = &'a S>,
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