Interface ReadonlyVaultApi
- All Known Implementing Classes:
RenewableVault
public interface ReadonlyVaultApi
-
Method Summary
Modifier and TypeMethodDescriptionio.github.jopenlibs.vault.response.LogicalResponseBasic read operation to retrieve a secret.io.github.jopenlibs.vault.response.LogicalResponseBasic read operation to retrieve a specified secret version for KV engine version 2.
-
Method Details
-
read
io.github.jopenlibs.vault.response.LogicalResponse read(String path) throws io.github.jopenlibs.vault.VaultException Basic read operation to retrieve a secret. A single secret key can map to multiple name-value pairs, which can be retrieved from the response object. E.g.:
final LogicalResponse response = vault.read("secret/hello"); final String value = response.getData().get("value"); final String otherValue = response.getData().get("other_value");- Parameters:
path- The Vault key value from which to read (e.g.secret/hello)- Returns:
- The response information returned from Vault
- Throws:
io.github.jopenlibs.vault.VaultException- If any errors occurs with the REST request (e.g. non-200 status code, invalid JSON payload, etc), and the maximum number of retries is exceeded.
-
read
io.github.jopenlibs.vault.response.LogicalResponse read(String path, int version) throws io.github.jopenlibs.vault.VaultException Basic read operation to retrieve a specified secret version for KV engine version 2. A single secret key version can map to multiple name-value pairs, which can be retrieved from the response object. E.g.:
final LogicalResponse response = vault.read("secret/hello", 21); final String value = response.getData().get("value"); final String otherValue = response.getData().get("other_value");- Parameters:
path- The Vault key value from which to read (e.g.secret/helloversion- The Integer version number of the secret to read, e.g. "21"- Returns:
- The response information returned from Vault
- Throws:
io.github.jopenlibs.vault.VaultException- If any errors occurs with the REST request (e.g. non-200 status code, invalid JSON payload, etc), and the maximum number of retries is exceeded.
-