actix_web_httpauth/headers/authorization/scheme/mod.rs
1use std::fmt::{Debug, Display};
2
3use actix_web::http::header::{HeaderValue, TryIntoHeaderValue};
4
5pub mod basic;
6pub mod bearer;
7
8use crate::headers::authorization::errors::ParseError;
9
10/// Authentication scheme for [`Authorization`](super::Authorization) header.
11pub trait Scheme: TryIntoHeaderValue + Debug + Display + Clone + Send + Sync {
12 /// Try to parse an authentication scheme from the `Authorization` header.
13 fn parse(header: &HeaderValue) -> Result<Self, ParseError>;
14}