pub struct AuthorizerBuilder<C = RegisteredClaims>where
C: Clone + DeserializeOwned,{ /* private fields */ }
Expand description
Authorizer Layer builder
- initialisation of the Authorizer from jwks, rsa, ed, ec or secret
- can define a checker (jwt claims check)
Implementations§
Source§impl<C> AuthorizerBuilder<C>
authorization layer builder
impl<C> AuthorizerBuilder<C>
authorization layer builder
Sourcepub fn from_oidc(issuer: &str) -> AuthorizerBuilder<C>
pub fn from_oidc(issuer: &str) -> AuthorizerBuilder<C>
Builds Authorizer Layer from a OpenId Connect discover metadata
Sourcepub fn from_jwks_url(url: &str) -> AuthorizerBuilder<C>
pub fn from_jwks_url(url: &str) -> AuthorizerBuilder<C>
Builds Authorizer Layer from a JWKS endpoint
pub fn from_jwks(path: &str) -> AuthorizerBuilder<C>
pub fn from_jwks_text(text: &str) -> AuthorizerBuilder<C>
Sourcepub fn from_rsa_pem(path: &str) -> AuthorizerBuilder<C>
pub fn from_rsa_pem(path: &str) -> AuthorizerBuilder<C>
Builds Authorizer Layer from a RSA PEM file
Sourcepub fn from_rsa_pem_text(text: &str) -> AuthorizerBuilder<C>
pub fn from_rsa_pem_text(text: &str) -> AuthorizerBuilder<C>
Builds Authorizer Layer from an RSA PEM raw text
Sourcepub fn from_ec_pem(path: &str) -> AuthorizerBuilder<C>
pub fn from_ec_pem(path: &str) -> AuthorizerBuilder<C>
Builds Authorizer Layer from a EC PEM file
Sourcepub fn from_ec_pem_text(text: &str) -> AuthorizerBuilder<C>
pub fn from_ec_pem_text(text: &str) -> AuthorizerBuilder<C>
Builds Authorizer Layer from a EC PEM raw text
Sourcepub fn from_ed_pem(path: &str) -> AuthorizerBuilder<C>
pub fn from_ed_pem(path: &str) -> AuthorizerBuilder<C>
Builds Authorizer Layer from a EC PEM file
Sourcepub fn from_ed_pem_text(text: &str) -> AuthorizerBuilder<C>
pub fn from_ed_pem_text(text: &str) -> AuthorizerBuilder<C>
Builds Authorizer Layer from a EC PEM raw text
Sourcepub fn from_secret(secret: &str) -> AuthorizerBuilder<C>
pub fn from_secret(secret: &str) -> AuthorizerBuilder<C>
Builds Authorizer Layer from a secret phrase
Sourcepub fn refresh(self, refresh: Refresh) -> AuthorizerBuilder<C>
pub fn refresh(self, refresh: Refresh) -> AuthorizerBuilder<C>
Refreshes configuration for jwk store
Sourcepub fn no_refresh(self) -> AuthorizerBuilder<C>
pub fn no_refresh(self) -> AuthorizerBuilder<C>
no refresh, jwks will be loaded juste once
Sourcepub fn check<F>(self, checker_fn: F) -> AuthorizerBuilder<C>
pub fn check<F>(self, checker_fn: F) -> AuthorizerBuilder<C>
configures token content check (custom function), if false a 403 will be sent. (AuthError::InvalidClaims())
pub fn validation(self, validation: Validation) -> AuthorizerBuilder<C>
Sourcepub fn jwt_source(self, src: JwtSource) -> AuthorizerBuilder<C>
pub fn jwt_source(self, src: JwtSource) -> AuthorizerBuilder<C>
configures the source of the bearer token
(default: AuthorizationHeader)
Sourcepub fn http_client(self, http_client: Client) -> AuthorizerBuilder<C>
pub fn http_client(self, http_client: Client) -> AuthorizerBuilder<C>
provide a custom http client for oicd requests if not called, uses a default configured client
(default: None)
Sourcepub async fn layer(self) -> Result<AuthorizationLayer<C>, InitError>
👎Deprecated since 0.10.0: please use IntoLayer::into_layer()
instead
pub async fn layer(self) -> Result<AuthorizationLayer<C>, InitError>
IntoLayer::into_layer()
insteadBuild layer