Deprecate App ID authentication mechanism.

Closes gh-453.
This commit is contained in:
Mark Paluch
2019-08-01 11:18:19 +02:00
parent fec7d6209c
commit 256212a959
5 changed files with 17 additions and 7 deletions

View File

@@ -37,9 +37,11 @@ import org.springframework.web.client.RestOperations;
* @see RestOperations
* @see <a href="https://www.vaultproject.io/docs/auth/app-id.html">Auth Backend: App
* ID</a>
* @deprecated since 2.2. Use {@link AppRoleAuthentication}.
*/
public class AppIdAuthentication implements ClientAuthentication,
AuthenticationStepsFactory {
@Deprecated
public class AppIdAuthentication
implements ClientAuthentication, AuthenticationStepsFactory {
private static final Log logger = LogFactory.getLog(AppIdAuthentication.class);
@@ -77,9 +79,9 @@ public class AppIdAuthentication implements ClientAuthentication,
Assert.notNull(options, "AppIdAuthenticationOptions must not be null");
return AuthenticationSteps.fromSupplier(
() -> getAppIdLogin(options.getAppId(), options.getUserIdMechanism()
.createUserId())) //
return AuthenticationSteps
.fromSupplier(() -> getAppIdLogin(options.getAppId(),
options.getUserIdMechanism().createUserId())) //
.login("auth/{mount}/login", options.getPath());
}
@@ -95,8 +97,8 @@ public class AppIdAuthentication implements ClientAuthentication,
private VaultToken createTokenUsingAppId() {
Map<String, String> login = getAppIdLogin(options.getAppId(), options
.getUserIdMechanism().createUserId());
Map<String, String> login = getAppIdLogin(options.getAppId(),
options.getUserIdMechanism().createUserId());
try {
VaultResponse response = restOperations.postForObject("auth/{mount}/login",

View File

@@ -28,7 +28,9 @@ import org.springframework.util.Assert;
* @see AppIdAuthentication
* @see AppIdUserIdMechanism
* @see #builder()
* @deprecated since 2.2. Use {@link AppRoleAuthentication}.
*/
@Deprecated
public class AppIdAuthenticationOptions {
public static final String DEFAULT_APPID_AUTHENTICATION_PATH = "app-id";

View File

@@ -22,7 +22,9 @@ package org.springframework.vault.authentication;
*
* @author Mark Paluch
* @see AppIdAuthentication
* @deprecated since 2.2. Use {@link AppRoleAuthentication}.
*/
@Deprecated
@FunctionalInterface
public interface AppIdUserIdMechanism {

View File

@@ -3,10 +3,12 @@
[[new-features.2-2-0]]
=== What's new in Spring Vault 2.2
* Support for Key-Value v2 (versioned backend) secrets through `@VaultPropertySource`.
* SpEL support in `@Secret`.
* Add support for Jetty as reactive HttpClient.
* `LifecycleAwareSessionManager` and `ReactiveLifecycleAwareSessionManager` emit now ``AuthenticationEvent``s.
* Deprecation of `AppIdAuthentication`. Use `AppRoleAuthentication` instead as recommended by HashiCorp Vault.
[[new-features.2-1-0]]
=== What's new in Spring Vault 2.1

View File

@@ -83,6 +83,8 @@ See also:
[[vault.authentication.appid]]
== AppId authentication
NOTE: AppId authentication is deprecated by Vault. Use <<vault.authentication.approle>> instead.
Vault supports https://www.vaultproject.io/docs/auth/app-id.html[AppId]
authentication that consists of two hard to guess tokens. The AppId
defaults to `spring.application.name` that is statically configured.