Expand description
Shared login core for huskarl framework integrations.
This crate contains the framework-agnostic login logic shared by
huskarl-axum and huskarl-pingora: configuration, session drivers,
cookie helpers, URL helpers, grant abstraction, and session store traits.
The canonical SessionDriver interface returns Vec<HeaderValue> from
mutating methods (save, touch, delete). Framework crates that need a
different interface (e.g. Pingora’s &mut ResponseHeader) adapt with a
small helper that appends the returned headers.
Re-exports§
pub use engine::DefaultPersistFailurePolicy;pub use engine::PersistFailurePolicy;pub use session::SessionDriver;pub use session::SessionError;
Modules§
- cookie
- Cookie utilities for the login layer.
- engine
- Framework-agnostic login engine.
- session
- Sealed session driver trait.
- url
- URL reconstruction and logout URL building.
Structs§
- Completed
Login - The result of a successful login completion.
- Cookie
Session - A session that stores token state encrypted in browser cookies.
- Cookie
Session Store - A built-in session store that encrypts session data into chunked cookies.
- Default
Error Page - The built-in error page renderer.
- Error
Page Response - The rendered content of an error page.
- Login
Config - Configuration for the login middleware.
- Persisted
Session State - Framework-managed session state carried by every store-backed session.
- Session
State - Common token and timing state shared by all session types.
- Store
Backed Session Store - A session store that keeps an encrypted pointer cookie in the browser and
stores session data in an external
ExternalSessionStore.
Enums§
- Config
Error - Errors that can occur when building a
LoginConfig.
Traits§
- Cookie
Data - Trait for cookie session payload types.
- Error
Page - Renders error pages for the login middleware.
- External
Session Store - Trait for external session data stores (Redis, database, etc.).
- Login
Grant - Abstracts the Authorization Code Grant start/complete lifecycle.
- Persisted
Session - Trait implemented by every store-backed session type, exposing the
embedded
PersistedSessionStateto the framework. - Session
- Exposes session state from a session type so the middleware can enforce lifetime policies (max lifetime, idle timeout, token-bound expiry) and perform token refresh.