Skip to content
Registry StackDocsDevelopment (unreleased)

Signed hook deliveries

View as Markdown

Base Registry Engine (BReg), Scheduling, and Coordinator sign every hook delivery they send. A receiver authenticates a delivery with the shared verifier before it acts on the body.

In Rust, authenticate a delivery through the receiver verifier in the hooks platform crate. The HMAC-SHA256 signature itself comes from the platform crypto crate, whose Version 1 signing domain and length-prefixed field order are part of the wire contract. One JSON fixture of signed deliveries is shared by the Rust, Node, and Python tests.

Pass the exact method, request target, signed headers, and body bytes. The signature authenticates the raw delivery-time bytes before the shared verifier parses freshness. Valid RFC 3339 fractions such as .12Z, .120Z, and .000Z are accepted. Never normalise the timestamp before comparison: replacing .120Z with .12Z changes the signature even though it represents the same instant. Invalid times, changed signatures, and stale deliveries remain refused.

Rust receivers select the freshness mode with DeliveryFreshness::Within { now, skew }, which checks the delivery time against the clock and skew you pass.

The Node and Python bindings expose the same check as an entry point that takes the request parts and your key:

  • Node: breg.verifyHookDelivery({method, path, headers, body, key})
  • Python: breg.verify_hook_delivery(method=..., path=..., headers=..., body=..., key=...)

Both return the authenticated exact values, including deliveryTime (Python delivery_time) and idempotencyKey (Python idempotency_key). These binding entry points use caller-enforced freshness. Compare the returned instant with your trusted clock and chosen window, and durably deduplicate on the idempotency key before taking an effect. Verification alone creates no source, schema, recipient, or business authority.

Casework completion wakes use their own bearer and named-header receiver contract, not this hook-signature scheme. See Casework completion receivers.