Class VaultClientConfiguration
java.lang.Object
io.micronaut.http.client.HttpClientConfiguration
io.micronaut.discovery.vault.config.VaultClientConfiguration
@ConfigurationProperties("vault.client")
@Requires(property="vault.client")
public class VaultClientConfiguration
extends io.micronaut.http.client.HttpClientConfiguration
A
HttpClientConfiguration
for Vault Client.- Since:
- 1.2.0
- Author:
- thiagolocatelli
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
The Http Pool Connection Configuration class for Vault.static class
The Discovery Configuration class for Vault.static enum
Vault Secret Engine versions.Nested classes/interfaces inherited from class io.micronaut.http.client.HttpClientConfiguration
io.micronaut.http.client.HttpClientConfiguration.ConnectionPoolConfiguration
-
Field Summary
Fields inherited from class io.micronaut.http.client.HttpClientConfiguration
DEFAULT_ALLOW_BLOCK_EVENT_LOOP, DEFAULT_CONNECTION_POOL_IDLE_TIMEOUT_SECONDS, DEFAULT_EXCEPTION_ON_ERROR_STATUS, DEFAULT_FOLLOW_REDIRECTS, DEFAULT_MAX_CONTENT_LENGTH, DEFAULT_READ_IDLE_TIMEOUT_MINUTES, DEFAULT_READ_TIMEOUT_SECONDS, DEFAULT_SHUTDOWN_QUIET_PERIOD_MILLISECONDS, DEFAULT_SHUTDOWN_TIMEOUT_MILLISECONDS
-
Constructor Summary
ConstructorDescriptionVaultClientConfiguration
(VaultClientConfiguration.VaultClientConnectionPoolConfiguration vaultClientConnectionPoolConfiguration, io.micronaut.runtime.ApplicationConfiguration applicationConfiguration) -
Method Summary
Modifier and TypeMethodDescriptionio.micronaut.http.client.HttpClientConfiguration.ConnectionPoolConfiguration
getToken()
getUri()
boolean
void
setFailFast
(boolean failFast) If set to true an exception will be thrown if configuration is not found for the application or any of its environments.void
Set the version of the Vault Secret engine.void
setPathPrefix
(String pathPrefix) Set the prefix for the keys used to get vault properties.void
setSecretEngineName
(String secretEngineName) Set the name of the Vault Secret engine name.void
Set the Vault authentication token.void
Set the Vault Server Uri.Methods inherited from class io.micronaut.http.client.HttpClientConfiguration
getAlpnModes, getChannelOptions, getConnectionPoolIdleTimeout, getConnectTimeout, getConnectTtl, getDefaultCharset, getEventLoopGroup, getHttpVersion, getLoggerName, getLogLevel, getMaxContentLength, getNumOfThreads, getPlaintextMode, getProxyAddress, getProxyPassword, getProxySelector, getProxyType, getProxyUsername, getReadIdleTimeout, getReadTimeout, getShutdownQuietPeriod, getShutdownTimeout, getSslConfiguration, getThreadFactory, isAllowBlockEventLoop, isExceptionOnErrorStatus, isFollowRedirects, resolveProxy, setAllowBlockEventLoop, setAlpnModes, setChannelOptions, setConnectionPoolIdleTimeout, setConnectTimeout, setConnectTtl, setDefaultCharset, setEventLoopGroup, setExceptionOnErrorStatus, setFollowRedirects, setHttpVersion, setLoggerName, setLogLevel, setMaxContentLength, setNumOfThreads, setPlaintextMode, setProxyAddress, setProxyPassword, setProxySelector, setProxyType, setProxyUsername, setReadIdleTimeout, setReadTimeout, setShutdownQuietPeriod, setShutdownTimeout, setSslConfiguration, setThreadFactory
-
Field Details
-
PREFIX
- See Also:
-
VAULT_CLIENT_CONFIG_ENDPOINT
Vault Server Endpoint.- See Also:
-
-
Constructor Details
-
VaultClientConfiguration
@Inject public VaultClientConfiguration(VaultClientConfiguration.VaultClientConnectionPoolConfiguration vaultClientConnectionPoolConfiguration, io.micronaut.runtime.ApplicationConfiguration applicationConfiguration) - Parameters:
vaultClientConnectionPoolConfiguration
- Vault Client Connection Pool ConfigurationapplicationConfiguration
- Application Configuration
-
-
Method Details
-
getConnectionPoolConfiguration
public io.micronaut.http.client.HttpClientConfiguration.ConnectionPoolConfiguration getConnectionPoolConfiguration()- Specified by:
getConnectionPoolConfiguration
in classio.micronaut.http.client.HttpClientConfiguration
-
getDiscoveryConfiguration
- Returns:
- The discovery service configuration
-
getUri
- Returns:
- The Vault Server Uri
-
setUri
Set the Vault Server Uri. Default value ("http://locahost:8200").- Parameters:
uri
- Vault Server Uri
-
getToken
- Returns:
- The Vault authentication token
-
setToken
Set the Vault authentication token.- Parameters:
token
- Vault authentication token
-
getKvVersion
- Returns:
- The Vault Secret engine version
-
setKvVersion
Set the version of the Vault Secret engine. V1 or V2. Default value (V2).- Parameters:
kvVersion
- The version of the Vault Secret engine
-
getSecretEngineName
- Returns:
- The Vault Secret engine name
-
setSecretEngineName
Set the name of the Vault Secret engine name. Default value ("secret").- Parameters:
secretEngineName
- Vault Secret engine name
-
getPathPrefix
- Returns:
- The prefix for the keys used to get vault properties
-
setPathPrefix
Set the prefix for the keys used to get vault properties. Default value is empty string- Parameters:
pathPrefix
- path which prefixes keys.
-
isFailFast
public boolean isFailFast()- Returns:
- Flag to indicate that failure to connect to HashiCorp Vault is fatal (default false).
-
setFailFast
public void setFailFast(boolean failFast) If set to true an exception will be thrown if configuration is not found for the application or any of its environments. Default value ().- Parameters:
failFast
- Flag to fail fast
-