pub struct AuthStateTracker { /* private fields */ }Expand description
Tracks authentication state for membership certificates.
Implementations§
Source§impl AuthStateTracker
impl AuthStateTracker
Sourcepub fn new(config: AuthConfig) -> Self
pub fn new(config: AuthConfig) -> Self
Create a new tracker with the given configuration.
Sourcepub fn config(&self) -> &AuthConfig
pub fn config(&self) -> &AuthConfig
Get the current configuration.
Sourcepub fn check_state(
&self,
cert: &MembershipCertificate,
now_ms: u64,
) -> CertificateState
pub fn check_state( &self, cert: &MembershipCertificate, now_ms: u64, ) -> CertificateState
Check the state of a certificate at the given time.
§Timeline
├── T-0: Certificate issued
├── T-(auth_interval - warning_threshold): Warning state
├── T-auth_interval: Expiration (grace period starts)
├── T-(auth_interval + grace_period): Hard cutoff (Expired)
└── Re-auth succeeds: New cert, timer resetsSourcepub fn needs_reauth(&self, cert: &MembershipCertificate, now_ms: u64) -> bool
pub fn needs_reauth(&self, cert: &MembershipCertificate, now_ms: u64) -> bool
Check if a certificate needs re-authentication.
Returns true if the certificate is in Warning or GracePeriod state.
Sourcepub fn is_operational(&self, cert: &MembershipCertificate, now_ms: u64) -> bool
pub fn is_operational(&self, cert: &MembershipCertificate, now_ms: u64) -> bool
Check if a certificate is still operational (allows mesh operations).
Returns true for Valid, Warning, and GracePeriod states.
Sourcepub fn is_expired(&self, cert: &MembershipCertificate, now_ms: u64) -> bool
pub fn is_expired(&self, cert: &MembershipCertificate, now_ms: u64) -> bool
Check if a certificate has fully expired (no grace period remaining).
Sourcepub fn reauth_deadline(&self, cert: &MembershipCertificate) -> u64
pub fn reauth_deadline(&self, cert: &MembershipCertificate) -> u64
Calculate when re-authentication should begin (warning threshold).
Sourcepub fn hard_cutoff(&self, cert: &MembershipCertificate) -> u64
pub fn hard_cutoff(&self, cert: &MembershipCertificate) -> u64
Calculate the hard cutoff time (grace period exhausted).
Trait Implementations§
Source§impl Clone for AuthStateTracker
impl Clone for AuthStateTracker
Source§fn clone(&self) -> AuthStateTracker
fn clone(&self) -> AuthStateTracker
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AuthStateTracker
impl Debug for AuthStateTracker
Auto Trait Implementations§
impl Freeze for AuthStateTracker
impl RefUnwindSafe for AuthStateTracker
impl Send for AuthStateTracker
impl Sync for AuthStateTracker
impl Unpin for AuthStateTracker
impl UnsafeUnpin for AuthStateTracker
impl UnwindSafe for AuthStateTracker
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> 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>
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 more