Skip to main content

RevocationStore

Trait RevocationStore 

Source
pub trait RevocationStore: Send + Sync {
    // Required methods
    fn is_revoked(
        &self,
        capability_id: &str,
    ) -> Result<bool, RevocationStoreError>;
    fn revoke(&self, capability_id: &str) -> Result<bool, RevocationStoreError>;

    // Provided methods
    fn observe_revocation(
        &self,
        capability_id: &str,
    ) -> Result<RevocationObservation, RevocationStoreError> { ... }
    fn is_ephemeral(&self) -> bool { ... }
}
Expand description

Trait for checking whether a capability has been revoked.

Implementations may be in-memory, SQLite-backed, or subscribe to a distributed revocation feed via Spine/NATS.

Required Methods§

Source

fn is_revoked(&self, capability_id: &str) -> Result<bool, RevocationStoreError>

Check if a capability ID has been revoked.

Source

fn revoke(&self, capability_id: &str) -> Result<bool, RevocationStoreError>

Revoke a capability. Returns true if it was newly revoked.

Provided Methods§

Source

fn observe_revocation( &self, capability_id: &str, ) -> Result<RevocationObservation, RevocationStoreError>

Source

fn is_ephemeral(&self) -> bool

Whether this store loses its revocation set on process restart. The default is the safe (loud) assumption so an unknown store is treated as ephemeral; durable and remote stores override to false.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§