webhook-delivery-tester
БесплатноБез исполняемых скриптовНе проверенUse whenever webhooks need tests, on the sending or receiving side: HMAC-SHA256 signatures, retries with backoff and jitter, timestamp replay windows…
от testland★ 18 звёзд на GitHubОб этом скилле
webhook-delivery-tester
Overview
The Standard Webhooks spec (standardwebhooks.com) formalizes the signing, retry, and replay patterns most production systems converged on. This skill covers tests for both sides:
- Sender - your service emits webhooks to customers (Stripe-style outbound webhook).
- Receiver - your service receives webhooks from a vendor (handler for Stripe / Twilio / SendGrid / GitHub events).
When to use
- The repo emits or receives webhooks.
- A regression suite needs to verify signature handling, retry semantics, replay-window enforcement.
- Compliance review (SOC 2, security audit) requires evidence of signature verification.
- The team adopts Standard Webhooks per stdwh.
Step 1 - Sender vs receiver test patterns
| Test side | Layer | Tools |
|---|---|---|
| Sender - payload shape | Unit | Mock HTTP client; assert POST body |
| Sender - signing | Unit | Verify HMAC matches expected per Standard Webhooks |
| Sender - retries | Integration | Mock server returning 5xx, assert retry+backoff |
| Receiver - signature verify | Unit | Construct signed payload; assert handler accepts/rejects |
| Receiver - replay defense | Unit | Construct payload with stale timestamp; assert rejected |
| Receiver - handler logic | Unit | Per-event-type handler tests with vendor sample payloads |
Step 2 - Sender: signature signing
Per Standard Webhooks (stdwh) the canonical signature scheme:
signature = HMAC-SHA256(secret, "{webhook_id}.{timestamp}.{payload}")
The signature accompanies the payload via the webhook-signature
header (with v1, prefix for the version):
webhook-id: msg_2KkD9ApUQYKLn9ouQOFKjC
webhook-timestamp: 1714838400
webhook-signature: v1,g0hM9SsE+OTPJTGt/tmIKtSyZlE3uFJELVlNIOLJ1OE=
Sender-side test:
import hmac, hashlib, base64
def sign_webhook(secret, webhook_id, timestamp, payload):
to_sign = f"{webhook_id}.{timestamp}.{payload}".encode()
sig = hmac.new(
base64.b64decode(secret),
to_sign,
hashlib.sha256,
).digest()
return f"v1,{base64.b64encode(sig).decode()}"
def test_outbound_webhook_signed_correctly():
payload = '{"type":"order.created","data":{"id":123}}'
webhook_id = "msg_test"
timestamp = "1714838400"
expected_sig = sign_webhook(SECRET, webhook_id, timestamp, payload)
sent_request = capture_outbound_webhook()
assert sent_request["headers"]["webhook-id"] == webhook_id
assert sent_request["headers"]["webhook-timestamp"] == timestamp
assert sent_request["headers"]["webhook-signature"] == expected_sig
Step 3 - Sender: retry semantics
Standard Webhooks rules that a sender's retry loop must follow ([spec][stdwh-spec]):
| Rule | Spec text |
|---|---|
| One id per event | webhook-id "remains the same no matter how many times a webhook that has failed is retried" |
| New timestamp per attempt | "Every time an attempt is retried the timestamp of the attempt is updated", so each attempt is re-signed over {id}.{new timestamp}.{body} |
| Success | "responded to with a 2xx status code (status codes 200-299)": 201 and 204 are success too |
| Redirects | "3xx: Failure. Following redirects causes unnecessary load"; do not follow them |
| Schedule | "a retry schedule spanning multiple days, with an exponential backoff", plus "some level of random jitter" |
| Give up | after sustained failure "disable future delivery to the endpoint" (and tell the consumer); on 410 Gone the sender "should disable the webhook endpoint, and stop sending it messages" |
| Timeout | "between 15 and 30s" per request |
Two common bugs follow from the first two rows: generating a new id on each retry (receivers can no longer deduplicate) and re-sending the first attempt's signature (the timestamp goes stale, so receivers with a 5-minute tolerance reject every retry).
Test the schedule with an injected clock and HTTP client, never with real sleeps:
class FakeClock:
def __init__(self): self.now = 1_700_000_000
def time(self): return self.now
def sleep(self, s): self.now += s
def test_retries_keep_id_and_resign_each_attempt(fake_http):
clock = FakeClock()
fake_http.respond_sequence([503, 503, 302, 204]) # 302 is a failure, 204 a success
deliver(event, endpoint, clock=clock, http=fake_http, rand=lambda: 0.5)
attempts = fake_http.requests
assert len(attempts) == 4
assert len({a.headers["webhook-id"] for a in attempts}) == 1 # stable id
stamps = [int(a.headers["webhook-timestamp"]) for a in attempts]
assert stamps == sorted(stamps) and len(set(stamps)) == 4 # new timestamp each time
for a in attempts: # each one verifies
assert a.headers["webhook-signature"] == sign_webhook(
SECRET, a.headers["we
Установить webhook-delivery-tester в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл webhook-delivery-tester?
Use whenever webhooks need tests, on the sending or receiving side: HMAC-SHA256 signatures, retries with backoff and jitter, timestamp replay windows, ordering, dead letters and body encoding per Standard Webhooks, plus replaying captured inbound payloads with tampering and key rotation cases.
Как установить скилл webhook-delivery-tester?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл webhook-delivery-tester запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic