Adding expiry threshold and min renewal as properties.
We now allow configuration of expiry threshold and min renewal durations for lease renewal. Original pull request: gh-278.
This commit is contained in:
committed by
Mark Paluch
parent
e1ea9c9eff
commit
70faa4228a
@@ -95,6 +95,17 @@ public class VaultBootstrapPropertySourceConfiguration implements InitializingBe
|
||||
|
||||
SecretLeaseContainer secretLeaseContainer = secretLeaseContainerObjectFactory
|
||||
.getObject();
|
||||
|
||||
if (vaultProperties.getConfig().getLifecycle().getMinRenewal() != null) {
|
||||
secretLeaseContainer.setMinRenewal(
|
||||
vaultProperties.getConfig().getLifecycle().getMinRenewal());
|
||||
}
|
||||
|
||||
if (vaultProperties.getConfig().getLifecycle().getExpiryThreshold() != null) {
|
||||
secretLeaseContainer.setMinRenewal(
|
||||
vaultProperties.getConfig().getLifecycle().getExpiryThreshold());
|
||||
}
|
||||
|
||||
secretLeaseContainer.start();
|
||||
|
||||
return new LeasingVaultPropertySourceLocator(vaultProperties, configuration,
|
||||
|
||||
@@ -483,6 +483,16 @@ public class VaultProperties implements EnvironmentAware {
|
||||
*/
|
||||
private boolean enabled = true;
|
||||
|
||||
/**
|
||||
* The amount of seconds that is at least required before renewing a lease.
|
||||
*/
|
||||
private Duration minRenewal;
|
||||
|
||||
/**
|
||||
* The expiry threshold. {@link Lease} is renewed the given seconds before it expires.
|
||||
*/
|
||||
private Duration expiryThreshold;
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user