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

    Nested Classes
    Modifier and Type
    Class
    Description
    static 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, io.micronaut.http.client.HttpClientConfiguration.DnsResolutionMode, io.micronaut.http.client.HttpClientConfiguration.Http2ClientConfiguration, io.micronaut.http.client.HttpClientConfiguration.WebSocketCompressionConfiguration
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final String
     
    static final String
    Vault Server Endpoint.

    Fields inherited from class io.micronaut.http.client.HttpClientConfiguration

    DEFAULT_ALLOW_BLOCK_EVENT_LOOP, DEFAULT_CONNECTION_POOL_IDLE_TIMEOUT_SECONDS, DEFAULT_DNS_RESOLUTION_MODE, 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

    Constructors
    Constructor
    Description
    VaultClientConfiguration(VaultClientConfiguration.VaultClientConnectionPoolConfiguration vaultClientConnectionPoolConfiguration, io.micronaut.runtime.ApplicationConfiguration applicationConfiguration)
     
  • Method Summary

    Modifier and Type
    Method
    Description
    io.micronaut.http.client.HttpClientConfiguration.ConnectionPoolConfiguration
     
     
     
     
     
     
     
    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

    getAddressResolverGroupName, getAlpnModes, getChannelOptions, getConnectionPoolIdleTimeout, getConnectTimeout, getConnectTtl, getDefaultCharset, getDnsResolutionMode, getEventLoopGroup, getHttp2Configuration, getHttpVersion, getLoggerName, getLogLevel, getMaxContentLength, getNumOfThreads, getPlaintextMode, getProxyAddress, getProxyPassword, getProxySelector, getProxyType, getProxyUsername, getReadIdleTimeout, getReadTimeout, getRequestTimeout, getShutdownQuietPeriod, getShutdownTimeout, getSslConfiguration, getThreadFactory, getWebSocketCompressionConfiguration, isAllowBlockEventLoop, isExceptionOnErrorStatus, isFollowRedirects, resolveProxy, setAddressResolverGroupName, setAllowBlockEventLoop, setAlpnModes, setChannelOptions, setConnectionPoolIdleTimeout, setConnectTimeout, setConnectTtl, setDefaultCharset, setDnsResolutionMode, setEventLoopGroup, setExceptionOnErrorStatus, setFollowRedirects, setHttpVersion, setLoggerName, setLogLevel, setMaxContentLength, setNumOfThreads, setPlaintextMode, setProxyAddress, setProxyPassword, setProxySelector, setProxyType, setProxyUsername, setReadIdleTimeout, setReadTimeout, setRequestTimeout, setShutdownQuietPeriod, setShutdownTimeout, setSslConfiguration, setThreadFactory

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Constructor Details

    • VaultClientConfiguration

      @Inject public VaultClientConfiguration(VaultClientConfiguration.VaultClientConnectionPoolConfiguration vaultClientConnectionPoolConfiguration, io.micronaut.runtime.ApplicationConfiguration applicationConfiguration)
      Parameters:
      vaultClientConnectionPoolConfiguration - Vault Client Connection Pool Configuration
      applicationConfiguration - Application Configuration
  • Method Details

    • getConnectionPoolConfiguration

      public io.micronaut.http.client.HttpClientConfiguration.ConnectionPoolConfiguration getConnectionPoolConfiguration()
      Specified by:
      getConnectionPoolConfiguration in class io.micronaut.http.client.HttpClientConfiguration
    • getDiscoveryConfiguration

      Returns:
      The discovery service configuration
    • getUri

      public String getUri()
      Returns:
      The Vault Server Uri
    • setUri

      public void setUri(String uri)
      Set the Vault Server Uri. Default value ("http://locahost:8200").
      Parameters:
      uri - Vault Server Uri
    • getToken

      public String getToken()
      Returns:
      The Vault authentication token
    • setToken

      public void setToken(String token)
      Set the Vault authentication token.
      Parameters:
      token - Vault authentication token
    • getKvVersion

      Returns:
      The Vault Secret engine version
    • setKvVersion

      public void setKvVersion(VaultClientConfiguration.VaultKvVersion kvVersion)
      Set the version of the Vault Secret engine. V1 or V2. Default value (V2).
      Parameters:
      kvVersion - The version of the Vault Secret engine
    • getSecretEngineName

      public String getSecretEngineName()
      Returns:
      The Vault Secret engine name
    • setSecretEngineName

      public void setSecretEngineName(String secretEngineName)
      Set the name of the Vault Secret engine name. Default value ("secret").
      Parameters:
      secretEngineName - Vault Secret engine name
    • getPathPrefix

      public String getPathPrefix()
      Returns:
      The prefix for the keys used to get vault properties
    • setPathPrefix

      public void setPathPrefix(String pathPrefix)
      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