pub struct CertRenewer { /* private fields */ }Expand description
Background renewal + alarm loop for the account-zone wildcard cert.
Construct with CertRenewer::new; spawn CertRenewer::run on the
service runtime. On each tick it:
- checks provisioning (sane-degrade if unprovisioned — no panic),
- asks the issuer for a fresh cert (only when due, see
renew_lead), - pushes the result into the
CertHandlevia thesender, - runs the alarm.
The sender is the write half of a CertHandle::channel
pair; the serving/monitoring layer holds the read half. handle is a
CertHandle whose receiver mirrors the same channel so the renewer can read
not_after for the “due?” decision.
Implementations§
Source§impl CertRenewer
impl CertRenewer
pub fn new( cfg: AccountZoneConfig, issuer: Arc<dyn WildcardCertIssuer>, dns: Arc<dyn DnsProvider>, sender: Sender<Option<IssuedCert>>, handle: CertHandle, ) -> Self
Sourcepub fn with_renew_lead(self, lead: Duration) -> Self
pub fn with_renew_lead(self, lead: Duration) -> Self
Override the renew lead time (default 30d).
Sourcepub fn with_thresholds(self, t: AlarmThresholds) -> Self
pub fn with_thresholds(self, t: AlarmThresholds) -> Self
Override the alarm thresholds.
Sourcepub async fn run(self)
pub async fn run(self)
Run the renewal + alarm loop until the process shuts down.
Each iteration sleeps tick, then evaluates whether a renewal is due
(no cert, or cert within renew_lead of expiry) and, if so, asks the
issuer. Provisioning failures are reported via the alarm but do not
terminate the loop — the process keeps serving whatever it has.
Auto Trait Implementations§
impl Freeze for CertRenewer
impl !RefUnwindSafe for CertRenewer
impl Send for CertRenewer
impl Sync for CertRenewer
impl Unpin for CertRenewer
impl UnsafeUnpin for CertRenewer
impl !UnwindSafe for CertRenewer
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Identity for Twhere
T: ?Sized,
impl<T> Identity for Twhere
T: ?Sized,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request