OpenAgentID documentation
Source referencesRust module referenceaegis-verify

aegis-verify · store

Declared module signatures, types, configuration, and source documentation.

Source: aegis/aegis-verify/src/store.rs. SHA-256: ee67ee8eec84a09c8a2662d8802c49e56c61f669e5d0a200b33b1fdabe569cea.

This source reference follows declared modules and preserves feature attributes. It includes public declarations and implementation methods in those modules. Private-module exports and trait resolution still require the compiler; not every declaration is a crate-root import. Function bodies and constant values are omitted. Source comments describe their implementation context and are not a production deployment claim.

store::VerificationCacheStore

Pluggable storage backend for verification result caching.

Implementations may use in-memory storage, databases, or distributed caches. All operations are async to accommodate network-backed stores.

This trait complements [crate::cache::VerificationCache] by providing an async, error-aware interface suitable for production persistence backends. The existing VerificationCache can be adapted to use a VerificationCacheStore internally.

#[async_trait]
pub trait VerificationCacheStore: Send + Sync {
    /// Retrieve a cached verification result for the given DID.
    ///
    /// Returns `None` if no cached result exists or if the cached entry
    /// has expired. Implementations should not return expired entries.
    async fn get_cached(&self, did: &str) -> Result<Option<VerificationResult>, VerificationError>;

    /// Store a verification result in the cache for the given DID.
    ///
    /// If an entry already exists for the DID, it is replaced.
    async fn store_cached(
        &self,
        did: &str,
        result: &VerificationResult,
    ) -> Result<(), VerificationError>;

    /// Invalidate (remove) a cached entry for the given DID.
    ///
    /// Does not return an error if no entry existed.
    async fn invalidate(&self, did: &str) -> Result<(), VerificationError>;

    /// Remove all expired entries from the cache.
    ///
    /// Returns the number of entries removed.
    async fn cleanup_expired(&self) -> Result<usize, VerificationError>;
}

Source line: 30.

store::InMemoryVerificationCacheStore

In-memory verification cache store backed by a RwLock<HashMap>.

Stores [VerificationResult] entries keyed by DID string with a configurable TTL (capped at 300 seconds per specification).

Suitable for development, testing, and single-instance deployments. For production multi-node deployments, use a database-backed or distributed cache implementation of [VerificationCacheStore].

pub struct InMemoryVerificationCacheStore {

}

Source line: 85.

store::InMemoryVerificationCacheStore::new

Creates a new in-memory verification cache store with the specified TTL in seconds.

The TTL is capped at 300 seconds per the AEGIS specification. Values exceeding this limit are silently clamped.

pub fn new(ttl_secs: u64) -> Self;

Source line: 96.

store::InMemoryVerificationCacheStore::ttl

Returns the configured TTL duration.

pub fn ttl(&self) -> Duration;

Source line: 105.

On this page