Skip to main content

Crate huskarl_login

Crate huskarl_login 

Source
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§

CompletedLogin
The result of a successful login completion.
CookieSession
A session that stores token state encrypted in browser cookies.
CookieSessionStore
A built-in session store that encrypts session data into chunked cookies.
DefaultErrorPage
The built-in error page renderer.
ErrorPageResponse
The rendered content of an error page.
LoginConfig
Configuration for the login middleware.
PersistedSessionState
Framework-managed session state carried by every store-backed session.
SessionState
Common token and timing state shared by all session types.
StoreBackedSessionStore
A session store that keeps an encrypted pointer cookie in the browser and stores session data in an external ExternalSessionStore.

Enums§

ConfigError
Errors that can occur when building a LoginConfig.

Traits§

CookieData
Trait for cookie session payload types.
ErrorPage
Renders error pages for the login middleware.
ExternalSessionStore
Trait for external session data stores (Redis, database, etc.).
LoginGrant
Abstracts the Authorization Code Grant start/complete lifecycle.
PersistedSession
Trait implemented by every store-backed session type, exposing the embedded PersistedSessionState to 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.