Class VaultPropertySourceLocatorSupport

java.lang.Object
org.springframework.cloud.vault.config.VaultPropertySourceLocatorSupport
All Implemented Interfaces:
org.springframework.cloud.bootstrap.config.PropertySourceLocator

public abstract class VaultPropertySourceLocatorSupport extends Object implements org.springframework.cloud.bootstrap.config.PropertySourceLocator
Abstract PropertySourceLocator to create PropertySources based on VaultKeyValueBackendProperties and SecretBackendMetadata.
Author:
Mark Paluch
  • Constructor Details

  • Method Details

    • locate

      public org.springframework.core.env.PropertySource<?> locate(org.springframework.core.env.Environment environment)
      Specified by:
      locate in interface org.springframework.cloud.bootstrap.config.PropertySourceLocator
    • initialize

      protected void initialize(org.springframework.core.env.CompositePropertySource propertySource)
      Allows initialization the PropertySource before use. Implementations may override this method to preload properties in the PropertySource.
      Parameters:
      propertySource - must not be null.
    • createCompositePropertySource

      protected org.springframework.core.env.CompositePropertySource createCompositePropertySource(org.springframework.core.env.Environment environment)
      Creates a CompositePropertySource.
      Parameters:
      environment - must not be null.
      Returns:
      the composite PropertySource.
    • doCreatePropertySources

      protected List<org.springframework.core.env.PropertySource<?>> doCreatePropertySources(org.springframework.core.env.Environment environment)
      Create PropertySources given Environment from the property configuration.
      Parameters:
      environment - must not be null.
      Returns:
      a List of ordered PropertySources.
    • doCreateKeyValuePropertySources

      protected List<org.springframework.core.env.PropertySource<?>> doCreateKeyValuePropertySources(org.springframework.core.env.Environment environment)
      Create PropertySources using the kv secret backend. Property sources for the kv secret backend derive from the application name and active profiles to generate context paths.
      Parameters:
      environment - must not be null.
      Returns:
      List of PropertySources.
    • doCreateCompositePropertySource

      protected org.springframework.core.env.CompositePropertySource doCreateCompositePropertySource(String propertySourceName, List<org.springframework.core.env.PropertySource<?>> propertySources)
      Create a CompositePropertySource given a List of PropertySources.
      Parameters:
      propertySourceName - the property source name.
      propertySources - the property sources.
      Returns:
      the CompositePropertySource to use.
    • createVaultPropertySource

      protected abstract org.springframework.core.env.PropertySource<?> createVaultPropertySource(SecretBackendMetadata accessor)
      Create VaultPropertySource initialized with a SecretBackendMetadata .
      Parameters:
      accessor - the SecretBackendMetadata.
      Returns:
      the VaultPropertySource to use.