security: API Key 权限范围 + 过期时间 + 用量追踪

增强:
- 权限模板: readonly / monitor / full
- 每 key 独立权限列表, 注入 user['perms']
- 可选过期时间 (ttl 参数)
- 过期 key 自动清理 (加载时 + 验证时)
- request_count 用量追踪
- 标记 is_api_key = True

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
qinglong
2026-06-13 14:27:07 +08:00
parent 9f6eb29820
commit b92b1cc4fc
4 changed files with 70 additions and 20 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
http_port: 4200
last_updated: 13895.658168292
last_updated: 13989.479860756
plugin_routes: {}
websocket_port: 4240