Trait Authenticator

Source
pub trait Authenticator: Extension {
    // Required method
    fn authenticate(&mut self, headers: Headers) -> Result<Token, ErrorResponse>;
}
Expand description

A trait that extends Extension and provides authentication functionality.

Required Methods§

Source

fn authenticate(&mut self, headers: Headers) -> Result<Token, ErrorResponse>

Authenticates the request using the provided headers.

§Arguments
  • headers - The request headers to authenticate with.
§Returns
  • Ok(Token) - A valid authentication token if successful.
  • Err(ErrorResponse) - An error response if authentication fails.

Implementors§