metacore Start a pilot

Developers · Extend

A third party notifies a domain.

A schema declares a webhook: its name, the handler that it starts, and how the third party proves itself. The engine stores each notification before it answers. A request that fails its proof is refused, and learns nothing.

ProofThe third party
SignatureSigns the body with the secret: an HMAC-SHA256, in a header.
HeaderSends the secret in a header, as a token.
AddressDoes neither: the secret is at the end of the address.

Webhooks

A schema declares a webhook: its name, the handler that it starts, and how the third party proves itself. The engine stores each notification before it answers. A request that fails its proof is refused, and learns nothing.

Schema

Declared with its handler and its proof.

A webhook is the address where a third party sends a notification. The schema names the handler that each notification starts, and how the third party proves that it holds the secret.

configuration.txtpb
webhooks {
  name: "provider"
  handler: "apply_notice"
  proof: WEBHOOK_PROOF_SIGNATURE
  proof_header: "X-Signature"
  proof_prefix: "sha256="
  signature_encoding: SIGNATURE_ENCODING_HEX
  headers: "X-Event"
  id_header: "X-Delivery"
}

A webhook, in the schema

The schema holds no secret and no address. An admin gives the secret in each environment.

The schema namesWhat it sets
HandlerThe handler that each notification starts a job of. It requires no input.
ProofA signature of the body, the secret in a header, or the secret at the end of the address.
Proof headerThe header that carries the proof, after a fixed prefix when the schema gives one.
HeadersThe headers that the handler receives, with the body as it came. The engine reads neither.
IdentifierThe header that identifies a notification. One that comes again within a day starts no second job.

What a webhook declares

A third party that proves itself another way, such as with a timestamp, sends the secret in the address. The handler checks the rest.

Notifications

Stored first, then handled.

The engine stores a notification, then answers that it holds it. It gives no other answer: a third party that needs one calls a connected app.

StepWhat happens
DeclaredThe schema names the webhook, its handler and its proof.
BoundAn admin binds it in each environment, with its secret.
VerifiedA request that fails its proof is refused, and learns nothing.
StoredThe engine stores the notification before it answers.
HandledThe notification starts the handler, as a job.

From a notification to a job

Each notification starts one job. That job waits for no other: a third party gives no order, so the engine keeps none.

A requestWhat the engine does
Fails its proofRefused. It counts against the network address it comes from, never against the webhook.
Not a POSTOnly a POST request is a notification.
Not boundThe address answers as one where nothing lives.
Over a limitRefused at once, and told when to retry.
Comes againThe same identifier within a day starts no second job.

What a webhook refuses

The engine keeps the body of a notification until its job ends, and no read returns it.

Binding

Bound by an admin, in each environment.

A binding gives the secret that the third party holds, and the rate limits. metacore webhook bind provider < secret.txt does it from a terminal: the secret comes from stdin, and no command prints it.

A webhook, before it is bound

The page gives the address to hand to the third party, and how it must prove itself. Once the webhook is bound, it shows when a notification last came, and when a request last failed its proof.

Secret

A new secret, with no break.

An admin gives a webhook a new secret at any time. The one before it holds for one more day, so the third party moves to the new one while notifications keep coming.

A new secret for provider

A change of secret

The secret is typed once, and no page shows it again. metacore webhook set-secret reads it from stdin.

A secretThe rule
One more dayThe secret before still proves a request for one more day, unless the admin ends it at once.
A failed proofA webhook tells when a request last failed its proof: the third party may hold another secret.
Audit trailIt records each binding, change and unbinding of a webhook, never its secret.
A copyA copy of an environment takes no secret of a webhook: its webhooks wait for an admin.
Never an agentAn AI agent never binds, changes or unbinds a webhook.

How a secret is kept

For a signature, the secret is the key of the HMAC. The third party may have made it.

See also

Build your domain.

Declare its schema, and take it to production, self-hosted or in a managed region.

Briefing