Class HTTPVaultConnectorFactory
- java.lang.Object
-
- de.stklcode.jvault.connector.factory.VaultConnectorFactory
-
- de.stklcode.jvault.connector.factory.HTTPVaultConnectorFactory
-
- All Implemented Interfaces:
VaultConnectorBuilder
@Deprecated public final class HTTPVaultConnectorFactory extends VaultConnectorFactory
Deprecated.As of 0.8.0 please refer toHTTPVaultConnectorBuilderwith identical API.Vault Connector Factory implementation for HTTP Vault connectors.- Since:
- 0.1
- Author:
- Stefan Kalscheuer
-
-
Constructor Summary
Constructors Constructor Description HTTPVaultConnectorFactory()Deprecated.Default empty constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description HTTPVaultConnectorbuild()Deprecated.Build command, produces connector after initialization.HTTPVaultConnectorbuildAndAuth()Deprecated.Build connector and authenticate with token set in factory or from environment.HTTPVaultConnectorFactoryfromEnv()Deprecated.Build connector based on the VAULT_ADDR} andVAULT_CACERT(optional) environment variables.HTTPVaultConnectorFactorywithHost(String host)Deprecated.Set hostname (default: 127.0.0.1).HTTPVaultConnectorFactorywithNumberOfRetries(int numberOfRetries)Deprecated.Define the number of retries to attempt on 5xx errors.HTTPVaultConnectorFactorywithoutTLS()Deprecated.Convenience Method for NOT using TLS.HTTPVaultConnectorFactorywithPort(Integer port)Deprecated.Set port (default: 8200).HTTPVaultConnectorFactorywithPrefix(String prefix)Deprecated.Set API prefix.HTTPVaultConnectorFactorywithSslContext(SSLContext sslContext)Deprecated.As of 0.8.0 this is no longer supported, please usewithTrustedCA(Path)orwithTrustedCA(X509Certificate).HTTPVaultConnectorFactorywithTimeout(int milliseconds)Deprecated.Define a custom timeout for the HTTP connection.HTTPVaultConnectorFactorywithTLS()Deprecated.Convenience Method for TLS usage (enabled by default).HTTPVaultConnectorFactorywithTLS(boolean useTLS)Deprecated.Set TLS usage (default: TRUE).HTTPVaultConnectorFactorywithToken(String token)Deprecated.Set token for automatic authentication, usingbuildAndAuth().HTTPVaultConnectorFactorywithTrustedCA(Path cert)Deprecated.Add a trusted CA certificate for HTTPS connections.HTTPVaultConnectorFactorywithTrustedCA(X509Certificate cert)Deprecated.Add a trusted CA certificate for HTTPS connections.-
Methods inherited from class de.stklcode.jvault.connector.factory.VaultConnectorFactory
httpFactory
-
-
-
-
Method Detail
-
withHost
public HTTPVaultConnectorFactory withHost(String host)
Deprecated.Set hostname (default: 127.0.0.1).- Parameters:
host- Hostname or IP address- Returns:
- self
-
withPort
public HTTPVaultConnectorFactory withPort(Integer port)
Deprecated.Set port (default: 8200).- Parameters:
port- Vault TCP port- Returns:
- self
-
withTLS
public HTTPVaultConnectorFactory withTLS(boolean useTLS)
Deprecated.Set TLS usage (default: TRUE).- Parameters:
useTLS- use TLS or not- Returns:
- self
-
withTLS
public HTTPVaultConnectorFactory withTLS()
Deprecated.Convenience Method for TLS usage (enabled by default).- Returns:
- self
-
withoutTLS
public HTTPVaultConnectorFactory withoutTLS()
Deprecated.Convenience Method for NOT using TLS.- Returns:
- self
-
withPrefix
public HTTPVaultConnectorFactory withPrefix(String prefix)
Deprecated.Set API prefix. Default is "/v1/" and changes should not be necessary for current state of development.- Parameters:
prefix- Vault API prefix (default: "/v1/"- Returns:
- self
-
withTrustedCA
public HTTPVaultConnectorFactory withTrustedCA(Path cert) throws VaultConnectorException
Deprecated.Add a trusted CA certificate for HTTPS connections.- Parameters:
cert- path to certificate file- Returns:
- self
- Throws:
VaultConnectorException- on error- Since:
- 0.4.0
-
withTrustedCA
public HTTPVaultConnectorFactory withTrustedCA(X509Certificate cert)
Deprecated.Add a trusted CA certificate for HTTPS connections.- Parameters:
cert- path to certificate file- Returns:
- self
- Since:
- 0.8.0
-
withSslContext
public HTTPVaultConnectorFactory withSslContext(SSLContext sslContext)
Deprecated.As of 0.8.0 this is no longer supported, please usewithTrustedCA(Path)orwithTrustedCA(X509Certificate).Add a custom SSL context. Overwrites certificates set bywithTrustedCA(java.nio.file.Path).- Parameters:
sslContext- the SSL context- Returns:
- self
- Since:
- 0.4.0
-
withToken
public HTTPVaultConnectorFactory withToken(String token)
Deprecated.Set token for automatic authentication, usingbuildAndAuth().- Parameters:
token- Vault token- Returns:
- self
- Since:
- 0.6.0
-
fromEnv
public HTTPVaultConnectorFactory fromEnv() throws VaultConnectorException
Deprecated.Build connector based on the VAULT_ADDR} andVAULT_CACERT(optional) environment variables.- Returns:
- self
- Throws:
VaultConnectorException- if Vault address from environment variables is malformed- Since:
- 0.6.0
-
withNumberOfRetries
public HTTPVaultConnectorFactory withNumberOfRetries(int numberOfRetries)
Deprecated.Define the number of retries to attempt on 5xx errors.- Parameters:
numberOfRetries- The number of retries to attempt on 5xx errors (default: 0)- Returns:
- self
- Since:
- 0.6.0
-
withTimeout
public HTTPVaultConnectorFactory withTimeout(int milliseconds)
Deprecated.Define a custom timeout for the HTTP connection.- Parameters:
milliseconds- Timeout value in milliseconds.- Returns:
- self
- Since:
- 0.6.0
-
build
public HTTPVaultConnector build()
Deprecated.Description copied from interface:VaultConnectorBuilderBuild command, produces connector after initialization.- Returns:
- Vault Connector instance.
-
buildAndAuth
public HTTPVaultConnector buildAndAuth() throws VaultConnectorException
Deprecated.Description copied from interface:VaultConnectorBuilderBuild connector and authenticate with token set in factory or from environment.- Returns:
- Authenticated Vault connector instance.
- Throws:
VaultConnectorException- if authentication failed
-
-