[][src]Struct roa::jwt::JwtGuard

pub struct JwtGuard { /* fields omitted */ }
This is supported on feature="jwt" only.

A middleware to deny unauthorized requests.

The json web token should be deliver by request header "authorization", in format of Authorization: Bearer <token>.

If request fails to pass verification, return 401 UNAUTHORIZED and set response header "WWW-Authenticate".

Methods

impl JwtGuard[src]

pub fn new(secret: DecodingKey, validation: Validation) -> Self[src]

This is supported on feature="jwt" only.

Construct guard.

Trait Implementations

impl Clone for JwtGuard[src]

impl Debug for JwtGuard[src]

impl<'a, S> Middleware<'a, S> for JwtGuard[src]

impl PartialEq<JwtGuard> for JwtGuard[src]

impl StructuralPartialEq for JwtGuard[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

impl<'a, S, T, F> Middleware<'a, S> for T where
    F: 'a + Future<Output = Result<(), Status>>,
    S: 'a,
    T: 'static + Send + Sync + Fn(&'a mut Context<S>, &'a mut (dyn Future<Output = Result<(), Status>> + 'a + Unpin)) -> F, 
[src]

impl<S, T> MiddlewareExt<S> for T where
    T: for<'a> Middleware<'a, S>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> State for T where
    T: 'static + Clone + Send + Sync
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,