Skip to main content

Authenticator

Trait Authenticator 

Source
pub trait Authenticator<I: Clone + Send + Sync + 'static>:
    Send
    + Sync
    + 'static {
    // Required method
    fn authenticate(&self, request: &Request) -> Result<I>;
}
Expand description

Authenticator for authenticating requests to a sharing server.

I is the identity type inserted into request extensions. It must be Clone + Send + Sync + 'static so it can be stored in axum extensions.

Required Methods§

Source

fn authenticate(&self, request: &Request) -> Result<I>

Authenticate a request and return an identity value.

This method should return the identity of the caller, or an error if the request is not authenticated or the identity cannot be determined.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§