Skip to content

Add the webhooks resource and a signature verifier - #9

Open
0xFantomMenace wants to merge 1 commit into
fix/sdist-scopefrom
feat/webhooks-resource
Open

0xFantomMenace wants to merge 1 commit into
fix/sdist-scopefrom
feat/webhooks-resource

Conversation

@0xFantomMenace

Copy link
Copy Markdown
Member

Eighteen operations covering endpoints, subscriptions, watched addresses, the delivery log, and the two previews, on both the sync and async clients.

oxarchive/webhook_signature.py verifies a delivery. Three things about it are deliberate:

It takes the raw request bytes, not a parsed object. The body we sign is PostgreSQL's rendering of the payload, so re-serialising a parsed dict will not reproduce those bytes and verification will fail intermittently in a way that is very hard to debug.

It collects every v1 in the header. During a secret rotation the server sends two signatures over the same payload, one per secret, so a receiver holding either secret keeps working through the 24 hour overlap.

It compares in constant time.

Free plans do not include webhook delivery. Estimates and dry runs stay open on every plan for event types that are not scoped to a watched wallet, so you can size a rule before paying for it.

Stacked on the packaging fix, so this PR shows only the webhooks commit. Retarget to main once that merges.

Eighteen operations covering endpoints, subscriptions, watched addresses, the
delivery log, and the two previews. Sync and async clients both.

oxarchive/webhook_signature.py verifies a delivery. It takes the raw request
bytes rather than a parsed object, because the body we sign is PostgreSQL's
rendering of the payload and re-serialising it will not reproduce those bytes.
It collects every v1 in the header, so a receiver holding both secrets keeps
verifying through a rotation, and it compares in constant time.

Free plans do not include webhooks. Estimates and dry-runs stay open on every
plan for event types that are not scoped to a watched wallet.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant