fix: make stripe webhooks explicitly toggleable with mandatory secret validation #23
Reference in New Issue
Block a user
Delete Branch "userAdityaa/caravel:webhook-signature"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Summary
This PR keeps webhook verification secure while restoring local development ergonomics. Webhook processing remains opt-in via
STRIPE_WEBHOOKS_ENABLED, and local defaults now avoid startup failures when webhook testing is not needed.Changes
STRIPE_WEBHOOKS_ENABLEDboolean toggle (default: false in debug builds,true in release builds)
STRIPE_WEBHOOK_SECRETonly whenSTRIPE_WEBHOOKS_ENABLED=true/stripe/webhookroute based on enablementLocal dev: Can run without
STRIPE_WEBHOOK_SECRETwhen webhooks are disabled(default for debug builds).
closes #19
I think it would be simpler to just provide a fake secret for local testing. It would only blow up when receiving a webhook, which would never happen.
5a9022bffctoc9f9e3d19fThat’s a clean and straightforward approach. I hadn’t thought of it before, I've now pushed a change to use a dummy secret for local testing.