pub trait RotateRunner<'a, Shared, Secret>{
// Required methods
fn setup<'async_trait>(
region: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Shared>> + Send + 'async_trait>>
where 'a: 'async_trait;
fn create<'life0, 'async_trait>(
shared: &'a Shared,
secret_cur: SecretContainer<Secret>,
smc: &'life0 Smc,
) -> Pin<Box<dyn Future<Output = Result<SecretContainer<Secret>>> + Send + 'async_trait>>
where 'a: 'async_trait,
'life0: 'async_trait;
fn set<'async_trait>(
shared: &'a Shared,
secret_cur: SecretContainer<Secret>,
secret_new: SecretContainer<Secret>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where 'a: 'async_trait;
fn test<'async_trait>(
shared: &'a Shared,
secret_new: SecretContainer<Secret>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where 'a: 'async_trait;
// Provided method
fn finish<'async_trait>(
_shared: &'a Shared,
_secret_cur: SecretContainer<Secret>,
_secret_new: SecretContainer<Secret>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where 'a: 'async_trait { ... }
}
rotate_rusoto
or rotate_aws_sdk
only.Expand description
Defines a type which is executed every time a lambda
is invoced. This type is made for SecretManager
rotation lambdas.
Types:
Shared
: Type which is shared between lambda invocations. Note that lambda will create multiple environments for simulations invokations and environments are only kept alive for a certain time. It is thus not guaranteed that data can be reused, but with this types its possible.Secret
: The structure of the secret stored in theSecretManager
. May contain only necessary fields, as other undefined fields are internally preserved.
Required Methods§
Sourcefn setup<'async_trait>(
region: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Shared>> + Send + 'async_trait>>where
'a: 'async_trait,
fn setup<'async_trait>(
region: &'a str,
) -> Pin<Box<dyn Future<Output = Result<Shared>> + Send + 'async_trait>>where
'a: 'async_trait,
See documentation of super::Runner::setup
Sourcefn create<'life0, 'async_trait>(
shared: &'a Shared,
secret_cur: SecretContainer<Secret>,
smc: &'life0 Smc,
) -> Pin<Box<dyn Future<Output = Result<SecretContainer<Secret>>> + Send + 'async_trait>>where
'a: 'async_trait,
'life0: 'async_trait,
fn create<'life0, 'async_trait>(
shared: &'a Shared,
secret_cur: SecretContainer<Secret>,
smc: &'life0 Smc,
) -> Pin<Box<dyn Future<Output = Result<SecretContainer<Secret>>> + Send + 'async_trait>>where
'a: 'async_trait,
'life0: 'async_trait,
Create a new secret without setting it yet. Only called if there is no pending secret available (which may happen if rotation fails at any stage)
Sourcefn set<'async_trait>(
shared: &'a Shared,
secret_cur: SecretContainer<Secret>,
secret_new: SecretContainer<Secret>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
'a: 'async_trait,
fn set<'async_trait>(
shared: &'a Shared,
secret_cur: SecretContainer<Secret>,
secret_new: SecretContainer<Secret>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
'a: 'async_trait,
Set the secret in the service
Only called if password is not already set, checked by
calling test
with new password beforehand. The reason
for that it, that a failure in a later stage means all
stages are called again with set failing as the old password
does not work anymore
Sourcefn test<'async_trait>(
shared: &'a Shared,
secret_new: SecretContainer<Secret>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
'a: 'async_trait,
fn test<'async_trait>(
shared: &'a Shared,
secret_new: SecretContainer<Secret>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
'a: 'async_trait,
Test whether a connection with the given secret works
Provided Methods§
Sourcefn finish<'async_trait>(
_shared: &'a Shared,
_secret_cur: SecretContainer<Secret>,
_secret_new: SecretContainer<Secret>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
'a: 'async_trait,
fn finish<'async_trait>(
_shared: &'a Shared,
_secret_cur: SecretContainer<Secret>,
_secret_new: SecretContainer<Secret>,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
'a: 'async_trait,
Perform any work which may be necessary to complete rotation
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.