1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
//! Webhook handling with signature verification.
//!
//! Forge provides a structured way to receive webhooks from external services
//! with automatic signature verification and idempotency handling.
//!
//! # Signature Verification
//!
//! Webhooks can verify signatures using HMAC-SHA256 or other algorithms:
//!
//! ```ignore
//! #[forge::webhook(
//! path = "/webhooks/stripe",
//! signature = "hmac_sha256",
//! secret_env = "STRIPE_WEBHOOK_SECRET"
//! )]
//! async fn handle_stripe(ctx: &WebhookContext, payload: StripeEvent) -> WebhookResult {
//! // Signature already verified
//! }
//! ```
//!
//! # Idempotency
//!
//! Webhooks can be configured to deduplicate based on a header or payload field:
//!
//! ```ignore
//! #[forge::webhook(
//! path = "/webhooks/github",
//! idempotency_key = "header:X-GitHub-Delivery"
//! )]
//! ```
//!
//! # Key Types
//!
//! - [`WebhookContext`] - Request context with headers and raw body
//! - [`SignatureConfig`] - Signature verification settings
//! - [`IdempotencyConfig`] - Deduplication settings
pub use WebhookContext;
pub use ;
pub use ;