Struct jwt_actix::JwtAuth [−][src]
pub struct JwtAuth { /* fields omitted */ }
Expand description
JWT validating middleware for Actix-Web.
Implementations
pub fn new_from_env(
validator: fn(_: &ServiceRequest, _: &Option<Jwt>) -> bool
) -> Result<Self, JwtAuthError>
[src]
pub fn new_from_env(
validator: fn(_: &ServiceRequest, _: &Option<Jwt>) -> bool
) -> Result<Self, JwtAuthError>
[src]Create a new instance of JwtAuth. The URL for the keystore must be
provided in the environment variable JWKS_URL
at runtime.
A validator function of type JwtValidator
must be provided. For every
request, this will be called with the request and token information, and
the function will determine whether the request should be processed
(true
) or not (false
).
pub fn new_from_url(
validator: fn(_: &ServiceRequest, _: &Option<Jwt>) -> bool,
jwks_url: String
) -> Result<Self, JwtAuthError>
[src]
pub fn new_from_url(
validator: fn(_: &ServiceRequest, _: &Option<Jwt>) -> bool,
jwks_url: String
) -> Result<Self, JwtAuthError>
[src]Create a new instance of JwtAuth. The keystore for validating token
signatures will be downloaded from the given jwks_url
.
A validator function of type JwtValidator
must be provided. For every
request, this will be called with the request and token information, and
the function will determine whether the request should be processed
(true
) or not (false
).
Trait Implementations
impl<S, B> Transform<S, ServiceRequest> for JwtAuth where
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error>,
B: MessageBody,
B: 'static,
S::Future: 'static,
[src]
impl<S, B> Transform<S, ServiceRequest> for JwtAuth where
S: Service<ServiceRequest, Response = ServiceResponse<B>, Error = Error>,
B: MessageBody,
B: 'static,
S::Future: 'static,
[src]type Transform = JwtAuthService<S>
type Transform = JwtAuthService<S>
The TransformService
value created by this factory
Creates and returns a new Transform component, asynchronously
Auto Trait Implementations
impl !RefUnwindSafe for JwtAuth
impl UnwindSafe for JwtAuth