Polishing.

Rearrange authentication method switch.

See gh-250.
This commit is contained in:
Mark Paluch
2018-11-09 09:17:32 +01:00
parent 4e9615fdfa
commit 4c42c429be

View File

@@ -60,11 +60,6 @@ class ClientAuthenticationFactory {
switch (vaultProperties.getAuthentication()) {
case TOKEN:
Assert.hasText(vaultProperties.getToken(),
"Token (spring.cloud.vault.token) must not be empty");
return new TokenAuthentication(vaultProperties.getToken());
case APPID:
return appIdAuthentication(vaultProperties);
@@ -85,6 +80,11 @@ class ClientAuthenticationFactory {
case KUBERNETES:
return kubernetesAuthentication(vaultProperties);
case TOKEN:
Assert.hasText(vaultProperties.getToken(),
"Token (spring.cloud.vault.token) must not be empty");
return new TokenAuthentication(vaultProperties.getToken());
}
throw new UnsupportedOperationException(String.format(