Skip to main content

RedisCertStorage

Struct RedisCertStorage 

Source
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: Script

Implementations§

Source§

impl RedisCertStorage

Source

pub fn new( resources: Arc<PluginResources>, name: impl Into<String>, encryption_key: &str, ) -> Self

Source

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.

Source

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.

Source

fn err(&self, what: &str, e: impl Display) -> AcmeError

Source

fn open(&self, sealed: &str, what: &str) -> Result<Vec<u8>, AcmeError>

Trait Implementations§

Source§

impl CertStorage for RedisCertStorage

Source§

fn label(&self) -> String

Operator-facing name shown in the Admin API (filesystem, store:<name>).
Source§

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,

Source§

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,

Source§

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,

Source§

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,

Registers key_auth for domain; expires after ttl.
Source§

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,

Source§

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,

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,

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,

Releases iff owner holds it (a no-op otherwise).

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
§

impl<T> MaybeSend for T

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more