Skip to content

feat: 管理端与AML接口统一鉴权(JWT + API Key)#6

Merged
easyshellworld merged 1 commit intoeasyshellworld:devfrom
JackCC703:copilot/admin-auth-jwt-apikey
Apr 13, 2026
Merged

feat: 管理端与AML接口统一鉴权(JWT + API Key)#6
easyshellworld merged 1 commit intoeasyshellworld:devfrom
JackCC703:copilot/admin-auth-jwt-apikey

Conversation

@JackCC703
Copy link
Copy Markdown
Contributor

变更内容

  • 为 /api/v1/admin/* 增加强制鉴权:支持管理员登录获取 JWT(12h)与 API Key 访问
  • 为 /api/v1/aml/* 增加强制 API Key 校验,未认证默认拒绝
  • 新增 AdminUser / ApiCredential 数据模型及鉴权服务中间件
  • 后台前端改为管理员登录态(登录页、JWT 持久化、401 自动登出)
  • Demo 前端 AML 请求附加 X-API-Key
  • 解决与同事最新提交的冲突,保留 earn/composer/behavior/analytics 路由能力

验证

  • backend: build + tests 通过
  • frontend-demo/frontend-admin: build 通过
  • sdk: build + tests 通过

说明

  • 不引入 Redis
  • 不新增 CORS 限制

- protect /api/v1/admin/* with JWT or API key and add /admin/auth/login\n- protect /api/v1/aml/* with API key and keep /health public\n- add AdminUser/ApiCredential models and admin frontend login session flow\n- merge latest earn/composer/behavior/analytics updates during conflict resolution

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@easyshellworld easyshellworld merged commit 7b577e6 into easyshellworld:dev Apr 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants