Skip to content

fix(slack): prefer webhookVerifier over signingSecret#468

Merged
bensabic merged 2 commits into
mainfrom
slack-prefer-webhook-verifier
May 9, 2026
Merged

fix(slack): prefer webhookVerifier over signingSecret#468
bensabic merged 2 commits into
mainfrom
slack-prefer-webhook-verifier

Conversation

@dvoytenko

Copy link
Copy Markdown
Member

Summary

  • Flip precedence in the Slack adapter so webhookVerifier wins over both config.signingSecret and the SLACK_SIGNING_SECRET env var. Previously, a configured signingSecret (or the env var) would silently shadow the verifier the caller wired up.
  • Applied in both SlackAdapter constructor and the createSlackAdapter factory; JSDoc on webhookVerifier updated to match.
  • Flipped the corresponding "prefers signingSecret over webhookVerifier" test to assert the new behavior.

Test plan

  • pnpm --filter @chat-adapter/slack typecheck — clean
  • pnpm --filter @chat-adapter/slack test — 366/366 pass
  • Verified the env-var-shadow test still passes ("ignores SLACK_SIGNING_SECRET env var when webhookVerifier is configured")

🤖 Generated with Claude Code

…NG_SECRET

When `webhookVerifier` is configured, ignore both `config.signingSecret`
and the `SLACK_SIGNING_SECRET` env var. Previously a configured
`signingSecret` (or env var) would shadow the verifier the caller wired
up, which is the opposite of the intended override behavior.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@dvoytenko dvoytenko requested a review from a team as a code owner May 9, 2026 00:12
@vercel

vercel Bot commented May 9, 2026

Copy link
Copy Markdown
Contributor

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
chat Ready Ready Preview, Comment, Open in v0 May 9, 2026 0:34am
chat-sdk-nextjs-chat Ready Ready Preview, Comment, Open in v0 May 9, 2026 0:34am

Mirror the JSDoc/changeset wording: webhookVerifier wins over both
signingSecret and SLACK_SIGNING_SECRET. The previous note still claimed
signingSecret won, contradicting the behavior fixed in e77359b.
@bensabic bensabic merged commit 0f0c203 into main May 9, 2026
10 of 12 checks passed
@bensabic bensabic deleted the slack-prefer-webhook-verifier branch May 9, 2026 00:34
patrick-chinchill added a commit to Chinchill-AI/chat-sdk-python that referenced this pull request May 29, 2026
Flips precedence between webhook_verifier and signing_secret in SlackAdapter to match upstream vercel/chat#468 (commit 0f0c203, in chat@4.29.0).

Behavior change: when both webhook_verifier and signing_secret are configured, webhook_verifier now wins. SLACK_SIGNING_SECRET env var is also ignored when a verifier is set.

This fixes a precedence regression the Python port introduced in 0.4.27 (#87) by tracking upstream's intent at that time. Upstream has since reversed itself in #468 (an env-configured SLACK_SIGNING_SECRET was silently shadowing verifiers callers wired up — same hazard our port also had).

- adapter.py: rewrote the signing_secret cascade so an explicit webhook_verifier drops both config and env signing-secret fallbacks; _webhook_verifier set unconditionally; stale construction-cascade comment refreshed
- types.py: signing_secret + webhook_verifier docstrings describe the new precedence
- tests: renamed test_signing_secret_takes_precedence → test_webhook_verifier_takes_precedence (strengthened assertions), added test_verifier_runs_even_when_signing_secret_is_configured
- CHANGELOG: behavior-change entry with migration guidance

Pre-merge code review verified strict mutual exclusion matches upstream, tests are stronger not weaker, and the rebind/state and pass-interaction hazards are clean. One stale comment caught + fixed.
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.

2 participants