fix(feishu): authenticate and dedupe callbacks

Authenticate signed or token-verified callbacks before dispatching
commands. Decode encrypted envelopes and handle card actions using
the correct fields without claiming irrelevant chat events.
This commit is contained in:
翅膀 committed 2026-10-23 23:23:21 +08:00
1 parent e850ec3c14
commit 0978c6c310
3 files changed
+546 -131

No files matched your search

+8
View File
@@ -16,6 +16,14 @@ export interface Env {
TELEGRAM_RICH_HEADER_HOST?: string;
FEISHU_APP_ID?: string;
FEISHU_APP_SECRET?: string;
/**
* Feishu event "Encrypt Key": verifies `X-Lark-Signature` and decrypts
* encrypted callbacks. This or FEISHU_VERIFICATION_TOKEN is required for
* inbound Feishu commands and card buttons.
*/
FEISHU_ENCRYPT_KEY?: string;
/** Feishu event "Verification Token", checked against every callback payload. */
FEISHU_VERIFICATION_TOKEN?: string;
/**
* When enabled ("1"/"true"), GitHub users without any group access get a
* personal group on first login instead of being blocked.