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 Response = S::Response
type Response = S::Response
Responses produced by the service.
type Error = S::Error
type Error = S::Error
Errors produced by the service.
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
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more