[−][src]Struct roa::jwt::JwtGuard
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]
fn handle<'async_trait>(
&'a self,
ctx: &'a mut Context<S>,
next: Next<'a>
) -> Pin<Box<dyn Future<Output = Result> + 'async_trait>> where
'a: 'async_trait,
Self: 'async_trait,
[src]
&'a self,
ctx: &'a mut Context<S>,
next: Next<'a>
) -> Pin<Box<dyn Future<Output = Result> + 'async_trait>> where
'a: 'async_trait,
Self: 'async_trait,
impl PartialEq<JwtGuard> for JwtGuard
[src]
impl StructuralPartialEq for JwtGuard
[src]
Auto Trait Implementations
impl RefUnwindSafe for JwtGuard
impl Send for JwtGuard
impl Sync for JwtGuard
impl Unpin for JwtGuard
impl UnwindSafe for JwtGuard
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
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]
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,
fn handle<'async_trait>(
&'a self,
ctx: &'a mut Context<S>,
next: &'a mut (dyn Future<Output = Result<(), Status>> + 'a + Unpin)
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + 'async_trait>> where
'a: 'async_trait,
T: 'async_trait,
[src]
&'a self,
ctx: &'a mut Context<S>,
next: &'a mut (dyn Future<Output = Result<(), Status>> + 'a + Unpin)
) -> Pin<Box<dyn Future<Output = Result<(), Status>> + 'async_trait>> where
'a: 'async_trait,
T: 'async_trait,
impl<S, T> MiddlewareExt<S> for T where
T: for<'a> Middleware<'a, S>,
[src]
T: for<'a> Middleware<'a, S>,
fn chain<M>(self, next: M) -> Chain<Self, M> where
M: for<'a> Middleware<'a, S>,
[src]
M: for<'a> Middleware<'a, S>,
fn end<E>(self, next: E) -> Chain<Self, E> where
E: for<'a> Endpoint<'a, S>,
[src]
E: for<'a> Endpoint<'a, S>,
fn shared(self) -> Shared<S> where
S: 'static,
[src]
S: 'static,
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]
T: 'static + Clone + Send + Sync,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,