6 Commits

Author SHA1 Message Date
6adae569be fix: 修复 /api/v1/sessions 500 错误
- 修复 validate_ip_and_apikey 装饰器无法获取 Request 对象的问题:
  原代码通过遍历 args 查找 Request 对象,但 FastAPI 端点使用 Pydantic
  模型作为参数时找不到 Request,导致装饰器跳过验证并可能引发异常。
  改为显式声明 request: Request 作为 wrapper 的第一个参数,由 FastAPI 自动注入。

- 增强 ensure_user_hermes_env 的错误处理:
  添加 try/except 包裹,检查 BASE_HERMES_PATH 是否存在,
  将未处理的异常转为带详细信息的 HTTPException(500)。
2026-04-27 15:40:25 +08:00
2152ae9d40 fix: v1.3.0 compatibility fixes for hermes-agent
- Fix chat command args: use '-q --source tool' for non-interactive mode
  in send_session_message to avoid entering interactive CLI
- Fix auth_method KeyError: add 'auth_method: header' default in fallback config
- Persist session registry to data/sessions.json so sessions survive restarts
- Dynamic path resolution via get_hermes_home() instead of hardcoded paths
- Update README with full API documentation (v1.3.0)
- Add .gitignore for data/, __pycache__/, .venv/
2026-04-25 11:37:32 +08:00
57afe1264c feat(security): implement IP filtering and API key authentication
- Added validate_ip_and_apikey() decorator for endpoint protection
- Implemented IP address validation with configurable allowed_ips list
- Added API key authentication with header-based or bearer token support
- Fixed endpoint function signatures to properly receive Request objects
- Updated configuration structure and security documentation
- Removed debug print statements before final commit
2026-04-22 21:41:45 +08:00
4a8d3291d3 Add Bearer token authentication support for Authorization header 2026-04-22 18:43:32 +08:00
57fbe3a6c5 Add Nginx deployment support with IP and API key security features 2026-04-22 18:40:51 +08:00
7d70f362b2 feat: Initial implementation of hermes-service with multi-user support
- Complete REST API with session management
- Dynamic user creation with isolated environments
- Multi-user isolation using /d/hermesai/users/{user_id}/.hermes structure
- Full command execution capabilities via Hermes CLI
- Health check and status endpoints
- Follows module development specifications
2026-04-21 13:20:10 +08:00