Trait aliri_tower::OnScopeError

source ·
pub trait OnScopeError {
    type Body;

    // Required methods
    fn on_missing_scope_claim(&self) -> Response<Self::Body>;
    fn on_scope_policy_failure(
        &self,
        held: &Scope,
        policy: &ScopePolicy
    ) -> Response<Self::Body>;
}
Expand description

Handler for responding to failures while verifying scope claims

Required Associated Types§

source

type Body

The body type returned on an error

Required Methods§

source

fn on_missing_scope_claim(&self) -> Response<Self::Body>

Response when the scope claim is missing

This can also happen if the appropriate Claim value wasn’t attached to the request prior to executing the scopes verifier.

source

fn on_scope_policy_failure( &self, held: &Scope, policy: &ScopePolicy ) -> Response<Self::Body>

Response when access is rejected due to insufficient permissions

Implementations on Foreign Types§

source§

impl<T> OnScopeError for &T
where T: OnScopeError,

§

type Body = <T as OnScopeError>::Body

source§

fn on_missing_scope_claim(&self) -> Response<Self::Body>

source§

fn on_scope_policy_failure( &self, held: &Scope, policy: &ScopePolicy ) -> Response<Self::Body>

source§

impl<T> OnScopeError for Box<T>
where T: OnScopeError,

§

type Body = <T as OnScopeError>::Body

source§

fn on_missing_scope_claim(&self) -> Response<Self::Body>

source§

fn on_scope_policy_failure( &self, held: &Scope, policy: &ScopePolicy ) -> Response<Self::Body>

source§

impl<T> OnScopeError for Rc<T>
where T: OnScopeError,

§

type Body = <T as OnScopeError>::Body

source§

fn on_missing_scope_claim(&self) -> Response<Self::Body>

source§

fn on_scope_policy_failure( &self, held: &Scope, policy: &ScopePolicy ) -> Response<Self::Body>

source§

impl<T> OnScopeError for Arc<T>
where T: OnScopeError,

§

type Body = <T as OnScopeError>::Body

source§

fn on_missing_scope_claim(&self) -> Response<Self::Body>

source§

fn on_scope_policy_failure( &self, held: &Scope, policy: &ScopePolicy ) -> Response<Self::Body>

Implementors§

source§

impl<ResBody> OnScopeError for TerseErrorHandler<ResBody>
where ResBody: Default,

§

type Body = ResBody

source§

impl<ResBody> OnScopeError for VerboseErrorHandler<ResBody>
where ResBody: Default,

§

type Body = ResBody