Add the webhooks resource and a signature verifier - #9
Closed
0xFantomMenace wants to merge 2 commits into
Closed
0xFantomMenace wants to merge 2 commits into
0xFantomMenace wants to merge 2 commits into
Conversation
Cargo's exclude is a denylist, so any new directory in the working tree ships by default. Switch to an include allowlist naming src, examples and the metadata files, which is the same set the crate ships today. Add a CI job that plants a stray directory and fails if it reaches the crate, and ignore agent working directories so they never enter the tree.
Eighteen operations covering endpoints, subscriptions, watched addresses, the delivery log, and the two previews. src/webhook_signature.rs verifies a delivery. It takes &[u8] rather than a Value, 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 with verify_slice, which is constant time and length checked. WebhookVerifier has a hand written Debug that redacts the secrets it holds, because a verifier tends to end up inside application state that derives Debug. 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.
0xFantomMenace
force-pushed
the
fix/package-scope
branch
from
September 23, 2026 02:33
7e73529 to
14596c1
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Eighteen operations covering endpoints, subscriptions, watched addresses, the delivery log, and the two previews.
src/webhook_signature.rsverifies a delivery. It takes&[u8]rather than aValue, because the body we sign is PostgreSQL's rendering of the payload and re-serialising it will not reproduce those bytes.It collects every
v1in the header, so a receiver holding either secret keeps verifying through the 24 hour rotation overlap, and it compares withverify_slice, which is constant time and length checked.WebhookVerifierhas a hand writtenDebugthat redacts the secrets it holds. A verifier is long lived and tends to end up inside application state, a tracing span or an error report that derivesDebug, and the derived impl would put every signing secret in that log line.WebhookEndpoint::secretandRotatedSecret::secretare deliberately left visible, because those are one shot values the caller has to read in order to store them.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.
Stacked on the packaging fix, so this PR shows only the webhooks commit. Retarget to main once that merges.