| Crates.io | armature-webhooks |
| lib.rs | armature-webhooks |
| version | 0.1.1 |
| created_at | 2025-12-27 02:34:05.967517+00 |
| updated_at | 2025-12-29 01:36:06.546292+00 |
| description | Webhook sending and receiving for Armature |
| homepage | https://pegasusheavy.github.io/armature |
| repository | https://github.com/pegasusheavy/armature |
| max_upload_size | |
| id | 2006595 |
| size | 138,525 |
Webhook handling for the Armature framework.
[dependencies]
armature-webhooks = "0.1"
use armature_webhooks::{WebhookHandler, WebhookConfig};
let handler = WebhookHandler::new(WebhookConfig {
secret: "your-webhook-secret",
signature_header: "X-Signature",
});
let app = Application::new()
.post("/webhooks", move |req| {
let handler = handler.clone();
async move {
handler.handle(req, |event| async move {
match event.event_type.as_str() {
"order.created" => process_order(event.data).await,
_ => Ok(()),
}
}).await
}
});
let stripe = StripeWebhook::new("whsec_...");
stripe.handle(req, |event| async move {
match event {
StripeEvent::PaymentSucceeded(payment) => { ... }
StripeEvent::CustomerCreated(customer) => { ... }
_ => Ok(()),
}
}).await
let github = GitHubWebhook::new("secret");
github.handle(req, |event| async move {
match event {
GitHubEvent::Push(push) => { ... }
GitHubEvent::PullRequest(pr) => { ... }
_ => Ok(()),
}
}).await
MIT OR Apache-2.0