Interface SecretClient

All Known Implementing Classes:
LocalStorageSecretClient, MemorySecretClient

public interface SecretClient
This is an interface that enables simple CRUD methods for Secret storage without any namespacing logic. The recommended way to use this interface is to implement use CachedSecretFactory to obtain a CachedSecretFactory.CachedSecret for reading. If more than just reading is required, SecretService should be used. This interface should be used directly only as a last resort or for migrations across namespaces.
  • Nested Class Summary

    Nested Classes 
    Modifier and Type Interface Description
    static interface  SecretClient.SecretClientSupplier  
  • Method Summary

    Modifier and Type Method Description
    void create​(Secret secret)
    write the specified Secret to the secret storage for the first time
    default void create​(java.lang.String name, java.lang.String value)
    create a Secret as specified, then write it to the secret storage for the first time
    void delete​(java.lang.String name)
    delete the named Secret from the secret storage
    java.util.List<java.lang.String> listNames​(java.util.Optional<java.lang.String> exclusivePrefix)
    returns the full Secret names that start with exclusive prefix
    Secret read​(java.lang.String name)
    read the Secret with the given name and return a Secret
    void update​(Secret secret)
    update the current value of the Secret in the secret storage
    default void update​(java.lang.String name, java.lang.String value)
    create a Secret as specified, then update the current value of it in the secret storage
    default void validateName​(java.lang.String name)
    validate the provided name according to the rules of the secret storage
    default void validateSecret​(Secret secret)
    validate the provided Secret according to the rules of the secret storage
  • Method Details

    • create

      void create​(Secret secret)
      write the specified Secret to the secret storage for the first time
    • create

      default void create​(java.lang.String name, java.lang.String value)
      create a Secret as specified, then write it to the secret storage for the first time
    • read

      Secret read​(java.lang.String name)
      read the Secret with the given name and return a Secret
    • listNames

      java.util.List<java.lang.String> listNames​(java.util.Optional<java.lang.String> exclusivePrefix)
      returns the full Secret names that start with exclusive prefix
    • update

      void update​(Secret secret)
      update the current value of the Secret in the secret storage
    • update

      default void update​(java.lang.String name, java.lang.String value)
      create a Secret as specified, then update the current value of it in the secret storage
    • delete

      void delete​(java.lang.String name)
      delete the named Secret from the secret storage
    • validateName

      default void validateName​(java.lang.String name)
      validate the provided name according to the rules of the secret storage
    • validateSecret

      default void validateSecret​(Secret secret)
      validate the provided Secret according to the rules of the secret storage