Bumping versions
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user