Signatures
Two different surfaces, two different jobs:
- Inbound (ingest) — korb verifies the vendor's signature before an event enters your pipeline.
- Outbound (delivery) — korb identifies each delivery with stable headers so your handlers can dedupe and reorder.
Inbound: how korb verifies vendors
Each preset carries its vendor's real verification scheme — korb parses and checks it natively. Examples:
| Vendor | Scheme |
|---|---|
| Stripe | Stripe-Signature: t=…,v1=… HMAC-SHA256, 5-minute tolerance |
| GitHub | X-Hub-Signature-256: sha256=<hex> over the raw body |
| Shopify | X-Shopify-Hmac-SHA256: base64 HMAC-SHA256 over the raw body |
| OpenAI + Standard Webhooks | Signed id.timestamp.body (the Standard Webhooks spec) |
| Slack (events) | Slack's timestamped scheme + URL verification handshake |
Rules that hold across every HMAC preset:
- Timestamp tolerance: ±300 s by default. A few presets deviate (Calendly ±180 s, Twitch ±600 s) — each preset page lists its exact window.
- Replay protection on top of the signature. Timestamped schemes: a seen signature is remembered for twice the tolerance window, so a captured request can't be replayed at korb. Timestamp-less schemes (GitHub, Shopify…) keep a short 2-minute signature memory instead — duplicates still die, while the vendor's own “redeliver” button keeps working minutes later.
- Secret rotation grace: 24 h. After you change a source's secret in korb, the previous secret keeps verifying while the vendor mid-rotation sends a mix of old/new signatures.
- Leaked secret? Rotate twice. The middle rotation displaces the leaked secret's grace slot — the second rotation kills it immediately.
- No secret set = accepted unverified. The events are still logged and delivered; verification is opt-in per source by setting the secret.
Generic sources: the korb-signature scheme
For generic sources whose sender is your own code, set a source secret (16–256 chars) and sign each request:
korb-signature: t=<unix-seconds>,v1=<hex hmac-sha256 of `${t}.${rawBody}`>Node.js:
import { createHmac } from "node:crypto";
const body = JSON.stringify(payload); // the EXACT bytes you send
const t = Math.floor(Date.now() / 1000);
const v1 = createHmac("sha256", secret)
.update(`${t}.${body}`)
.digest("hex");
await fetch(url, {
method: "POST",
headers: { "content-type": "application/json", "korb-signature": `t=${t},v1=${v1}` },
body,
});The korb scheme uses the default ±300 s tolerance and the same 24 h rotation grace as vendor presets.
Deliveries to your destination
korb delivers each event to your endpoints at-least-once, unordered — the same guarantee Stripe and GitHub give. Every delivery carries:
| Header | Meaning |
|---|---|
korb-event-id | Stable event id — your dedupe key |
korb-seq | Monotonic per source — reorder if you care about order |
korb-received-at | When korb accepted the event |
korb-delivery-attempt | Attempt number for this delivery (retries increment it) |
korb-replay | 1 on replayed deliveries |
korb-test | 1 on synthetic test traffic — skip side effects |
A robust handler:
- Dedupes on
korb-event-id(persist the id; ignore repeats). - Reorders on
korb-seqif event order matters within a source. - Returns 2xx quickly — anything else counts as failure and retries with backoff.
Authenticating korb's calls
Destinations are live immediately — there is no ownership handshake. To authenticate deliveries, give the destination an auth header: a header korb attaches to every request it sends (set at creation or later via the dashboard / POST /api/destinations/:id/headers). A shared secret works well:
Authorization: Bearer <your-secret>Verify it in your handler with a constant-time compare and reject on miss. Values are write-only in korb — the API names what is set, never what it is. Some names are rejected at write time (transport headers like host/connection/user-agent/cookie, the cf-/x-forwarded-/ x-korb- namespaces, and korb-signature), and korb's own delivery headers (korb-event-id, korb-seq, …) are applied by korb itself on every request — they can't be overridden.