@Configuration public class EnvironmentVaultConfiguration extends AbstractVaultConfiguration implements org.springframework.context.ApplicationContextAware
Environment
to
configure Spring Vault endpoint, SSL options and authentication options. This
configuration class uses predefined property keys and is usually imported as part of an
existing Java-based configuration. Configuration is obtained from other, existing
property sources.
Usage: Java-based configuration part:
@Configuration
@Import(EnvironmentVaultConfiguration.class)
public class MyConfiguration {
}
Supplied properties:
vault.uri=https://localhost:8200
vault.token=00000000-0000-0000-0000-000000000000
vault.uri
vault.ssl.key-store
(optional)vault.ssl.key-store-password
(optional)vault.ssl.trust-store
(optional)vault.ssl.trust-store-password
(optional)vault.authentication
(defaults to TOKEN,
supported authentication methods are:
TOKEN, APPID, APPROLE, AWS_EC2, CERT, CUBBYHOLE)vault.token
vault.app-id.app-id
vault.app-id.user-id
. MAC_ADDRESS and
IP_ADDRESS use MacAddressUserId
, respective IpAddressUserId
.
Any other value is used with StaticUserId
.vault.app-role.role-id
vault.app-role.secret-id
(optional)vault.aws-ec2.role-id
vault.aws-ec2.identity-document
(optional)vault.token
Environment
,
PropertySource
,
VaultEndpoint
,
AppIdAuthentication
,
AppRoleAuthentication
,
AwsEc2Authentication
,
ClientCertificateAuthentication
,
CubbyholeAuthentication
AbstractVaultConfiguration.ClientFactoryWrapper
Constructor and Description |
---|
EnvironmentVaultConfiguration() |
Modifier and Type | Method and Description |
---|---|
protected ClientAuthentication |
appIdAuthentication() |
protected ClientAuthentication |
appRoleAuthentication() |
protected ClientAuthentication |
awsEc2Authentication() |
ClientAuthentication |
clientAuthentication()
Annotate with
Bean in case you want to expose a
ClientAuthentication instance to the
ApplicationContext . |
protected ClientAuthentication |
cubbyholeAuthentication() |
protected AppIdUserIdMechanism |
getAppIdUserIdMechanism(String userId) |
org.springframework.web.client.RestOperations |
restOperations()
Construct a
RestOperations object configured for Vault usage. |
void |
setApplicationContext(org.springframework.context.ApplicationContext applicationContext) |
SslConfiguration |
sslConfiguration() |
protected ClientAuthentication |
tokenAuthentication() |
VaultEndpoint |
vaultEndpoint() |
clientHttpRequestFactoryWrapper, clientOptions, getEnvironment, secretLeaseContainer, sessionManager, threadPoolTaskScheduler, vaultEndpointProvider, vaultTemplate
public org.springframework.web.client.RestOperations restOperations()
AbstractVaultConfiguration
RestOperations
object configured for Vault usage.restOperations
in class AbstractVaultConfiguration
RestOperations
to be used for Vault access.AbstractVaultConfiguration.vaultEndpointProvider()
,
AbstractVaultConfiguration.clientHttpRequestFactoryWrapper()
public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext) throws org.springframework.beans.BeansException
setApplicationContext
in interface org.springframework.context.ApplicationContextAware
setApplicationContext
in class AbstractVaultConfiguration
org.springframework.beans.BeansException
public VaultEndpoint vaultEndpoint()
vaultEndpoint
in class AbstractVaultConfiguration
public SslConfiguration sslConfiguration()
sslConfiguration
in class AbstractVaultConfiguration
SslConfiguration.NONE
.SslConfiguration
,
SslConfiguration.NONE
public ClientAuthentication clientAuthentication()
AbstractVaultConfiguration
Bean
in case you want to expose a
ClientAuthentication
instance to the
ApplicationContext
.clientAuthentication
in class AbstractVaultConfiguration
ClientAuthentication
to use. Must not be null.protected ClientAuthentication tokenAuthentication()
protected ClientAuthentication appIdAuthentication()
protected ClientAuthentication appRoleAuthentication()
protected AppIdUserIdMechanism getAppIdUserIdMechanism(String userId)
protected ClientAuthentication awsEc2Authentication()
protected ClientAuthentication cubbyholeAuthentication()
Copyright © 2016–2017 Pivotal Software, Inc.. All rights reserved.