Rocket Webhook
⚠️ This crate is in alpha and may not work as expected yet.
Streamlined webhook validation for Rocket applications, with built-in support for popular providers.
Features
- Automatic signature validation for webhook requests
- Easy Rocket integration using
.manage()
and data guards - Deserialize JSON payloads or work with the raw responses
- Built-in support for popular webhook providers and signatures
- Automatic timestamp validation for replay attack prevention
Supported Webhooks
- GitHub, Stripe, Slack, Shopify, Discord, SendGrid, Svix
You can use another webhook by utilizing one of the generic implementations,
or implementing one of the signature traits (WebhookHmac or WebhookPublicKey) along with the Webhook trait. See the src/webhooks/built_in
folder for examples.
Quick Start
Add to your Cargo.toml
:
[]
= { = "0.1.0-alpha", = ["github", "slack"] } # Enable provider(s) you want to use
= { = "1.0", = ["derive"] }
use ;
use ;
async