pub struct OnDemandConfig {
pub decision_func: Option<DecisionFn>,
pub host_allowlist: Option<HashSet<String>>,
pub rate_limit: Option<Arc<RingBufferRateLimiter>>,
pub managers: Vec<Arc<dyn Manager>>,
/* private fields */
}Expand description
On-demand TLS settings.
Fields§
§decision_func: Option<DecisionFn>Decides whether a certificate may be obtained for a name; an Err
denies. Takes precedence over the allowlist.
host_allowlist: Option<HashSet<String>>Explicit hostnames permitted for on-demand issuance. Names are
normalized to lowercase before comparison. When neither this field nor
Self::decision_func is configured, issuance is denied.
rate_limit: Option<Arc<RingBufferRateLimiter>>Optional sliding-window limiter applied immediately before a new on-demand certificate is obtained.
managers: Vec<Arc<dyn Manager>>External certificate sources consulted at handshake time .
Implementations§
Source§impl OnDemandConfig
impl OnDemandConfig
Sourcepub fn with_decision_func(self, decision: DecisionFn) -> Self
pub fn with_decision_func(self, decision: DecisionFn) -> Self
Configure with a decision function.
Sourcepub fn with_sync_decision<F>(self, decision: F) -> Self
pub fn with_sync_decision<F>(self, decision: F) -> Self
Configure a synchronous, fail-closed admission predicate.
The predicate only decides whether the requested name may enter the
existing on-demand pipeline. A false result is mapped to
CertificateError::NotAllowed; certificate issuance, rate limiting,
per-name single-flight coordination, the obtain timeout, and retry
policy remain owned by Config. This is the safe synchronous
counterpart to Self::with_decision_func and is convenient for
allowlist lookups that do not perform I/O.
Sourcepub fn with_sync_decision_func<F>(self, decision: F) -> Self
pub fn with_sync_decision_func<F>(self, decision: F) -> Self
Alias for Self::with_sync_decision.
This is an admission predicate, not an obtain callback: returning
false denies the request and never bypasses the normal on-demand
issuance safeguards.
Sourcepub fn with_host_allowlist<I, S>(self, names: I) -> Self
pub fn with_host_allowlist<I, S>(self, names: I) -> Self
Configure a case-insensitive host allowlist for on-demand issuance.
Sourcepub fn with_rate_limit(self, rate_limit: Arc<RingBufferRateLimiter>) -> Self
pub fn with_rate_limit(self, rate_limit: Arc<RingBufferRateLimiter>) -> Self
Configure a sliding-window limiter for on-demand issuance.
Sourcepub fn with_managers(self, managers: Vec<Arc<dyn Manager>>) -> Self
pub fn with_managers(self, managers: Vec<Arc<dyn Manager>>) -> Self
Configure external certificate managers.
Trait Implementations§
Source§impl Clone for OnDemandConfig
impl Clone for OnDemandConfig
Source§impl Debug for OnDemandConfig
impl Debug for OnDemandConfig
Source§impl Default for OnDemandConfig
impl Default for OnDemandConfig
Source§impl From<Arc<OnDemandConfig>> for OnDemandConfig
Accept the shared configuration value used by the builder.
impl From<Arc<OnDemandConfig>> for OnDemandConfig
Accept the shared configuration value used by the builder.
ConfigOptions owns its on-demand settings, so the shared value is cloned
at the configuration boundary. The callbacks and managers inside the
value remain reference-counted and are not duplicated.
Source§fn from(config: Arc<OnDemandConfig>) -> Self
fn from(config: Arc<OnDemandConfig>) -> Self
Auto Trait Implementations§
impl !Freeze for OnDemandConfig
impl !RefUnwindSafe for OnDemandConfig
impl !UnwindSafe for OnDemandConfig
impl Send for OnDemandConfig
impl Sync for OnDemandConfig
impl Unpin for OnDemandConfig
impl UnsafeUnpin for OnDemandConfig
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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