Skip to main content

Crate sa_token_plugin_rocket_core

Crate sa_token_plugin_rocket_core 

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

AuthFlowResult
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 等)。
AuthResult
Authentication result after processing 处理后的鉴权结果
PathAuthConfig
Path-based authentication configuration 基于路径的鉴权配置

Functions§

create_context
Create SaTokenContext from authentication result 从鉴权结果创建SaTokenContext
extract_token
Generic token extraction from any SaRequest implementation. 从任意 SaRequest 实现中按统一顺序提取 Token。
process_auth
Process authentication for a request path 处理请求路径的鉴权
run_auth_flow
Full auth pipeline: extract_token → optional PathAuthConfig via process_auth, else default check → create_context. 完整鉴权流水线:extract_token → 若有 PathAuthConfigprocess_auth,否则默认校验 → create_context