http_types/auth/
mod.rs

1//! HTTP authentication and authorization.
2//!
3//! # Examples
4//!
5//! ```
6//! # fn main() -> http_types::Result<()> {
7//! #
8//! use http_types::Response;
9//! use http_types::auth::{AuthenticationScheme, BasicAuth};
10//!
11//! let username = "nori";
12//! let password = "secret_fish!!";
13//! let authz = BasicAuth::new(username, password);
14//!
15//! let mut res = Response::new(200);
16//! authz.apply(&mut res);
17//!
18//! let authz = BasicAuth::from_headers(res)?.unwrap();
19//!
20//! assert_eq!(authz.username(), username);
21//! assert_eq!(authz.password(), password);
22//! #
23//! # Ok(()) }
24//! ```
25
26mod authentication_scheme;
27mod authorization;
28mod basic_auth;
29mod www_authenticate;
30
31pub use authentication_scheme::AuthenticationScheme;
32pub use authorization::Authorization;
33pub use basic_auth::BasicAuth;
34pub use www_authenticate::WwwAuthenticate;