commons-configuration-vault
Hashicorp Vault integration for Apache Commons Configuration.
Getting Started
Maven Dependency
<dependency>
<groupId>com.nerdynick</groupId>
<artifactId>commons-configuration2-vault</artifactId>
<version>${version}</version>
</dependency>
Basic Usage
Example Config File:
credentials:
username: "${vault:my/path:my.username}"
password: "${vault:my/path:my.password}"
Example Java Usage:
final Vault myVault = new Vault(new VaultConfig()
.address("http://vault.example.com")
.token("my-token")
.build());
final MapConfiguration configs = new MapConfiguration(new HashMap<>());
configs.getInterpolator().registerLookup("vault", new VaultLookup(vault));
See Vault Java Driver docs for more examples and details on how to create the Vault Client.
Packaged with this library is also a utility, VaultConfigUtils.java, to assist with creating VaultConfig and SslConfig instances using commons-configuration.