pub struct TokenInfoServiceClientBuilder<P: TokenInfoParser> {
pub parser: Option<P>,
pub endpoint: Option<String>,
pub query_parameter: Option<String>,
pub fallback_endpoint: Option<String>,
}Expand description
A builder for a TokenInfoServiceClient
§Features
asyncenablesbuild_asyncbuild_async_with_metrics
async+metrixenablesbuild_async_with_metrix
Fields§
§parser: Option<P>§endpoint: Option<String>§query_parameter: Option<String>§fallback_endpoint: Option<String>Implementations§
Source§impl<P> TokenInfoServiceClientBuilder<P>
impl<P> TokenInfoServiceClientBuilder<P>
Sourcepub fn new(parser: P) -> Self
pub fn new(parser: P) -> Self
Create a new TokenInfoServiceClientBuilder with the given
TokenInfoParser already set.
Sourcepub fn with_parser(&mut self, parser: P) -> &mut Self
pub fn with_parser(&mut self, parser: P) -> &mut Self
Sets the TokenInfoParser. The TokenInfoParser is mandatory.
Sourcepub fn with_endpoint<T: Into<String>>(&mut self, endpoint: T) -> &mut Self
pub fn with_endpoint<T: Into<String>>(&mut self, endpoint: T) -> &mut Self
Sets the introspection endpoint. The introspection endpoint is mandatory.
Sourcepub fn with_fallback_endpoint<T: Into<String>>(
&mut self,
endpoint: T,
) -> &mut Self
pub fn with_fallback_endpoint<T: Into<String>>( &mut self, endpoint: T, ) -> &mut Self
Sets a fallback for the introspection endpoint. The fallback is optional.
Sourcepub fn with_query_parameter<T: Into<String>>(
&mut self,
parameter: T,
) -> &mut Self
pub fn with_query_parameter<T: Into<String>>( &mut self, parameter: T, ) -> &mut Self
Sets the query parameter for the access token. If ommitted the access token will be part of the URL.
Sourcepub fn build(self) -> InitializationResult<TokenInfoServiceClient>
pub fn build(self) -> InitializationResult<TokenInfoServiceClient>
Build the TokenInfoServiceClient. Fails if not all mandatory fields
are set.
Sourcepub fn from_env() -> InitializationResult<Self>
pub fn from_env() -> InitializationResult<Self>
Creates a new TokenInfoServiceClientBuilder from environment
parameters.
The following variables used to identify the field in a token info response:
TOKKIT_TOKEN_INTROSPECTION_ENDPOINT(mandatory): The endpoint of the service *TOKKIT_TOKEN_INTROSPECTION_QUERY_PARAMETER(optional): The request parameterTOKKIT_TOKEN_INTROSPECTION_FALLBACK_ENDPOINT(optional): A fallback endpoint
If TOKKIT_TOKEN_INTROSPECTION_QUERY_PARAMETER is ommitted the access
token will be part of the URL.
Source§impl TokenInfoServiceClientBuilder<PlanBTokenInfoParser>
impl TokenInfoServiceClientBuilder<PlanBTokenInfoParser>
Sourcepub fn plan_b(
endpoint: String,
) -> TokenInfoServiceClientBuilder<PlanBTokenInfoParser>
pub fn plan_b( endpoint: String, ) -> TokenInfoServiceClientBuilder<PlanBTokenInfoParser>
Create a new TokenInfoServiceClient with prepared settings.
Sourcepub fn plan_b_from_env() -> InitializationResult<TokenInfoServiceClientBuilder<PlanBTokenInfoParser>>
pub fn plan_b_from_env() -> InitializationResult<TokenInfoServiceClientBuilder<PlanBTokenInfoParser>>
Create a new TokenInfoServiceClient with prepared settings from
environment variables.
TOKKIT_TOKEN_INTROSPECTION_ENDPOINT and
TOKKIT_TOKEN_INTROSPECTION_FALLBACK_ENDPOINT will be used and
TOKKIT_TOKEN_INTROSPECTION_QUERY_PARAMETER will have no effect.
Source§impl TokenInfoServiceClientBuilder<GoogleV3TokenInfoParser>
impl TokenInfoServiceClientBuilder<GoogleV3TokenInfoParser>
Sourcepub fn google_v3() -> TokenInfoServiceClientBuilder<GoogleV3TokenInfoParser>
pub fn google_v3() -> TokenInfoServiceClientBuilder<GoogleV3TokenInfoParser>
Create a new TokenInfoServiceClient with prepared settings.
[More information](https://developers.google. com/identity/protocols/OAuth2UserAgent#validatetoken)
Source§impl TokenInfoServiceClientBuilder<AmazonTokenInfoParser>
impl TokenInfoServiceClientBuilder<AmazonTokenInfoParser>
Sourcepub fn amazon() -> TokenInfoServiceClientBuilder<AmazonTokenInfoParser>
pub fn amazon() -> TokenInfoServiceClientBuilder<AmazonTokenInfoParser>
Create a new TokenInfoServiceClient with prepared settings.
[More information](https://images-na.ssl-images-amazon. com/images/G/01/lwa/dev/docs/website-developer-guide.TTH.pdf)