4 Commits
Author SHA1 Message Date
WangandCaIon 2de51a19e3 fix(cache): 修复用户和令牌缓存的 Redis 跨槽错误 (#8218)
* fix(cache): colocate user and token auth keys in Redis slots

Use shared hash tags for cache hashes and authentication fences. Add regression coverage for matching tags and document coordinated rollout requirements.

AI-assisted implementation and tests.

* fix(cache): keep cache key names and tag fences with them

Renaming user:<id> and token:<hash> split quota counters and
invalidations between old and new nodes during a rolling upgrade.
Keep those names and tag the fence and version keys with the cache
key instead, so each script still touches a single slot.

---------

Co-authored-by: CaIon <i@caion.me>
2026-11-05 23:37:43 +08:00
Calcium-Ion 706144769e fix(auth): 校验 Redis 鉴权缓存完整性 (#8200)
* fix(auth): verify Redis authentication cache integrity

* fix(auth): repair auth cache hashes with unreadable fields

A token cache hash with a field that cannot be parsed, or with a stray
DeletedAt field, fell back to the database on every request and was
never rewritten. Repairs now read the stored signature on its own,
drop DeletedAt, and replace quota counters that are not integers in
both the token and user caches. Valid counters are still kept.
2026-11-04 22:58:20 +08:00
CaIon ebe4c368f2 refactor: modernize Go code conventions 2026-09-08 20:55:03 +08:00
Calcium-Ion 31d70fca39 refactor(auth): replace dashboard sessions with stateless tokens and session control (#6329)
* refactor(auth): replace dashboard sessions with stateless tokens

* feat(auth): harden session issuance and distributed enforcement

* fix(proxy): preserve trusted proxy compatibility defaults

* refactor: address dashboard auth review feedback

* refactor: remove classic frontend and flatten web app
2026-07-20 16:48:43 +08:00