Skip to content

feat: feishu webhook adaptor (PHASE-08 world intake) - #28

Merged
PerishCode merged 1 commit into
mainfrom
feat/feishu-adaptor
Jul 2, 2026
Merged

PerishCode merged 1 commit into
mainfrom
feat/feishu-adaptor

Conversation

@PerishCode

Copy link
Copy Markdown
Owner

Adds the feishu (Lark) event-subscription adaptor: WebhookOutcome{Event,Reply} trait extension (challenge echo needs a JSON body; secret now reaches normalize for payload-internal auth), X-Lark-Signature verification, AES-256-CBC payload decryption, fail-closed verification-token check, im.message.receive_v1 -> locator-only doorbell (content deliberately dropped; one strand per chat), human-sender gate + allowlist. Env contract matches the placeholders already staged on hk-03. 8 new unit tests; guard green.

🤖 Generated with Claude Code

- WebhookAdaptor::normalize now returns WebhookOutcome{Event,Reply}: some
  integrations answer control-plane requests with a JSON body on the spot
  (feishu url_verification challenge echo); normalize also receives the
  subscription secret, for integrations whose auth field travels inside the
  (possibly encrypted) payload
- FeishuAdaptor: X-Lark-Signature verification (sha256(ts+nonce+key+body),
  enforced whenever presented; signed-without-key refused), AES-256-CBC payload
  decryption (key=sha256(encrypt_key), iv||ct, PKCS7), fail-closed verification
  token check, im.message.receive_v1 -> locator-only doorbell (chat_id +
  message_id + event_id; message CONTENT deliberately dropped — the soul reads
  it through its carrier), one strand per feishu chat, human-sender gate +
  SANTI_WEBHOOK_FEISHU_ALLOW allowlist (open_id or user_id)
- env contract: SANTI_WEBHOOK_FEISHU_TOKEN (subscription secret_env),
  SANTI_WEBHOOK_FEISHU_ENCRYPT_KEY, SANTI_WEBHOOK_FEISHU_ALLOW — matches the
  placeholders already staged in hk-03 /etc/santi/santi.env
- deps: aes/cbc/base64 (workspace-pinned); 8 unit tests (challenge echo, token
  fail-closed, encrypt roundtrip + wrong-key refusal, sender gates, signature)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@PerishCode
PerishCode merged commit 4fee5f6 into main Jul 2, 2026
3 checks passed
@PerishCode
PerishCode deleted the feat/feishu-adaptor branch July 2, 2026 10:47
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.

1 participant