Skip to content

fix(bot): require Feishu webhook token; split weixin login out of the 800-line file#3779

Merged
esengine merged 1 commit into
main-v2from
fix/bot-followup-hardening
Jun 10, 2026
Merged

fix(bot): require Feishu webhook token; split weixin login out of the 800-line file#3779
esengine merged 1 commit into
main-v2from
fix/bot-followup-hardening

Conversation

@esengine

Copy link
Copy Markdown
Owner

Small hardening + cleanup follow-up to #3763 (bot gateway).

Feishu webhook auth (fail closed). Webhook is the default Feishu mode, and verificationTokenValid accepts every caller when no token is set — so an empty verification_token exposed an unauthenticated event endpoint that anyone could use to drive the agent. Start now refuses webhook mode without a verification_token instead of serving it open. The long-connection (WebSocket) mode is unaffected.

weixin.go size. Moved the account-persistence + QR-login block (the savedAccount/LoginResult/LoginSession types and weixinAccountDirPollLogin) into weixin_login.go, bringing weixin.go from 811 to 587 lines — under the 800-line ceiling. Pure move, same package, no behavior change.

go build ./... and go test ./internal/bot/... pass locally.

Follow-up to #3763.

- Feishu webhook mode is the default, and verificationTokenValid accepts
  any caller when no token is configured, so an empty verification_token
  exposed an unauthenticated event endpoint. Refuse to start webhook mode
  without a token (fail closed).
- Move the weixin account-persistence and QR-login block to
  weixin_login.go, bringing weixin.go under the 800-line ceiling (811->587).
@esengine esengine requested a review from SivanCola as a code owner June 10, 2026 04:12
@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Jun 10, 2026
@esengine esengine merged commit a2df6ab into main-v2 Jun 10, 2026
14 checks passed
@esengine esengine deleted the fix/bot-followup-hardening branch June 10, 2026 04:16
SuMuxi66 pushed a commit to SuMuxi66/DeepSeek-Reasonix that referenced this pull request Jun 10, 2026
esengine#3779)

Follow-up to esengine#3763.

- Feishu webhook mode is the default, and verificationTokenValid accepts
  any caller when no token is configured, so an empty verification_token
  exposed an unauthenticated event endpoint. Refuse to start webhook mode
  without a token (fail closed).
- Move the weixin account-persistence and QR-login block to
  weixin_login.go, bringing weixin.go under the 800-line ceiling (811->587).

Co-authored-by: reasonix <reasonix@deepseek.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant