Skip to main content

huskarl_login/
lib.rs

1#![forbid(unsafe_code)]
2#![deny(clippy::panic)]
3#![warn(clippy::pedantic)]
4#![warn(missing_docs)]
5#![cfg_attr(docsrs, feature(doc_cfg))]
6
7//! Shared login core for huskarl framework integrations.
8//!
9//! This crate contains the framework-agnostic login logic shared by
10//! `huskarl-axum` and `huskarl-pingora`: configuration, session drivers,
11//! cookie helpers, URL helpers, grant abstraction, and session store traits.
12//!
13//! The canonical [`SessionDriver`] interface returns `Vec<HeaderValue>` from
14//! mutating methods (`save`, `touch`, `delete`). Framework crates that need a
15//! different interface (e.g. Pingora's `&mut ResponseHeader`) adapt with a
16//! small helper that appends the returned headers.
17
18pub mod cookie;
19pub mod engine;
20pub mod session;
21pub mod url;
22
23mod config;
24mod cookie_session;
25mod error_page;
26mod grant;
27mod session_state;
28mod store_session;
29
30pub use config::{ConfigError, LoginConfig};
31pub use cookie_session::{CookieData, CookieSession, CookieSessionStore};
32pub use engine::{DefaultPersistFailurePolicy, PersistFailurePolicy};
33pub use error_page::{DefaultErrorPage, ErrorPage, ErrorPageResponse};
34pub use grant::{CompletedLogin, LoginGrant};
35pub use session::{SessionDriver, SessionError};
36pub use session_state::{Session, SessionState};
37pub use store_session::{
38    ExternalSessionStore, PersistedSession, PersistedSessionState, StoreBackedSessionStore,
39};