Class KeyValueSecretBackendMetadata
- java.lang.Object
-
- org.springframework.cloud.vault.config.SecretBackendMetadataSupport
-
- org.springframework.cloud.vault.config.KeyValueSecretBackendMetadata
-
- All Implemented Interfaces:
SecretBackendMetadata
public class KeyValueSecretBackendMetadata extends SecretBackendMetadataSupport implements SecretBackendMetadata
SecretBackendMetadatafor thekv(key-value) secret backend.- Since:
- 2.0
- Author:
- Mark Paluch
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static List<String>buildContexts(String applicationName, List<String> profiles, String profileSeparator)Create a list of context names from a combination of application name and application name with profile name.static List<String>buildContexts(VaultKeyValueBackendPropertiesSupport properties, List<String> profiles)Build a list of context paths from application name and the active profile names.static SecretBackendMetadatacreate(String path)static SecretBackendMetadatacreate(String secretBackendPath, String key)static SecretBackendMetadatacreate(String path, org.springframework.vault.core.util.PropertyTransformer propertyTransformer)StringgetPath()Return the path of this secret backend.org.springframework.vault.core.util.PropertyTransformergetPropertyTransformer()Return aPropertyTransformerto post-process properties retrieved from Vault.-
Methods inherited from class org.springframework.cloud.vault.config.SecretBackendMetadataSupport
getName, getVariables
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.springframework.cloud.vault.config.SecretBackendMetadata
getName, getVariables
-
-
-
-
Method Detail
-
create
public static SecretBackendMetadata create(String secretBackendPath, String key)
Create aSecretBackendMetadatafor thekvsecret backend given asecretBackendPathandkey. Use plain mount and key paths. The requireddatasegment is added by this method.- Parameters:
secretBackendPath- the secret backend mount path without leading/trailing slashes and without thedatapath segment, must not be empty or null.key- the key within the secret backend. May contain slashes but not leading/trailing slashes, must not be empty or null.- Returns:
- the
SecretBackendMetadata
-
create
public static SecretBackendMetadata create(String path)
- Parameters:
path- the relative path of the secret. slashes, must not be empty or null.- Returns:
- the
SecretBackendMetadata
-
create
public static SecretBackendMetadata create(String path, org.springframework.vault.core.util.PropertyTransformer propertyTransformer)
- Parameters:
path- the relative path of the secret. slashes, must not be empty or null.propertyTransformer- property transformer.- Returns:
- the
SecretBackendMetadata
-
buildContexts
public static List<String> buildContexts(VaultKeyValueBackendPropertiesSupport properties, List<String> profiles)
Build a list of context paths from application name and the active profile names. Application name and profiles support multiple (comma-separated) values.- Parameters:
properties- the key-value backend properties.profiles- active application profiles.- Returns:
- list of context paths.
-
buildContexts
public static List<String> buildContexts(String applicationName, List<String> profiles, String profileSeparator)
Create a list of context names from a combination of application name and application name with profile name. Using an empty application name will return an empty list.- Parameters:
applicationName- the application name. May be empty.profiles- active application profiles.profileSeparator- profile separator character between application name and profile name.- Returns:
- list of context names.
-
getPath
public String getPath()
Description copied from interface:SecretBackendMetadataReturn the path of this secret backend.- Specified by:
getPathin interfaceSecretBackendMetadata- Returns:
- the path of this secret backend.
-
getPropertyTransformer
public org.springframework.vault.core.util.PropertyTransformer getPropertyTransformer()
Description copied from interface:SecretBackendMetadataReturn aPropertyTransformerto post-process properties retrieved from Vault.- Specified by:
getPropertyTransformerin interfaceSecretBackendMetadata- Overrides:
getPropertyTransformerin classSecretBackendMetadataSupport- Returns:
- the property transformer.
- See Also:
PropertyTransformers
-
-