Expand description
Framework-agnostic core for Rocket integration (no rocket dependency).
Rocket 集成的框架无关共享层(不依赖 rocket)。
Holds SaTokenState / builder and JSON error helpers; re-exports router APIs for bindings.
包含 SaTokenState / Builder、JSON 错误体辅助;为重绑定层重导出路由相关 API。
Re-exports§
pub use state::SaTokenState;pub use state::SaTokenStateBuilder;
Modules§
- error_
response - Shared JSON bodies for HTTP bindings (framework-agnostic core).
- state
- Application state without Rocket types.
Structs§
- Auth
Flow Result - Outcome of
run_auth_flow; bindings copy token/login_id/context into framework-specific storage (extensions, depot, etc.).run_auth_flow的返回结果;各框架绑定把 token / login_id / context 写入自身存储(extensions、Depot 等)。 - Auth
Result - Authentication result after processing 处理后的鉴权结果
- Path
Auth Config - Path-based authentication configuration 基于路径的鉴权配置
Functions§
- create_
context - Create SaTokenContext from authentication result 从鉴权结果创建SaTokenContext
- extract_
token - Generic token extraction from any
SaRequestimplementation. 从任意SaRequest实现中按统一顺序提取 Token。 - process_
auth - Process authentication for a request path 处理请求路径的鉴权
- run_
auth_ flow - Full auth pipeline:
extract_token→ optionalPathAuthConfigviaprocess_auth, else default check →create_context. 完整鉴权流水线:extract_token→ 若有PathAuthConfig则process_auth,否则默认校验 →create_context。