Class KubernetesAuthentication
java.lang.Object
org.springframework.vault.authentication.KubernetesAuthentication
- All Implemented Interfaces:
AuthenticationStepsFactory
,ClientAuthentication
public class KubernetesAuthentication
extends Object
implements ClientAuthentication, AuthenticationStepsFactory
Kubernetes implementation of
ClientAuthentication
.
KubernetesAuthentication
uses a Kubernetes Service Account JSON Web Token to
login into Vault. JWT and Role are sent in the login request to Vault to obtain a
VaultToken
.- Since:
- 2.0
- Author:
- Michal Budzyn, Mark Paluch
- See Also:
-
Constructor Summary
ConstructorDescriptionKubernetesAuthentication
(KubernetesAuthenticationOptions options, RestOperations restOperations) -
Method Summary
Modifier and TypeMethodDescriptionstatic AuthenticationSteps
Creates aAuthenticationSteps
for kubernetes authentication givenKubernetesAuthenticationOptions
.Get theAuthenticationSteps
describing an authentication flow.login()
Return aVaultToken
.
-
Constructor Details
-
KubernetesAuthentication
public KubernetesAuthentication(KubernetesAuthenticationOptions options, RestOperations restOperations) - Parameters:
options
- must not be null.restOperations
- must not be null.
-
-
Method Details
-
createAuthenticationSteps
public static AuthenticationSteps createAuthenticationSteps(KubernetesAuthenticationOptions options) Creates aAuthenticationSteps
for kubernetes authentication givenKubernetesAuthenticationOptions
.- Parameters:
options
- must not be null.- Returns:
AuthenticationSteps
for kubernetes authentication.
-
login
Description copied from interface:ClientAuthentication
Return aVaultToken
. This method can optionally log into Vault to obtain atoken
.- Specified by:
login
in interfaceClientAuthentication
- Returns:
- a
VaultToken
. - Throws:
VaultException
-
getAuthenticationSteps
Description copied from interface:AuthenticationStepsFactory
Get theAuthenticationSteps
describing an authentication flow.- Specified by:
getAuthenticationSteps
in interfaceAuthenticationStepsFactory
- Returns:
- the
AuthenticationSteps
describing an authentication flow.
-