Authorize

Trait Authorize 

Source
pub trait Authorize<B> {
    type Future: Future<Output = Result<Request<B>, AuthError>>;

    // Required method
    fn authorize(&self, request: Request<B>) -> Self::Future;
}
Expand description

Trait for authorizing requests.

Required Associated Types§

Required Methods§

Source

fn authorize(&self, request: Request<B>) -> Self::Future

Authorize the request.

If the future resolves to Ok(request) then the request is allowed through, otherwise not.

Implementors§

Source§

impl<S, B, C> Authorize<B> for AuthorizationService<S, C>
where B: Send + 'static, C: Clone + DeserializeOwned + Send + Sync + 'static,

Source§

type Future = Pin<Box<dyn Future<Output = Result<Request<B>, AuthError>> + Send>>