Class AwsEc2Authentication
java.lang.Object
org.springframework.vault.authentication.AwsEc2Authentication
- All Implemented Interfaces:
AuthenticationStepsFactory,ClientAuthentication
public class AwsEc2Authentication
extends Object
implements ClientAuthentication, AuthenticationStepsFactory
AWS-EC2 login implementation.
AWS-EC2 login uses the EC2 identity document and a nonce to login into Vault. AWS-EC2
login obtains the PKCS#7 signed EC2 identity document and generates a
nonce. Instances of this class are immutable once constructed.
- Author:
- Mark Paluch
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionAwsEc2Authentication(AwsEc2AuthenticationOptions options, RestOperations vaultRestOperations, RestOperations awsMetadataRestOperations) Create a newAwsEc2AuthenticationspecifyingAwsEc2AuthenticationOptions, a Vault and an AWS-Metadata-specificRestOperations.AwsEc2Authentication(RestOperations vaultRestOperations) Create a newAwsEc2Authentication. -
Method Summary
Modifier and TypeMethodDescriptionstatic AuthenticationStepsCreates aAuthenticationStepsfor AWS-EC2 authentication givenAwsEc2AuthenticationOptions.protected static AuthenticationStepscreateAuthenticationSteps(AwsEc2AuthenticationOptions options, AtomicReference<char[]> nonce, Supplier<char[]> nonceSupplier) protected char[]Get theAuthenticationStepsdescribing an authentication flow.login()Return aVaultToken.
-
Constructor Details
-
AwsEc2Authentication
Create a newAwsEc2Authentication.- Parameters:
vaultRestOperations- must not be null.
-
AwsEc2Authentication
public AwsEc2Authentication(AwsEc2AuthenticationOptions options, RestOperations vaultRestOperations, RestOperations awsMetadataRestOperations) Create a newAwsEc2AuthenticationspecifyingAwsEc2AuthenticationOptions, a Vault and an AWS-Metadata-specificRestOperations.- Parameters:
options- must not be null.vaultRestOperations- must not be null.awsMetadataRestOperations- must not be null.
-
-
Method Details
-
createAuthenticationSteps
Creates aAuthenticationStepsfor AWS-EC2 authentication givenAwsEc2AuthenticationOptions.- Parameters:
options- must not be null.- Returns:
AuthenticationStepsfor AWS-EC2 authentication.- Since:
- 2.0
-
createAuthenticationSteps
protected static AuthenticationSteps createAuthenticationSteps(AwsEc2AuthenticationOptions options, AtomicReference<char[]> nonce, Supplier<char[]> nonceSupplier) -
login
Description copied from interface:ClientAuthenticationReturn aVaultToken. This method can optionally log into Vault to obtain atoken.- Specified by:
loginin interfaceClientAuthentication- Returns:
- a
VaultToken. - Throws:
VaultException
-
getAuthenticationSteps
Description copied from interface:AuthenticationStepsFactoryGet theAuthenticationStepsdescribing an authentication flow.- Specified by:
getAuthenticationStepsin interfaceAuthenticationStepsFactory- Returns:
- the
AuthenticationStepsdescribing an authentication flow.
-
getEc2Login
-
createNonce
protected char[] createNonce()
-