Skip to main content

rsigma_runtime/io/webhook/
mod.rs

1//! Generic, template-driven webhook output sink (roadmap item #54).
2//!
3//! One configurable HTTP sink, not a handful of bespoke service integrations:
4//! Slack, Teams, Discord, and PagerDuty ship as field-parametric YAML recipes
5//! in the docs, while the engine stays service-agnostic. Each webhook renders
6//! a templated URL, headers, and body per detection / correlation result and
7//! posts it over the shared egress-filtered HTTP client.
8//!
9//! The webhook is a leaf on the shared async delivery layer
10//! (`crate::io::delivery`): the dispatcher owns the bounded queue, the
11//! retry/backoff schedule, terminal-failure-to-DLQ routing, and drain on
12//! shutdown. [`WebhookSink`] owns only the webhook-specific request behavior
13//! (template render, retryable-vs-permanent classification, per-entry token
14//! bucket). Webhooks run in the lossy `on_full=drop` mode so a third-party
15//! chat or paging endpoint never blocks the at-least-once token release for
16//! durable sinks (NATS, file); anything undeliverable lands in the DLQ.
17
18mod config;
19mod signing;
20mod sink;
21
22pub use config::{
23    BuiltWebhook, CustomSigningConfig, DEFAULT_WEBHOOK_ATTEMPTS, DEFAULT_WEBHOOK_BACKOFF,
24    DEFAULT_WEBHOOK_MAX_BACKOFF, DEFAULT_WEBHOOK_QUEUE_SIZE, DEFAULT_WEBHOOK_TIMEOUT,
25    RateLimitConfig, RetryConfig, ScopeConfig, SigningConfig, WebhookConfig, WebhookConfigError,
26    WebhookKind, WebhooksFile, build_webhooks, load_webhooks_file,
27};
28pub use sink::WebhookSink;