pub struct JwtRevocationStore { /* private fields */ }Expand description
In-memory JWT-SVID deny-list with optional catalog-backed persistence.
Implementations§
Source§impl JwtRevocationStore
impl JwtRevocationStore
Sourcepub async fn load_from_manager(
manager: &BackendManager,
) -> Result<Self, ManagerError>
pub async fn load_from_manager( manager: &BackendManager, ) -> Result<Self, ManagerError>
Load the configured deny-list from the catalog value key labeled
revocation_store=jwt-svid, if present.
§Errors
Returns ManagerError::Backend when the configured store is malformed,
unreadable, or attached to a non-value catalog key.
Sourcepub async fn refresh_from_manager(
&self,
manager: &BackendManager,
) -> Result<(), ManagerError>
pub async fn refresh_from_manager( &self, manager: &BackendManager, ) -> Result<(), ManagerError>
Re-read the configured backing store and union it into the live deny-list.
Existing in-memory entries win when they live longer than the reloaded value, so a concurrent live revocation is never shortened or removed by a reload. A read/load error leaves this store untouched.
§Errors
Returns ManagerError when the backing store cannot be loaded or the
live deny-list locks are poisoned.
Sourcepub fn is_revoked(&self, trust_domain: &str, jti: &str) -> bool
pub fn is_revoked(&self, trust_domain: &str, jti: &str) -> bool
Return true when jti is currently denied for trust_domain.
Expired entries are pruned before the lookup. Lock poisoning fails closed: a validator must not accept a token if the deny-list cannot be read.
Sourcepub fn insert(
&self,
trust_domain: &str,
jti: &str,
expires_at_unix: u64,
) -> Result<(), ManagerError>
pub fn insert( &self, trust_domain: &str, jti: &str, expires_at_unix: u64, ) -> Result<(), ManagerError>
Add or extend a revoked JWT-SVID jti.
§Errors
Returns ManagerError::Backend if the in-memory deny-list lock is
poisoned.
Sourcepub async fn persist(
&self,
manager: &BackendManager,
) -> Result<(), ManagerError>
pub async fn persist( &self, manager: &BackendManager, ) -> Result<(), ManagerError>
Persist the current deny-list if a catalog-backed store is configured.
§Errors
Returns ManagerError if the configured backend write fails or the
in-memory deny-list cannot be serialized.
Sourcepub fn has_persistent_store(&self) -> Result<bool, ManagerError>
pub fn has_persistent_store(&self) -> Result<bool, ManagerError>
Whether live revocations have a configured catalog-backed value store.
§Errors
Returns ManagerError::Backend if the store-key lock is poisoned.
Trait Implementations§
Source§impl Debug for JwtRevocationStore
impl Debug for JwtRevocationStore
Auto Trait Implementations§
impl !Freeze for JwtRevocationStore
impl RefUnwindSafe for JwtRevocationStore
impl Send for JwtRevocationStore
impl Sync for JwtRevocationStore
impl Unpin for JwtRevocationStore
impl UnsafeUnpin for JwtRevocationStore
impl UnwindSafe for JwtRevocationStore
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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