Expand description
Storage abstraction.
The Storage trait is the “ground truth” for TLS assets: certificates,
private keys, metadata, OCSP staples, ACME accounts, challenge tokens, and
distributed locks. The default implementation (feature file-storage) is
file::FileStorage, rooted at data_dir().
Clustering: instances that share the same Storage backend (including its
Locker) coordinate obtaining/renewing certificates and answer each
other’s ACME challenges.
Re-exports§
pub use file::FileStorage;pub use redis::RedisStorage;pub use redis::RedisStorageOptions;pub use etcd::EtcdStorage;pub use etcd::EtcdStorageOptions;pub use etcd::EtcdTlsOptions;
Modules§
- etcd
- Optional etcd v3 storage and acquisition-checked certificate publication.
- file
- File-system storage backend.
- redis
- Optional Redis storage with namespaced data and owner-checked leases.
Structs§
- Clean
Storage Options - Options for
clean_storage. - KeyBuilder
- Builds storage keys.
- KeyInfo
- Metadata for a stored key.
- Lock
Guard - A held acquisition that requests backend release when dropped.
Network cleanup is best-effort; use
LockGuard::release_and_waitwhen backend acknowledgement is required. - Storage
Keys - The three storage keys belonging to one certificate resource.
Constants§
- ACME_
PREFIX - Storage key prefix for ACME accounts/orders.
- CERTS_
PREFIX - Storage key prefix for certificates.
- LAST_
CLEAN_ KEY - Storage key of the last-clean timestamp.
- OCSP_
PREFIX - Storage key prefix for OCSP staples.
- STORAGE_
KEYS - The package-level key builder.
Statics§
- STORAGE_
DEFAULT - The lazily-initialized default storage instance.
Traits§
- Lock
Release - Object-safe release callback owned by a
LockGuard. - Locker
- Blocking-until-acquired distributed locking.
- Storage
- The storage abstraction.
Functions§
- account_
key_ prefix - Return the canonical prefix containing one persisted ACME account.
- account_
private_ key - Return the canonical ACME account private-key path.
- account_
registration - Return the canonical ACME account registration metadata path.
- acme_
ca_ prefix - Return the ACME storage prefix for an issuer/CA key.
- acme_
hosts_ prefix - Return the canonical prefix containing an issuer’s persisted accounts.
- acquire
- Acquire a lock with a non-cancelled context and RAII release.
- acquire_
lock - Acquire a distributed lock and register it as owned by this process .
- acquire_
with_ timeout - Acquire a distributed lock with a bounded timeout and RAII release.
- certs_
prefix - Return the certificate prefix for an issuer.
- certs_
site_ prefix - Return the certificate site prefix for an issuer and domain.
- chain_
hash - Convenience: compute the chain hash used as cache key / OCSP staple suffix.
- clean_
storage - Clean the storage: delete expired certificates and stale OCSP staples.
- clean_
up_ own_ locks - Release every lock this process still holds. Call during graceful shutdown.
- cleanup_
own_ locks - American-spelling alias for
clean_up_own_locks. - issuer_
key - Sanitize an ACME directory URL into a stable issuer key.
- legacy_
account_ key_ prefix - Return the pre-layout account prefix retained for migration readers.
- load_
certificate - Load a complete certificate resource from storage.
- locks_
key - Return the lock-file storage key for a lock name.
- ocsp_
key - Return an OCSP key from a first SAN and an already-computed hash.
- ocsp_
staple_ key - Return the persisted OCSP staple key for a certificate bundle.
- release_
lock - Release a previously acquired lock.
- safe_
key - Sanitize a value for use as a storage-key component.
- site_
cert_ key - Return the certificate PEM key for an issuer and domain.
- site_
meta_ key - Return the metadata key for an issuer and domain.
- site_
private_ key - Return the private-key PEM key for an issuer and domain.
- store_
certificate - Store a complete certificate resource under its issuer and SAN-derived key.
- store_
tx - All-or-nothing multi-key store: on failure, keys already written by this transaction are restored to their values from before the transaction (or deleted when they did not exist). This preserves existing resources when a later write fails; a rollback failure is logged because the original write error is the actionable result for the caller.
- track_
lock - Track a lock for process-shutdown cleanup.
- try_
acquire - Try to acquire a lock within
timeout. - try_
acquire_ lock - Try to acquire a distributed lock without waiting.
- untrack_
lock - Stop tracking all registrations with this name without releasing them. Manual registrations must be explicitly untracked by their owner.
Type Aliases§
- KeyValue
- A key-value pair for
store_tx. - Lock
Handle - Compatibility name for
LockGuardused by timeout-oriented storage APIs.