fix(kook): KOOK 机器人鉴权用 Authorization: Bot <token> 而非 Bearer
CI / Backend (build / vet / test / cross-compile) (push) Has been cancelled
CI / Frontend (tsc + vite build) (push) Has been cancelled

httpclient 硬编码 Bearer,导致 KOOK bot token 被当 OAuth2 用户令牌发,
/ gateway/index 返回 401『登录环境异常』。按 KOOK reference 鉴权规范,
给共享 httpclient 增加可配置 authScheme(默认 Bearer),KOOK 用 Bot。

- httpclient: 新增 WithAuthScheme 选项 + authScheme 字段,do() 按 scheme 组装
- kook/adapter: 装配时传 WithAuthScheme("Bot")
- 同步修正 config.go 注释与 send/identity 测试断言
This commit is contained in:
Aska committed 2026-09-07 16:59:53 +08:00
1 parent e9df928072
commit c1bd740f7c
5 files changed
+36 -18

No files matched your search

+1 -1
View File
@@ -3,7 +3,7 @@
// modes: a WebSocket-gateway mode (events over a gateway WebSocket with
// hello/heartbeat/event/resume signaling) and a Webhook mode (KOOK POSTs event
// callbacks to a Cyrene gateway route). Outbound messages are always sent over a
// bearer-authenticated REST API.
// bot-token-authenticated REST API (`Authorization: Bot <token>`).
//
// The adapter conforms to internal/channel/adapter.PlatformAdapter, translating
// native KOOK events into the normalized adapter.UnifiedMessage model and