Class RenewableVault

java.lang.Object
de.otto.kafka.messaging.e2ee.vault.RenewableVault
All Implemented Interfaces:
ReadonlyVaultApi

public final class RenewableVault extends Object implements ReadonlyVaultApi
  • Constructor Details

    • RenewableVault

      public RenewableVault(io.github.jopenlibs.vault.VaultConfig configAuth, VaultConnectionConfig.VaultAppRole appRole)
    • RenewableVault

      public RenewableVault(io.github.jopenlibs.vault.VaultConfig configAuth)
  • Method Details

    • read

      public io.github.jopenlibs.vault.response.LogicalResponse read(String path) throws io.github.jopenlibs.vault.VaultException
      Description copied from interface: ReadonlyVaultApi

      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");
       
      Specified by:
      read in interface ReadonlyVaultApi
      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

      public io.github.jopenlibs.vault.response.LogicalResponse read(String path, int version) throws io.github.jopenlibs.vault.VaultException
      Description copied from interface: ReadonlyVaultApi

      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");
       
      Specified by:
      read in interface ReadonlyVaultApi
      Parameters:
      path - The Vault key value from which to read (e.g. secret/hello
      version - 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.