pub struct CertAuthenticator { /* private fields */ }Expand description
Stateless validator. Holds the config + lookup closure; TLS
listeners wrap it in an Arc and call validate on every accepted
connection.
Implementations§
Source§impl CertAuthenticator
impl CertAuthenticator
pub fn new(config: CertAuthConfig) -> CertAuthenticator
Sourcepub fn validate<F>(
&self,
cert: &ParsedClientCert,
now_unix_secs: i64,
lookup_user: F,
) -> Result<CertIdentity, CertAuthError>
pub fn validate<F>( &self, cert: &ParsedClientCert, now_unix_secs: i64, lookup_user: F, ) -> Result<CertIdentity, CertAuthError>
Validate a parsed client cert and extract the RedDB identity.
lookup_user is invoked when map_to_existing_users=true so the
caller can consult the auth store (any closure returning
Option<User> works — tests inject a fake).
pub fn config(&self) -> &CertAuthConfig
Auto Trait Implementations§
impl Freeze for CertAuthenticator
impl RefUnwindSafe for CertAuthenticator
impl Send for CertAuthenticator
impl Sync for CertAuthenticator
impl Unpin for CertAuthenticator
impl UnsafeUnpin for CertAuthenticator
impl UnwindSafe for CertAuthenticator
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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>
Wrap the input message
T in a tonic::Request