Package codes.grow.packages.infisical
Class InfisicalClient.Builder
java.lang.Object
codes.grow.packages.infisical.InfisicalClient.Builder
- Enclosing class:
InfisicalClient
Builder that configures and creates a client in one chain.
-
Method Summary
Modifier and TypeMethodDescriptionapiVersion(String apiVersion) Forces the secrets API version (v4orv3).auth(Authenticator auth) Sets an explicit authentication method.build()Builds the configuration and the client.Sets the Universal Auth client id.clientSecret(String clientSecret) Sets the Universal Auth client secret.Sets the connect timeout.environment(String environment) Sets the default environment slug.Fills unset fields from an environment reader.Adds a header.Sets hooks.Sets the logger.Sets the default project id.Sets the proxy URL.Sets the per-attempt timeout.retry(RetryPolicy retry) Sets the retry policy.revokeOnClose(boolean revokeOnClose) Revokes a token obtained by login on close.secretPath(String secretPath) Sets the default secret path.tls(TlsOptions tls) Sets the TLS options.Sets a static access token.Sets a static access token.Sets the total timeout.Sets the endpoint base URL.userAgentSuffix(String suffix) Sets the user agent suffix.
-
Method Details
-
fromEnv
Fills unset fields from an environment reader.- Parameters:
env- reader, e.g.EnvReader.system()- Returns:
- this builder
-
url
Sets the endpoint base URL.- Parameters:
url- URL- Returns:
- this builder
-
token
Sets a static access token.- Parameters:
token- token- Returns:
- this builder
-
token
Sets a static access token.- Parameters:
token- token- Returns:
- this builder
-
auth
Sets an explicit authentication method.- Parameters:
auth- authenticator- Returns:
- this builder
-
clientId
Sets the Universal Auth client id.- Parameters:
clientId- client id- Returns:
- this builder
-
clientSecret
Sets the Universal Auth client secret.- Parameters:
clientSecret- client secret- Returns:
- this builder
-
projectId
Sets the default project id.- Parameters:
projectId- project id- Returns:
- this builder
-
environment
Sets the default environment slug.- Parameters:
environment- slug- Returns:
- this builder
-
secretPath
Sets the default secret path.- Parameters:
secretPath- path- Returns:
- this builder
-
apiVersion
Forces the secrets API version (v4orv3).- Parameters:
apiVersion- version- Returns:
- this builder
-
revokeOnClose
Revokes a token obtained by login on close.- Parameters:
revokeOnClose- flag- Returns:
- this builder
-
connectTimeout
Sets the connect timeout.- Parameters:
d- duration- Returns:
- this builder
-
requestTimeout
Sets the per-attempt timeout.- Parameters:
d- duration- Returns:
- this builder
-
totalTimeout
Sets the total timeout.- Parameters:
d- duration- Returns:
- this builder
-
retry
Sets the retry policy.- Parameters:
retry- policy- Returns:
- this builder
-
tls
Sets the TLS options.- Parameters:
tls- options- Returns:
- this builder
-
proxy
Sets the proxy URL.- Parameters:
proxy- URL- Returns:
- this builder
-
header
Adds a header.- Parameters:
name- namevalue- value- Returns:
- this builder
-
userAgentSuffix
Sets the user agent suffix.- Parameters:
suffix- suffix- Returns:
- this builder
-
hooks
Sets hooks.- Parameters:
hooks- hooks- Returns:
- this builder
-
logger
Sets the logger.- Parameters:
logger- logger- Returns:
- this builder
-
build
Builds the configuration and the client.- Returns:
- a new client
- Throws:
ConfigException- when the configuration is invalid
-