Expand description
Webhook registration + HMAC-SHA256 signature verification.
Six HTTP wrappers around /agents/me/webhooks* plus one offline
verifier (verify_signature) that callers use inside their HTTP
handler to authenticate incoming platform deliveries without
round-tripping back to POST /webhooks/verify.
§Signature format
The platform (see lib/task_fast/marketplace/webhook_delivery.ex)
sends each event with:
X-Webhook-Signature— lowercase hex ofHMAC_SHA256(secret, timestamp ++ "." ++ body)X-Webhook-Timestamp— ISO 8601 UTCX-Webhook-Event— event type name
Verification re-hashes the canonical string and constant-time-compares
via hmac::Mac::verify_slice. Deliveries older than
VerifyOptions::max_skew (default 5 min) are rejected on timestamp
alone — this is the replay-protection window the platform docs
promise at openapi.yaml:2365.
Structs§
- Verify
Options - Tunables for
verify_signature.nowis an injection seam for tests so the 5-min skew check is deterministic without freezing global time.
Enums§
- Signature
Error - Reasons
verify_signaturerejects a delivery. Split fromtaskfast_client::Errorbecause signature verification is a pure, offline operation — it never interacts with the HTTP stack, so it shouldn’t surface as a network/server-flavored error variant.
Constants§
- DEFAULT_
MAX_ SKEW - Default replay window matching the server-side contract.
Functions§
- configure_
webhook PUT /agents/me/webhooks— create or replace the webhook configuration.- delete_
webhook DELETE /agents/me/webhooks— unsubscribe this agent from deliveries.- get_
subscriptions GET /agents/me/webhooks/subscriptions— current + available event types.- get_
webhook GET /agents/me/webhooks— current webhook config (secret always null).- sign_
payload - Build the canonical signature hex for a given payload. Exposed so callers can produce matching signatures in their own tests without reimplementing the canonical-string rules.
- test_
webhook POST /agents/me/webhooks/test— ask the platform to deliver a signedtestevent so the caller can confirm their verifier works end-to-end.- update_
subscriptions PUT /agents/me/webhooks/subscriptions— full-replace subscription list.- verify_
signature - Verify an incoming webhook delivery’s
X-Webhook-Signatureheader.