pub struct RedisCertStorage {
resources: Arc<PluginResources>,
name: String,
sealer: CookieSealer,
renew_script: Script,
release_script: Script,
}Expand description
Holds the name of the store, never a client: the client is resolved from
the live StoreRegistry on every call, so a
PUT /api/stores/:name credential/URL change (which swaps the registry
inside PluginResources) is picked up by the next ACME operation instead of
being pinned to the connection that existed at startup.
Fields§
§resources: Arc<PluginResources>§name: String§sealer: CookieSealer§renew_script: Script§release_script: ScriptImplementations§
Source§impl RedisCertStorage
impl RedisCertStorage
pub fn new( resources: Arc<PluginResources>, name: impl Into<String>, encryption_key: &str, ) -> Self
Sourcepub(crate) fn client(&self) -> Result<Arc<RedisStoreClient>, AcmeError>
pub(crate) fn client(&self) -> Result<Arc<RedisStoreClient>, AcmeError>
The store’s current client, or a storage error naming the store when it is no longer declared.
Sourceasync fn conn(&self) -> Result<(Arc<RedisStoreClient>, StoreConn), AcmeError>
async fn conn(&self) -> Result<(Arc<RedisStoreClient>, StoreConn), AcmeError>
Resolves the current client and a connection from it. Every operation goes through here, so both the connection and the key prefix come from whatever the registry holds right now.
fn err(&self, what: &str, e: impl Display) -> AcmeError
fn open(&self, sealed: &str, what: &str) -> Result<Vec<u8>, AcmeError>
Trait Implementations§
Source§impl CertStorage for RedisCertStorage
impl CertStorage for RedisCertStorage
Source§fn label(&self) -> String
fn label(&self) -> String
Operator-facing name shown in the Admin API (
filesystem, store:<name>).fn load_account<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, AcmeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn save_account<'life0, 'life1, 'async_trait>(
&'life0 self,
creds: &'life1 [u8],
) -> Pin<Box<dyn Future<Output = Result<(), AcmeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn load_cert<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 CertId,
) -> Pin<Box<dyn Future<Output = Result<Option<StoredCert>, AcmeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn save_cert<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 CertId,
cert: &'life2 StoredCert,
) -> Pin<Box<dyn Future<Output = Result<(), AcmeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn put_challenge<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
domain: &'life1 str,
key_auth: &'life2 str,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<(), AcmeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn put_challenge<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
domain: &'life1 str,
key_auth: &'life2 str,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<(), AcmeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Registers
key_auth for domain; expires after ttl.fn get_challenge<'life0, 'life1, 'async_trait>(
&'life0 self,
domain: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<Option<String>, AcmeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn remove_challenge<'life0, 'life1, 'async_trait>(
&'life0 self,
domain: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<(), AcmeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn try_acquire_lease<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 CertId,
owner: &'life2 str,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<bool, AcmeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn try_acquire_lease<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 CertId,
owner: &'life2 str,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<bool, AcmeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
true when this owner now holds the lease for id (fresh or already
its own); false when another live owner holds it.Source§fn renew_lease<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 CertId,
owner: &'life2 str,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<bool, AcmeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn renew_lease<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 CertId,
owner: &'life2 str,
ttl: Duration,
) -> Pin<Box<dyn Future<Output = Result<bool, AcmeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Extends the lease iff
owner holds it.Source§fn release_lease<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 CertId,
owner: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), AcmeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn release_lease<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
id: &'life1 CertId,
owner: &'life2 str,
) -> Pin<Box<dyn Future<Output = Result<(), AcmeError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Releases iff
owner holds it (a no-op otherwise).Auto Trait Implementations§
impl !RefUnwindSafe for RedisCertStorage
impl !UnwindSafe for RedisCertStorage
impl Freeze for RedisCertStorage
impl Send for RedisCertStorage
impl Sync for RedisCertStorage
impl Unpin for RedisCertStorage
impl UnsafeUnpin for RedisCertStorage
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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>
Converts
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>
Converts
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 more