Database Webhooks: sign requests with Standard Webhooks #54157
Unanswered
martijn00
asked this question in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Database Webhooks send an HTTP request from
supabase_functions.http_request(pg_net) with whatever headers the webhook was configured with. There's no signature over the body, so the receiver can't tell a real webhook from a forged request, or detect a replayed one.The usual workaround is a shared bearer token in a custom header. That token then lives in the trigger definition (
pg_dumpandsupabase db diffoutput, the dashboard, migration files) unless every project moves it into Vault and writes its own trigger function to read it, which is what we do.Proposal
Sign Database Webhook requests with Standard Webhooks (the scheme Supabase Auth hooks already use): a per-webhook secret stored in Vault, and
webhook-id,webhook-timestampandwebhook-signatureheaders computed over the body. Receivers can then verify with any Standard Webhooks library, and the secret never appears in the trigger definition.A first step that would already help: let the webhook configuration reference a Vault secret for a header value, instead of a literal.
All reactions