Skip to main content

Validator

Trait Validator 

Source
pub trait Validator:
    Send
    + Sync
    + 'static {
    // Required method
    fn validate(
        &self,
        claims: &TokenClaims,
        path: &str,
        action: Action,
    ) -> Result<(), AuthError>;
}
Expand description

Decides whether claims are allowed to perform action on path.

Required Methods§

Source

fn validate( &self, claims: &TokenClaims, path: &str, action: Action, ) -> Result<(), AuthError>

Validate a request. Returns Ok(()) or a descriptive AuthError to be turned into 401/403 by the server.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§