feat(auth): 微信 session_key 迁移到 Redis — 内存降级兜底
Some checks failed
CI / rust-check (push) Has been cancelled
CI / rust-test (push) Has been cancelled
CI / frontend-build (push) Has been cancelled
CI / security-audit (push) Has been cancelled

session_key 从全局 HashMap 迁移到 Redis(SET key EX 300 / GETDEL),
Redis 不可用时自动降级到内存缓存,提升多实例部署安全性。
This commit is contained in:
iven
2026-04-27 13:05:25 +08:00
parent a4daa8f49c
commit 2519ad8fee
5 changed files with 85 additions and 36 deletions

View File

@@ -23,6 +23,7 @@ pub struct AuthState {
pub default_tenant_id: Uuid,
pub wechat_appid: String,
pub wechat_secret: String,
pub redis: Option<redis::Client>,
}
/// Parse a human-readable TTL string (e.g. "15m", "7d", "1h", "900s") into seconds.