Ideally, secrets live for a certain amount of time, then it's time to request a new secret.
There are two aspects where this becomes tricky:
- keep the state of how long the secret is still valid for
- provide an api when to reload the app after a new secret is fetched
The API would look something like:
let secrets = SecretSpec::builder().load()?;
for secret in secrets.next() {
...
}
for mysecret in secrets.mysecret.next() {
...
}
Ideally, secrets live for a certain amount of time, then it's time to request a new secret.
There are two aspects where this becomes tricky:
The API would look something like: