From d7e20d81a55bdc15a8dfcb64bc01881aeaa0b790 Mon Sep 17 00:00:00 2001 From: buildmaster Date: Mon, 12 Sep 2022 02:50:31 +0000 Subject: [PATCH] Bumping versions --- .../environment/EnvironmentController.java | 16 +++++----- .../VaultKvAccessStrategyFactory.java | 12 +++---- ...gleSecretManagerAccessStrategyFactory.java | 31 ++++++++++--------- ...ringVaultEnvironmentRepositoryFactory.java | 12 +++---- 4 files changed, 36 insertions(+), 35 deletions(-) diff --git a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/EnvironmentController.java b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/EnvironmentController.java index fc043cec..f54662a4 100644 --- a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/EnvironmentController.java +++ b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/EnvironmentController.java @@ -464,14 +464,14 @@ public class EnvironmentController { } else { switch (this.propertyKey.charAt(this.currentPos)) { - case '.': - this.valueType = NodeType.MAP; - break; - case '[': - this.valueType = NodeType.ARRAY; - break; - default: - throw new IllegalArgumentException("Invalid key: " + this.propertyKey); + case '.': + this.valueType = NodeType.MAP; + break; + case '[': + this.valueType = NodeType.ARRAY; + break; + default: + throw new IllegalArgumentException("Invalid key: " + this.propertyKey); } } return index; diff --git a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/VaultKvAccessStrategyFactory.java b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/VaultKvAccessStrategyFactory.java index 75b50154..579ededd 100644 --- a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/VaultKvAccessStrategyFactory.java +++ b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/VaultKvAccessStrategyFactory.java @@ -46,12 +46,12 @@ public final class VaultKvAccessStrategyFactory { public static VaultKvAccessStrategy forVersion(RestOperations rest, String baseUrl, int version, String pathToKey) { switch (version) { - case 1: - return new V1VaultKvAccessStrategy(baseUrl, rest); - case 2: - return new V2VaultKvAccessStrategy(baseUrl, pathToKey, rest); - default: - throw new IllegalArgumentException("No support for given Vault k/v backend version " + version); + case 1: + return new V1VaultKvAccessStrategy(baseUrl, rest); + case 2: + return new V2VaultKvAccessStrategy(baseUrl, pathToKey, rest); + default: + throw new IllegalArgumentException("No support for given Vault k/v backend version " + version); } } diff --git a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/secretmanager/GoogleSecretManagerAccessStrategyFactory.java b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/secretmanager/GoogleSecretManagerAccessStrategyFactory.java index 030bf834..2b3c8ee2 100644 --- a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/secretmanager/GoogleSecretManagerAccessStrategyFactory.java +++ b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/secretmanager/GoogleSecretManagerAccessStrategyFactory.java @@ -32,16 +32,17 @@ public final class GoogleSecretManagerAccessStrategyFactory { GoogleSecretManagerEnvironmentProperties properties) { switch (properties.getVersion()) { - case 1: - try { - return new GoogleSecretManagerV1AccessStrategy(rest, configProvider, properties.getServiceAccount()); - } - catch (Exception e) { - throw new RepositoryException("Cannot create service client", e); - } - default: - throw new IllegalArgumentException( - "No support for given Google Secret manager backend version " + properties.getVersion()); + case 1: + try { + return new GoogleSecretManagerV1AccessStrategy(rest, configProvider, + properties.getServiceAccount()); + } + catch (Exception e) { + throw new RepositoryException("Cannot create service client", e); + } + default: + throw new IllegalArgumentException( + "No support for given Google Secret manager backend version " + properties.getVersion()); } } @@ -50,11 +51,11 @@ public final class GoogleSecretManagerAccessStrategyFactory { GoogleSecretManagerEnvironmentProperties properties, SecretManagerServiceClient client) { switch (properties.getVersion()) { - case 1: - return new GoogleSecretManagerV1AccessStrategy(rest, configProvider, client); - default: - throw new IllegalArgumentException( - "No support for given Google Secret manager backend version " + properties.getVersion()); + case 1: + return new GoogleSecretManagerV1AccessStrategy(rest, configProvider, client); + default: + throw new IllegalArgumentException( + "No support for given Google Secret manager backend version " + properties.getVersion()); } } diff --git a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/vault/SpringVaultEnvironmentRepositoryFactory.java b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/vault/SpringVaultEnvironmentRepositoryFactory.java index 4ed6550c..a1cfdb96 100644 --- a/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/vault/SpringVaultEnvironmentRepositoryFactory.java +++ b/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/environment/vault/SpringVaultEnvironmentRepositoryFactory.java @@ -61,12 +61,12 @@ public class SpringVaultEnvironmentRepositoryFactory int version = vaultProperties.getKvVersion(); switch (version) { - case 1: - return vaultTemplate.opsForKeyValue(backend, VaultKeyValueOperationsSupport.KeyValueBackend.KV_1); - case 2: - return vaultTemplate.opsForKeyValue(backend, VaultKeyValueOperationsSupport.KeyValueBackend.KV_2); - default: - throw new IllegalArgumentException("No support for given Vault k/v backend version " + version); + case 1: + return vaultTemplate.opsForKeyValue(backend, VaultKeyValueOperationsSupport.KeyValueBackend.KV_1); + case 2: + return vaultTemplate.opsForKeyValue(backend, VaultKeyValueOperationsSupport.KeyValueBackend.KV_2); + default: + throw new IllegalArgumentException("No support for given Vault k/v backend version " + version); } }