[][src]Struct gotham_middleware_jwt::JWTMiddleware

pub struct JWTMiddleware<T> { /* fields omitted */ }

This middleware verifies that JSON Web Token credentials, provided via the HTTP Authorization header, are extracted, parsed, and validated according to best practices before passing control to middleware beneath this middleware for a given mount point.

Requests that lack the Authorization header are returned with the Status Code 400: Bad Request. Tokens that fail validation cause the middleware to return Status Code 401: Unauthorized.

Methods

impl<T> JWTMiddleware<T> where
    T: for<'de> Deserialize<'de> + Send + Sync
[src]

Creates a JWTMiddleware instance from the provided secret, which, by default, uses HS256 as the crypto scheme.

Trait Implementations

impl<T> NewMiddleware for JWTMiddleware<T> where
    T: for<'de> Deserialize<'de> + RefUnwindSafe + Send + Sync + 'static, 
[src]

The type of Middleware created by the NewMiddleware.

Create and return a new Middleware value.

impl<T> Middleware for JWTMiddleware<T> where
    T: for<'de> Deserialize<'de> + Send + Sync + 'static, 
[src]

Entry point to the middleware. To pass the request on to the application, the middleware invokes the chain function with the provided state. Read more

Auto Trait Implementations

impl<T> Send for JWTMiddleware<T> where
    T: Send

impl<T> Sync for JWTMiddleware<T> where
    T: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

Performs the conversion.

impl<T> From for T
[src]

Performs the conversion.

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Borrow for T where
    T: ?Sized
[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut for T where
    T: ?Sized
[src]

Mutably borrows from an owned value. Read more

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

🔬 This is a nightly-only experimental API. (try_from)

Performs the conversion.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

🔬 This is a nightly-only experimental API. (get_type_id)

this method will likely be replaced by an associated static

Gets the TypeId of self. Read more

impl<T> Erased for T