22 lines
629 B
Rust
22 lines
629 B
Rust
pub mod deliveries;
|
|
pub mod gitea;
|
|
pub mod gitea_source;
|
|
pub mod github;
|
|
pub mod gitlab;
|
|
pub mod server;
|
|
|
|
pub use server::start_webhook_server;
|
|
|
|
use compliance_core::models::OnboardedTarget;
|
|
|
|
use crate::agent::ComplianceAgent;
|
|
|
|
/// The target's webhook secret, opened for verification. `None` when the
|
|
/// target has none or it cannot be opened; the receivers then reject the
|
|
/// delivery, because without a secret nothing proves who sent it.
|
|
fn webhook_secret(agent: &ComplianceAgent, target: &OnboardedTarget) -> Option<String> {
|
|
agent
|
|
.secrets
|
|
.open_opt(target.webhook_secret.as_ref(), "webhook secret")
|
|
}
|