tower-oauth2-resource-server 0.11.0

Tower middleware that provides JWT authorization against an OpenID Connect (OIDC) Provider
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use http::Response;

use crate::error::AuthError;

pub trait ErrorHandler<B>: Send + Sync {
    fn map_error(&self, error: AuthError) -> Response<B>;
}

pub struct DefaultErrorHandler;

impl<B> ErrorHandler<B> for DefaultErrorHandler
where
    B: Default,
{
    fn map_error(&self, error: AuthError) -> Response<B> {
        error.into()
    }
}