feat: Mediabot PSK 签名恢复 + 注册自动提权

- par.mediabot.psk 配置项(环境变量 PAR_MEDIABOT_PSK)
- HmacUtil.verifyMediabotPsk() PSK 签名验证
- POST /auth/recover: PSK 签名 → 返回/重建 apiKey/apiSecret → 自动 TRUSTED
- POST /auth/register: 携带 PSK 头 → 自动提升为 TRUSTED
- AccountService 新增 updateAccount

mediabot 端只需:
  const PSK = '内置密钥'
  sig = HMAC('email:timestamp', PSK)
  POST /auth/recover {email} + X-Medibot-* 头 → 拿回凭据
This commit is contained in:
mediabot-pt
2026-06-29 16:44:59 +08:00
parent aed8035995
commit 11d0840e42
5 changed files with 110 additions and 7 deletions

View File

@@ -46,6 +46,8 @@ mybatis-plus:
par:
static:
path: ${PAR_STATIC_PATH:./static/configs/}
mediabot:
psk: ${PAR_MEDIABOT_PSK:}
admin:
path: ${PAR_ADMIN_PATH:./static/admin/}
auth: