pub struct ClientCertConfig {
pub trusted_ca_ders: Vec<Vec<u8>>,
pub subject_allowlist: Vec<String>,
pub issuer_allowlist: Vec<String>,
pub require_san: bool,
pub token_lifetime_secs: u64,
}Expand description
Configuration for ClientCertAuthMethod.
Fields§
§trusted_ca_ders: Vec<Vec<u8>>DER-encoded trusted CA certificates.
When non-empty, the presented certificate’s issuer DN is matched against the subjects of these CAs. This provides a meaningful policy guard when the list is kept to a small, curated set of CAs you actually trust.
Security note: this is an issuer DN equality check, not a full cryptographic path validation. For cryptographic assurance configure your TLS library’s trusted CA store, then use this list as a second policy filter.
subject_allowlist: Vec<String>Subject DN substrings that are allowed. An empty list accepts any subject
(given other checks pass). Matching is case-sensitive substring search on
the full Distinguished Name string (e.g. "CN=alice" or just "alice").
issuer_allowlist: Vec<String>Issuer DN substrings that are allowed. An empty list accepts any issuer.
require_san: boolWhen true, the certificate must contain a Subject Alternative Name (SAN)
extension. PIV and modern TLS certificates always carry one; older
enterprise CAs sometimes do not.
token_lifetime_secs: u64Lifetime of the session issued after successful authentication (seconds).
Implementations§
Source§impl ClientCertConfig
impl ClientCertConfig
Sourcepub fn allow_subject(self, pattern: impl Into<String>) -> Self
pub fn allow_subject(self, pattern: impl Into<String>) -> Self
Builder: allow only subjects whose DN contains pattern.
Sourcepub fn allow_issuer(self, pattern: impl Into<String>) -> Self
pub fn allow_issuer(self, pattern: impl Into<String>) -> Self
Builder: allow only issuers whose DN contains pattern.
Sourcepub fn with_require_san(self) -> Self
pub fn with_require_san(self) -> Self
Builder: require a SAN extension.
Trait Implementations§
Source§impl Clone for ClientCertConfig
impl Clone for ClientCertConfig
Source§fn clone(&self) -> ClientCertConfig
fn clone(&self) -> ClientCertConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ClientCertConfig
impl Debug for ClientCertConfig
Auto Trait Implementations§
impl Freeze for ClientCertConfig
impl RefUnwindSafe for ClientCertConfig
impl Send for ClientCertConfig
impl Sync for ClientCertConfig
impl Unpin for ClientCertConfig
impl UnsafeUnpin for ClientCertConfig
impl UnwindSafe for ClientCertConfig
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 more