Introduce Key-Value API version in spring.cloud.vault.kv configuration.
See gh-209.
This commit is contained in:
@@ -142,7 +142,9 @@ public class VaultBootstrapPropertySourceConfiguration implements InitializingBe
|
||||
keyValueBackend, Arrays.asList(applicationContext
|
||||
.getEnvironment().getActiveProfiles()));
|
||||
|
||||
if (keyValueBackend instanceof VaultKeyValueBackendProperties) {
|
||||
if (keyValueBackend instanceof VaultKeyValueBackendProperties
|
||||
&& ((VaultKeyValueBackendProperties) keyValueBackend)
|
||||
.getBackendVersion() == 2) {
|
||||
|
||||
for (String context : contexts) {
|
||||
secretBackendConfigurer.add(KeyValueSecretBackendMetadata.create(
|
||||
|
||||
@@ -26,7 +26,7 @@ import org.springframework.util.StringUtils;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
/**
|
||||
* Configuration properties for Vault using the generic backend.
|
||||
* Configuration properties for Vault using the key-value backend.
|
||||
*
|
||||
* @author Mark Paluch
|
||||
* @since 2.0
|
||||
@@ -64,6 +64,15 @@ public class VaultKeyValueBackendProperties implements EnvironmentAware,
|
||||
*/
|
||||
private String applicationName = "application";
|
||||
|
||||
/**
|
||||
* Key-Value backend version. Currently supported versions are:
|
||||
* <ul>
|
||||
* <li>Version 1 (unversioned key-value backend).</li>
|
||||
* <li>Version 2 (versioned key-value backend).</li>
|
||||
* </ul>
|
||||
*/
|
||||
private int backendVersion = 2;
|
||||
|
||||
@Override
|
||||
public void setEnvironment(Environment environment) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user