diff --git a/config-vault/pom.xml b/config-vault/pom.xml index 17bea9de..f3417e8c 100644 --- a/config-vault/pom.xml +++ b/config-vault/pom.xml @@ -1,5 +1,7 @@ - + 4.0.0 @@ -11,9 +13,8 @@ config-vault - 2.13.3 5.1.0 - 1.12.3 + 1.15.2 @@ -33,17 +34,5 @@ ${testcontainers.version} test - - org.apache.logging.log4j - log4j-slf4j-impl - ${log4j.version} - test - - - org.apache.logging.log4j - log4j-core - ${log4j.version} - test - diff --git a/config-vault/src/main/java/io/scalecube/config/vault/VaultConfigSource.java b/config-vault/src/main/java/io/scalecube/config/vault/VaultConfigSource.java index 011f3bee..c4524eb4 100644 --- a/config-vault/src/main/java/io/scalecube/config/vault/VaultConfigSource.java +++ b/config-vault/src/main/java/io/scalecube/config/vault/VaultConfigSource.java @@ -2,6 +2,7 @@ import com.bettercloud.vault.EnvironmentLoader; import com.bettercloud.vault.VaultConfig; +import com.bettercloud.vault.VaultException; import com.bettercloud.vault.response.LogicalResponse; import io.scalecube.config.ConfigProperty; import io.scalecube.config.ConfigSourceNotAvailableException; @@ -55,8 +56,14 @@ public Map loadConfig() { .map(LoadedConfigProperty.Builder::build) .collect(Collectors.toMap(LoadedConfigProperty::name, Function.identity())); result.putAll(pathProps); + } catch (VaultException ex) { + if (ex.getHttpStatusCode() == 404) { + LOGGER.warn("Unable to load config properties from: {}", path); + } else { + throw new ConfigSourceNotAvailableException(ex); + } } catch (Exception ex) { - LOGGER.warn("Unable to load config properties from {}", path, ex); + LOGGER.error("Unable to load config properties from: {}, cause:", path, ex); throw new ConfigSourceNotAvailableException(ex); } } diff --git a/config-vault/src/test/java/io/scalecube/config/vault/VaultConfigSourceTest.java b/config-vault/src/test/java/io/scalecube/config/vault/VaultConfigSourceTest.java index c4a56f5e..2d16cd8a 100644 --- a/config-vault/src/test/java/io/scalecube/config/vault/VaultConfigSourceTest.java +++ b/config-vault/src/test/java/io/scalecube/config/vault/VaultConfigSourceTest.java @@ -135,14 +135,11 @@ void testMissingProperty() { @Test void testMissingTenant() { - VaultConfigSource vaultConfigSource = - VaultConfigSource.builder() - .config(c -> c.token(vaultContainerExtension.vaultInstance().rootToken())) - .config(c -> c.address(vaultContainerExtension.vaultInstance().address())) - .addSecretsPath("secrets/unknown/path") - .build(); - - assertThrows(ConfigSourceNotAvailableException.class, vaultConfigSource::loadConfig); + VaultConfigSource.builder() + .config(c -> c.token(vaultContainerExtension.vaultInstance().rootToken())) + .config(c -> c.address(vaultContainerExtension.vaultInstance().address())) + .addSecretsPath("secrets/unknown/path") + .build(); } @Test diff --git a/config-vault/src/test/java/io/scalecube/config/vault/VaultInstance.java b/config-vault/src/test/java/io/scalecube/config/vault/VaultInstance.java index 4396c10d..cafc10c6 100644 --- a/config-vault/src/test/java/io/scalecube/config/vault/VaultInstance.java +++ b/config-vault/src/test/java/io/scalecube/config/vault/VaultInstance.java @@ -32,7 +32,7 @@ public class VaultInstance implements AutoCloseable { private static final Logger LOGGER = LoggerFactory.getLogger(VaultInstance.class); - private static final String VAULT_IMAGE_NAME = "vault:1.2.3"; + private static final String VAULT_IMAGE_NAME = "vault:1.6.1"; private static final int VAULT_PORT = 8200; private static final AtomicInteger PORT_COUNTER = new AtomicInteger(VAULT_PORT); private static final String UNSEAL_KEY_LOG = "Unseal Key: "; diff --git a/config/pom.xml b/config/pom.xml index 6d56fea6..d6f02078 100644 --- a/config/pom.xml +++ b/config/pom.xml @@ -1,5 +1,7 @@ - + io.scalecube @@ -21,18 +23,6 @@ - - org.apache.logging.log4j - log4j-slf4j-impl - ${log4j.version} - test - - - org.apache.logging.log4j - log4j-core - ${log4j.version} - test - com.fasterxml.jackson.datatype jackson-datatype-jdk8 diff --git a/pom.xml b/pom.xml index 5dce1e6a..7df9ac4d 100644 --- a/pom.xml +++ b/pom.xml @@ -1,5 +1,7 @@ - + 4.0.0 @@ -50,9 +52,12 @@ 2.26-b09 2.6 + 2.13.3 2.27.0 5.1.1 1.3 + + 5.5.0 @@ -107,6 +112,12 @@ commons-io ${commons-io.version} + + net.java.dev.jna + jna + ${jna.version} + test + @@ -142,6 +153,18 @@ ${hamcrest.version} test + + org.apache.logging.log4j + log4j-slf4j-impl + ${log4j.version} + test + + + org.apache.logging.log4j + log4j-core + ${log4j.version} + test +