Interface Kv2Secrets

  • All Superinterfaces:
    Secrets

    public interface Kv2Secrets
    extends Secrets
    Secrets for KV version 2 secrets engine blocking implementation. All methods block the current thread. This implementation is not suitable for reactive programming. Use Kv2SecretsRx in reactive code.
    • Method Detail

      • create

        static Kv2Secrets create​(Kv2SecretsRx reactiveSecrets)
        Create blocking Key/Vault secrets from its reactive counterpart.
        Parameters:
        reactiveSecrets - reactive secrets
        Returns:
        blocking secrets
      • get

        default Optional<Kv2Secret> get​(String path)
        Get the latest version of a secret.
        Parameters:
        path - relative to the mount point, no leading slash
        Returns:
        the secret
      • get

        default Optional<Kv2Secret> get​(String path,
                                        int version)
        Get a version of a secret.
        Parameters:
        path - relative to the mount point, no leading slash
        version - version to retrieve
        Returns:
        the secret
      • update

        default Integer update​(String path,
                               Map<String,​String> newValues)
        Update a secret on the defined path. The new values replace existing values.
        Parameters:
        path - relative to the mount point, no leading slash
        newValues - new values of the secret
        Returns:
        the version created
      • update

        default Integer update​(String path,
                               Map<String,​String> newValues,
                               int expectedVersion)
        Update a secret on the defined path. The new values replace existing values.
        Parameters:
        path - relative to the mount point, no leading slash
        newValues - new values of the secret
        expectedVersion - expected latest version
        Returns:
        the version created
      • update

        UpdateKv2.Response update​(UpdateKv2.Request request)
        Update a secret on the defined path. The new values replace existing values.
        Parameters:
        request - update request with path, new values and expected version
        Returns:
        vault response with the version created
      • create

        default CreateKv2.Response create​(String path,
                                          Map<String,​String> newSecretValues)
        Create a new secret on the defined path.
        Parameters:
        path - relative to the mount point, no leading slash
        newSecretValues - values to use in the new secret
        Returns:
        vault response
      • delete

        default DeleteKv2.Response delete​(String path,
                                          int... versions)
        Delete specific versions of a secret.
        Parameters:
        path - relative to the mount point, no leading slash
        versions - versions to delete
        Returns:
        vault response
      • delete

        DeleteKv2.Response delete​(DeleteKv2.Request request)
        Delete a secret version.
        Parameters:
        request - request with path and version(s)
        Returns:
        delete secret response
      • undelete

        default UndeleteKv2.Response undelete​(String path,
                                              int... versions)
        Undelete deleted versions of a secret. This method can be called repeatedly and even on non-existent versions without throwing an exception.
        Parameters:
        path - relative to the mount point, no leading slash
        versions - versions to undelete
        Returns:
        vault response
      • destroy

        default DestroyKv2.Response destroy​(String path,
                                            int... versions)
        Permanently remove specific versions of a secret. This method can be called repeatedly and even on non-existent versions without throwing an exception.
        Parameters:
        path - relative to the mount point, no leading slash
        versions - versions to destroy
        Returns:
        vault response
      • deleteAll

        default DeleteAllKv2.Response deleteAll​(String path)
        Delete the secret and all its versions permanently. This method can be called repeatedly and even on non-existent versions without throwing an exception.
        Parameters:
        path - relative to the mount point, no leading slash
        Returns:
        vault response
      • deleteAll

        DeleteAllKv2.Response deleteAll​(DeleteAllKv2.Request request)
        Delete the secret and all its versions permanently. This method can be called repeatedly and even on non-existent versions without throwing an exception.
        Parameters:
        request - with relative path to the mount point, no leading slash
        Returns:
        vault response