Webhooks
Signed deliveries, retries and verification.
Webhook URLs must be public HTTPS on port 443; private, loopback and metadata addresses are refused, redirects are not followed, and the host is resolved once and pinned. Events: entry.publish, entry.unpublish, entry.delete, asset.publish, asset.unpublish, content_type.publish, environment.promote.
Verify the signature
Header x-rafterbase-signature is t=<unix>,v1=<hex> where the hex is HMAC-SHA256 of t + "." + body with your secret. Reject timestamps older than five minutes and compare in constant time.
const [t, v1] = header.split(",").map((p) => p.split("=")[1]);
const expected = createHmac("sha256", secret).update(`${t}.${body}`).digest("hex");
if (!timingSafeEqual(Buffer.from(expected), Buffer.from(v1))) throw new Error("bad signature");Failed deliveries retry after 1 minute, 5 minutes, 30 minutes and 2 hours. A receiver that keeps failing backs off, and a hook is disabled after 50 consecutive failed attempts.