Skip to main content

sova_acme/
events.rs

1//! Domain events for ACME certificate lifecycle.
2
3use sova_core::Event;
4
5/// Fired after the first successful certificate issuance (or replace of placeholder).
6#[derive(Debug, Clone)]
7pub struct CertificateIssued {
8    pub domains: Vec<String>,
9    pub not_after_unix: u64,
10}
11
12impl Event for CertificateIssued {
13    fn name(&self) -> &'static str {
14        "acme.certificate_issued"
15    }
16}
17
18/// Fired after a successful renewal of an existing certificate.
19#[derive(Debug, Clone)]
20pub struct CertificateRenewed {
21    pub domains: Vec<String>,
22    pub not_after_unix: u64,
23}
24
25impl Event for CertificateRenewed {
26    fn name(&self) -> &'static str {
27        "acme.certificate_renewed"
28    }
29}
30
31/// Fired when an ACME issue/renew attempt fails.
32#[derive(Debug, Clone)]
33pub struct AcmeFailed {
34    pub domains: Vec<String>,
35    pub error: String,
36}
37
38impl Event for AcmeFailed {
39    fn name(&self) -> &'static str {
40        "acme.failed"
41    }
42}