pub struct GuardedRevocationStore { /* private fields */ }Expand description
Fail-closed protection for distributed revocation storage. Only confirmed revocations and locally requested revocations are cached. A successful “not revoked” answer is never cached, so replicas see later revocations on the next request. Failed writes still return errors to their callers.
Reads are limited to 32 concurrent dependency calls. After three consecutive errors, reads fail immediately for one second; then one caller probes recovery. Writes always reach the backing store, even while the circuit is open. Positive JTI and instance entries share a strict 100,000-entry bound.
Implementations§
Trait Implementations§
Source§impl RevocationStore for GuardedRevocationStore
impl RevocationStore for GuardedRevocationStore
Source§fn health(&self) -> Option<RevocationHealth>
fn health(&self) -> Option<RevocationHealth>
Read local health without contacting storage.
None means the backend
does not expose a fallible dependency or availability guard.Source§fn sweep_expired(&self, now_s: u64)
fn sweep_expired(&self, now_s: u64)
Reclaim entries past their retention period when the backend needs an
explicit sweep. Distributed stores normally use their native TTL.
Source§fn revoke(&self, jti: &str, expires_at: u64) -> Result<(), String>
fn revoke(&self, jti: &str, expires_at: u64) -> Result<(), String>
Mark a JTI as revoked across issuers for an authorized operator. Holder
requests must use
try_revoke_token. expires_at is the epoch second at which the
entry is last required (the token’s exp plus verifier leeway). An error
means the caller cannot confirm that the write succeeded.Source§fn try_revoke(
&self,
jti: &str,
expires_at: u64,
) -> Result<RevokeOutcome, String>
fn try_revoke( &self, jti: &str, expires_at: u64, ) -> Result<RevokeOutcome, String>
Atomically record a revocation and report whether it is new.
Backends overriding this method can deduplicate audit records.
Source§fn try_revoke_token(
&self,
issuer: &str,
jti: &str,
expiry: u64,
) -> Result<RevokeOutcome, String>
fn try_revoke_token( &self, issuer: &str, jti: &str, expiry: u64, ) -> Result<RevokeOutcome, String>
Revoke a holder-authenticated token only within its verified issuer.
This must use a separate key domain from operator-wide JTI rules.
Backends without scoped storage fail closed instead of widening the
holder’s authority to every issuer.
Source§fn check_token(
&self,
issuer: &str,
jti: &str,
uid: &str,
iat: u64,
) -> Result<Option<RevokedBy>, String>
fn check_token( &self, issuer: &str, jti: &str, uid: &str, iat: u64, ) -> Result<Option<RevokedBy>, String>
Check an issuer-scoped holder rule and the explicit operator-wide rules.
The default preserves global checks for older implementations, which
cannot accept scoped writes until they override both methods.
Source§fn is_revoked(&self, jti: &str) -> Result<bool, String>
fn is_revoked(&self, jti: &str) -> Result<bool, String>
Ok(true) if an operator-wide JTI rule is present. Identity validation
must use check_token to include issuer-scoped rules. An error means the store
could not answer; the validator then refuses the token.Auto Trait Implementations§
impl !Freeze for GuardedRevocationStore
impl !RefUnwindSafe for GuardedRevocationStore
impl Send for GuardedRevocationStore
impl Sync for GuardedRevocationStore
impl Unpin for GuardedRevocationStore
impl UnsafeUnpin for GuardedRevocationStore
impl !UnwindSafe for GuardedRevocationStore
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for 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> 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>
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