Skip to main content

Authenticate

Trait Authenticate 

Source
pub trait Authenticate:
    Send
    + Sync
    + 'static {
    // Required methods
    fn authenticate<'a>(&'a self, headers: &'a HeaderMap) -> AuthFuture<'a>;
    fn challenge(&self) -> HeaderValue;
}
Expand description

Decides who is calling, from the request’s headers alone.

None is answered with 401 and challenge. The path, the query string and the body are never passed in, so a credential in the URL cannot be read. Implementations must not log credentials, and should take the same time for a wrong credential as for a right one where they can.

Required Methods§

Source

fn authenticate<'a>(&'a self, headers: &'a HeaderMap) -> AuthFuture<'a>

The principal for these headers, or None.

Source

fn challenge(&self) -> HeaderValue

The WWW-Authenticate value sent with 401.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§