Struct jwt_authorizer::layer::JwtAuthorizer
source · pub struct JwtAuthorizer<C>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> JwtAuthorizer<C>where
C: Clone + DeserializeOwned + Send + Sync,
impl<C> JwtAuthorizer<C>where
C: Clone + DeserializeOwned + Send + Sync,
layer builder
pub fn new() -> Self
pub fn from_jwks_url(self, url: &'static str) -> JwtAuthorizer<C>
pub fn from_rsa_pem(self, path: &'static str) -> JwtAuthorizer<C>
pub fn from_ec_der(self, path: &'static str) -> JwtAuthorizer<C>
pub fn from_ed_der(self, path: &'static str) -> JwtAuthorizer<C>
pub fn from_secret(self, path: &'static str) -> JwtAuthorizer<C>
sourcepub fn with_check(self, checker_fn: fn(_: &C) -> bool) -> JwtAuthorizer<C>
pub fn with_check(self, checker_fn: fn(_: &C) -> bool) -> JwtAuthorizer<C>
layer that checks token validity and claim constraints (custom function)
sourcepub fn layer(&self) -> AsyncAuthorizationLayer<C>
pub fn layer(&self) -> AsyncAuthorizationLayer<C>
build axum layer