Class VaultPropertySource


public class VaultPropertySource extends EnumerablePropertySource<VaultOperations>
PropertySource that reads keys and values from a VaultTemplate and path. Transforms properties after retrieving these from Vault using PropertyTransformer.
Author:
Mark Paluch
See Also:
  • Constructor Details

    • VaultPropertySource

      public VaultPropertySource(VaultOperations vaultOperations, String path)
      Create a new VaultPropertySource given a VaultTemplate and path inside of Vault. This property source loads properties upon construction.
      Parameters:
      vaultOperations - must not be null.
      path - the path inside Vault (e.g. secret/myapp/myproperties. Must not be empty or null.
    • VaultPropertySource

      public VaultPropertySource(String name, VaultOperations vaultOperations, String path)
      Create a new VaultPropertySource given a name, VaultTemplate and path inside of Vault. This property source loads properties upon construction.
      Parameters:
      name - name of the property source, must not be null.
      vaultOperations - must not be null.
      path - the path inside Vault (e.g. secret/myapp/myproperties. Must not be empty or null.
    • VaultPropertySource

      public VaultPropertySource(String name, VaultOperations vaultOperations, String path, PropertyTransformer propertyTransformer)
      Create a new VaultPropertySource given a name, VaultTemplate and path inside of Vault. This property source loads properties upon construction and transforms these by applying PropertyTransformer.
      Parameters:
      name - name of the property source, must not be null.
      vaultOperations - must not be null.
      path - the path inside Vault (e.g. secret/myapp/myproperties. Must not be empty or null.
      propertyTransformer - object to transform properties.
      See Also:
    • VaultPropertySource

      public VaultPropertySource(String name, VaultOperations vaultOperations, String path, PropertyTransformer propertyTransformer, boolean ignoreSecretNotFound)
      Create a new VaultPropertySource given a name, VaultTemplate and path inside of Vault. This property source loads properties upon construction and transforms these by applying PropertyTransformer.
      Parameters:
      name - name of the property source, must not be null.
      vaultOperations - must not be null.
      path - the path inside Vault (e.g. secret/myapp/myproperties. Must not be empty or null.
      propertyTransformer - object to transform properties.
      ignoreSecretNotFound - indicate if failure to find a secret at path should be ignored.
      Since:
      2.2
      See Also:
  • Method Details