From 99085d4fd8ab08e1b3b405051e13d443a2cef07c Mon Sep 17 00:00:00 2001 From: Steve Swor Date: Mon, 15 May 2017 18:34:24 +1000 Subject: [PATCH] Use rotating secrets for generic backend. We now use rotating secrets for the generic backend to reload properties after cache TTL expiry. Closes gh-110. Original pull request: gh-111. --- .../cloud/vault/config/LeasingVaultPropertySourceLocator.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/spring-cloud-vault-config/src/main/java/org/springframework/cloud/vault/config/LeasingVaultPropertySourceLocator.java b/spring-cloud-vault-config/src/main/java/org/springframework/cloud/vault/config/LeasingVaultPropertySourceLocator.java index b8d2706e..87b74658 100644 --- a/spring-cloud-vault-config/src/main/java/org/springframework/cloud/vault/config/LeasingVaultPropertySourceLocator.java +++ b/spring-cloud-vault-config/src/main/java/org/springframework/cloud/vault/config/LeasingVaultPropertySourceLocator.java @@ -80,7 +80,9 @@ class LeasingVaultPropertySourceLocator extends VaultPropertySourceLocatorSuppor protected PropertySource createVaultPropertySource( SecretBackendMetadata accessor) { - RequestedSecret secret = RequestedSecret.renewable(accessor.getPath()); + RequestedSecret secret = accessor instanceof GenericSecretBackendMetadata + ? RequestedSecret.rotating(accessor.getPath()) + : RequestedSecret.renewable(accessor.getPath()); if (properties.isFailFast()) { return createVaultPropertySourceFailFast(secret, accessor);