Added usage of spring.cloud.vault.reactive.enabled property in VaultConfigDataLoader

Closes gh-619
Original pull request: gh-618.
This commit is contained in:
axbg
2021-10-07 13:17:28 +03:00
committed by Mark Paluch
parent e956dbfaff
commit a372ca5b81
2 changed files with 33 additions and 2 deletions

View File

@@ -127,7 +127,7 @@ public class VaultConfigDataLoader implements ConfigDataLoader<VaultConfigLocati
registerImperativeInfrastructure(bootstrap, vaultProperties);
if (REGISTER_REACTIVE_INFRASTRUCTURE) {
if (REGISTER_REACTIVE_INFRASTRUCTURE && vaultProperties.getReactive().isEnabled()) {
registerReactiveInfrastructure(bootstrap, vaultProperties);
}
@@ -191,7 +191,7 @@ public class VaultConfigDataLoader implements ConfigDataLoader<VaultConfigLocati
infra.registerClientAuthentication();
if (!REGISTER_REACTIVE_INFRASTRUCTURE) {
if (!REGISTER_REACTIVE_INFRASTRUCTURE || !vaultProperties.getReactive().isEnabled()) {
infra.registerVaultSessionManager();
}

View File

@@ -82,6 +82,11 @@ public class VaultProperties implements EnvironmentAware {
@Nullable
private String namespace;
/**
* Reactive properties
*/
private Reactive reactive = new Reactive();
/**
* Discovery properties.
*/
@@ -199,6 +204,14 @@ public class VaultProperties implements EnvironmentAware {
this.namespace = namespace;
}
public Reactive getReactive() {
return this.reactive;
}
public void setReactive(Reactive reactive) {
this.reactive = reactive;
}
public Discovery getDiscovery() {
return this.discovery;
}
@@ -361,6 +374,24 @@ public class VaultProperties implements EnvironmentAware {
}
/**
* Reactive properties.
*/
public static class Reactive {
/**
* Flag to indicate that reactive discovery is enabled
*/
private boolean enabled = true;
public boolean isEnabled() {
return this.enabled;
}
public void setEnabled(boolean enabled) {
this.enabled = enabled;
}
}
/**
* Discovery properties.
*/