Expand description
Flexible caching support for Sigstore clients
This crate provides a pluggable caching mechanism for Sigstore operations. It allows users to choose between different caching strategies:
FileSystemCache: Persistent cache stored on disk (default location or custom)InMemoryCache: Fast in-process cache with TTL supportNoCache: Disabled caching (for testing or when caching is not desired)
§Example
use sigstore_cache::{FileSystemCache, CacheAdapter, CacheKey};
use std::time::Duration;
// Use default cache location (~/.cache/sigstore-rust/)
let cache = FileSystemCache::default_location()?;
// Or specify a custom directory
let cache = FileSystemCache::new("/tmp/my-cache")?;
// Store a value with TTL
cache.set(CacheKey::RekorPublicKey, b"public-key-data", Duration::from_secs(86400)).await?;
// Retrieve the value
if let Some(data) = cache.get(CacheKey::RekorPublicKey).await? {
println!("Got cached data: {} bytes", data.len());
}Structs§
- File
System Cache - File system based cache
- InMemory
Cache - In-memory cache with TTL support
- NoCache
- A no-op cache that doesn’t store anything
Enums§
- Cache
Key - Cache keys for different Sigstore resources
- Error
- Errors that can occur during cache operations
Constants§
- SIGSTORE_
PRODUCTION_ URL - Sigstore production instance base URL
- SIGSTORE_
STAGING_ URL - Sigstore staging instance base URL
Traits§
- Cache
Adapter - Trait for cache adapters
- Cache
Adapter Ext - Extension trait providing convenience methods for caching
Functions§
- default_
cache_ dir - Get the default cache directory for sigstore-rust
Type Aliases§
- Cache
GetFuture - Future type for cache get operations
- Cache
OpFuture - Future type for cache set/remove/clear operations
- Result
- Result type for cache operations