Main Vault client namespace. Contains functions for generic client operations, constructing new clients, and using clients as components in a larger system.
Main Vault client namespace. Contains functions for generic client operations, constructing new clients, and using clients as components in a larger system.
(auth-info client)Return the client's current auth information, a map containing the
:vault.auth/token and other metadata keys from the vault.auth
namespace. Returns nil if the client is unauthenticated.
Return the client's current auth information, a map containing the `:vault.auth/token` and other metadata keys from the [[vault.auth]] namespace. Returns nil if the client is unauthenticated.
(authenticate! client auth-info)Manually authenticate the client by providing a map of auth information
containing a :vault.auth/token. As a shorthand, a Vault token string may
be provided directly. Returns the client.
Manually authenticate the client by providing a map of auth information containing a `:vault.auth/token`. As a shorthand, a Vault token string may be provided directly. Returns the client.
(authenticate-wrapped! client wrap-token)Authenticate the client by unwrapping a limited-use auth token. Returns the client.
Authenticate the client by unwrapping a limited-use auth token. Returns the client.
(client? x)True if the value satisfies the client protocol.
True if the value satisfies the client protocol.
(config-client & {:as opts})Configure a client from the environment if possible. Returns the initialized client, or throws an exception.
This looks for the following configuration, preferring JVM system properties over environment variables:
VAULT_ADDR / vault.addr
The URL of the vault server to connect to.
VAULT_TOKEN / vault.token
A token to use directly for the client authentication. If neither are set,
this will also try the user's ~/.vault-token file.
Accepts the same options as new-client.
Configure a client from the environment if possible. Returns the initialized client, or throws an exception. This looks for the following configuration, preferring JVM system properties over environment variables: - `VAULT_ADDR` / `vault.addr` The URL of the vault server to connect to. - `VAULT_TOKEN` / `vault.token` A token to use directly for the client authentication. If neither are set, this will also try the user's `~/.vault-token` file. Accepts the same options as [[new-client]].
(new-client address & {:as opts})Constructs a new Vault client from a URI address by dispatching on the scheme. The client will be returned in an initialized but not started state.
Options:
:flow (vault.client.flow/Handler)
Custom control flow handler to use with the client. Defaults to
vault.client.flow/sync-handler.
:maintenance-period (integer)
How frequently (in seconds) to check the client auth token and leased
secrets for renewal or rotation. Defaults to 10 seconds.
:maintenance-executor (ScheduledExecutorService)
Custom executor to use for maintenance tasks. Defaults to a new single-threaded executor.
:callback-executor (ExecutorService)
Custom executor to use for lease callbacks. Defaults to the Clojure agent
send-off pool, same as future calls.
:http-opts (map)
Additional options to pass to all HTTP requests.
Constructs a new Vault client from a URI address by dispatching on the scheme. The client will be returned in an initialized but not started state. Options: - `:flow` ([[vault.client.flow/Handler]]) Custom control flow handler to use with the client. Defaults to [[vault.client.flow/sync-handler]]. - `:maintenance-period` (integer) How frequently (in seconds) to check the client auth token and leased secrets for renewal or rotation. Defaults to `10` seconds. - `:maintenance-executor` (`ScheduledExecutorService`) Custom executor to use for maintenance tasks. Defaults to a new single-threaded executor. - `:callback-executor` (`ExecutorService`) Custom executor to use for lease callbacks. Defaults to the Clojure agent send-off pool, same as `future` calls. - `:http-opts` (map) Additional options to pass to all HTTP requests.
(start client)Start the Vault client, returning an updated component with a periodic
maintenance task. See new-client for options which control maintenance
behavior.
Start the Vault client, returning an updated component with a periodic maintenance task. See [[new-client]] for options which control maintenance behavior.
(stop client)Stop the Vault client, canceling any existing maintenance task. Returns a stopped version of the component.
Stop the Vault client, canceling any existing maintenance task. Returns a stopped version of the component.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |