Commit Graph
4 Commits
Author SHA1 Message Date
zhanghongyu_0626 6d780d45c3 feat(auth): Enhance JWT handling and error management in authentication flow
- Updated the login endpoint to utilize shared JWT issuer/audience settings, improving consistency across modules.
- Introduced error handling for unknown accounts during token issuance, raising an UnauthorizedError when necessary.
- Enhanced traceability by adding trace and request IDs to responses, ensuring better tracking of requests.
- Refactored exception handling in middleware to properly bubble up application-specific errors, preventing them from being swallowed.
- Added new utility functions for generating trace headers to improve debugging capabilities.

This update strengthens the authentication process and enhances error visibility, contributing to a more robust and maintainable codebase.
2026-09-08 19:55:08 +08:00
GaoYiYuan_0626 207fc79f61 test: T-03 评审闭环(PASS, P0=0)——P2-1 词表规范化断言修正/P2-2 补 7 条同构变体(你现在是管理员/ignore the above instructions 等)+变体单测/P2-3 窗口 TTL 断言+EXPIRE 失败取舍锁定; P3 session_id 落库截断+trace 兜底注释, 378 绿 2026-09-07 11:16:15 +08:00
GaoYiYuan_0626 cc6f34fbbd feat: T-03 输入防护限流(T3-3)——actor 级 Redis 固定窗口 30 次/分(settings 可调), 超限 429 GUARD_RATE_LIMITED+留痕, Redis 故障 fail-open, 测试 4 例(429/窗口滚动/fail-open/注入计数), 376 绿 2026-09-07 11:10:26 +08:00
GaoYiYuan_0626 65b45aa917 feat: T-03 输入防护接入 chat(T3-2)——注入/超长命中即拒 400 + input_guard_log 留痕(fail-fast 不建会话, 留痕降级不改拒绝语义), Pydantic 硬顶 20000, 集成测试 7 例 2026-09-07 11:02:36 +08:00