Expand description
Axum CSRF adapter with explicit product route, source and error boundaries.
Re-exports§
pub use crate::shared::csrf::CsrfError;pub use crate::shared::csrf::CsrfErrorKind;pub use crate::shared::csrf::CsrfTokenNames;pub use crate::shared::csrf::RequestSourceMode;
Structs§
- Csrf
Config - State for
from_fn_with_state(config, csrf). Product predicates decide cookie authentication. - Request
Source Policy - Runtime source policy supplied by product configuration.
Functions§
- csrf
- Enforces source and double-submit checks on product-selected unsafe requests.
- ensure_
double_ submit_ token - Checks tokens using the default names.
- ensure_
double_ submit_ token_ with_ names - Checks decoded cookies and headers using the shared constant-time comparison.
- ensure_
request_ source_ allowed - Checks request source headers against explicit trusted scheme/host and public origins. Opaque non-UTF8 headers are invalid, including in optional mode.