Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jdrhyne
Copy link
Contributor

@jdrhyne jdrhyne commented Jan 18, 2026

Summary

Adds HTTP webhook mode for Slack integration, enabling serverless deployments without Socket Mode.

Changes

  • Signature verification (src/slack/http/signature.ts) — HMAC-SHA256 with replay protection
  • URL challenge handler (src/slack/http/challenge.ts) — Slack URL verification
  • HTTP events handler (src/slack/http/events.ts) — Request processing with immediate 200 ACK
  • Event dispatcher (src/slack/http/dispatch.ts) — Routes HTTP events to handlers
  • Config schema — Added mode, signingSecret, webhookPath fields
  • Gateway integration — Registers webhook route at configurable path
  • Provider mode switch — HTTP mode skips Socket Mode, uses WebClient only

Tests

  • signature.test.ts — 117 lines, covers valid/invalid signatures, replay, edge cases
  • challenge.test.ts — 36 lines, covers type guard and challenge echo
  • events.test.ts — 155 lines, integration tests with mocked req/res

Usage

channels:
  slack:
    accounts:
      default:
        mode: http
        signingSecret: ${SLACK_SIGNING_SECRET}
        webhookPath: /slack/events

Checklist

  • Implementation complete
  • Unit tests added
  • Integration tests added
  • Manual testing pending
  • Documentation update pending

Implements Slack URL verification for webhook setup:
- isUrlVerification type guard
- handleUrlVerification returns challenge string
- SlackChallengeEvent interface

Part of: slack-http-webhook-mode feature
Implements HMAC-SHA256 signature verification per Slack spec:
- Replay protection (5-minute timestamp window)
- Constant-time comparison via timingSafeEqual
- JSDoc documentation

Part of: slack-http-webhook-mode feature
Adds new config fields to SlackConfigSchema:
- mode: 'socket' | 'http' (default: socket)
- signingSecret: string for HTTP webhook verification
- webhookPath: string for webhook endpoint (default: /slack/events)

Includes validation: mode='http' requires signingSecret.

Part of: slack-http-webhook-mode feature
Implements main HTTP request handler for Slack webhooks:
- createSlackHttpHandler factory function
- Raw body reading for signature verification
- Header extraction for x-slack-signature/x-slack-request-timestamp
- URL verification challenge handling
- Immediate 200 acknowledgment (Slack <3s requirement)
- Async event dispatch via queueMicrotask
- Barrel export in index.ts

Part of: slack-http-webhook-mode feature
@steipete
Copy link
Contributor

Hey J! Did you test this, does this work well?

@steipete steipete self-assigned this Jan 18, 2026
steipete added a commit that referenced this pull request Jan 18, 2026
@steipete
Copy link
Contributor

steipete commented Jan 18, 2026

Landed via Bolt HTTPReceiver + Slack HTTP route registry, with config validation/tests and docs/changelog updates.

Tests:

  • pnpm lint OK
  • pnpm build OK
  • pnpm test timed out; failure in src/cli/gateway.sigterm.test.ts (exits 0 on SIGTERM)

SHA: 4726580

Thanks @jdrhyne!

@steipete steipete closed this Jan 18, 2026
steipete added a commit that referenced this pull request Jan 18, 2026
@jdrhyne jdrhyne deleted the feature/slack-http-webhook-mode branch January 19, 2026 03:23
rsneh pushed a commit to rsneh/clawdbot that referenced this pull request Jan 21, 2026
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