Skip to main content

Crate sa_token_plugin_actix_web_core

Crate sa_token_plugin_actix_web_core 

Source
Expand description

Framework-agnostic core for Actix-web integration (no actix-web dependency). Actix-web 集成的框架无关共享层(不依赖 actix-web)。

Re-exports run_auth_flow / PathAuthConfig from sa-token-core::router; versioned crates (*-v4, *-v5) implement HTTP wiring. 再从 sa-token-core::router 重导出 run_auth_flowPathAuthConfig;具体 HTTP 由各版本绑定 crate(*-v4*-v5)实现。

Re-exports§

pub use state::SaTokenState;
pub use state::SaTokenStateBuilder;

Modules§

error_response
Shared JSON bodies for Actix bindings.
state
Application state without actix-web 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