Implement authentication and chat functionality with JWT support

- Added `auth.py` for mock login and JWT issuance.
- Introduced `chat.py` for handling chat requests with role-based access control.
- Enhanced `main.py` to include new routers and middleware for tracing.
- Implemented input validation in `input_guard.py` to prevent SQL injection.
- Created repositories for managing agent sessions and audit logs.
- Added exception handling for authorization errors.
- Updated settings to include JWT configuration.
- Introduced tests for authentication and input validation.
This commit is contained in:
2026-09-07 17:20:42 +08:00
parent 5f0f86a007
commit 3995cb44d8
26 changed files with 1013 additions and 10 deletions
+6 -1
View File
@@ -1 +1,6 @@
"""日志模块。"""
"""结构化日志(不打印完整 JWT)。"""
import logging
logging.basicConfig(level=logging.INFO, format="%(asctime)s %(levelname)s %(name)s %(message)s")
logger = logging.getLogger("jinrong")