governator-vault

Governator extensions to support HashiCorp Vault as a configuration provider Edit

License

License

Categories

Categories

Governator Application Layer Libs Dependency Injection
GroupId

GroupId

org.sheinbergon
ArtifactId

ArtifactId

governator-vault
Last Version

Last Version

1.17.4
Release Date

Release Date

Type

Type

jar
Description

Description

governator-vault
Governator extensions to support HashiCorp Vault as a configuration provider Edit
Project URL

Project URL

https://github.com/sheinbergon/governator-vault
Source Code Management

Source Code Management

https://github.com/sheinbergon/governator-vault

Download governator-vault

How to add to project

<!-- https://jarcasting.com/artifacts/org.sheinbergon/governator-vault/ -->
<dependency>
    <groupId>org.sheinbergon</groupId>
    <artifactId>governator-vault</artifactId>
    <version>1.17.4</version>
</dependency>
// https://jarcasting.com/artifacts/org.sheinbergon/governator-vault/
implementation 'org.sheinbergon:governator-vault:1.17.4'
// https://jarcasting.com/artifacts/org.sheinbergon/governator-vault/
implementation ("org.sheinbergon:governator-vault:1.17.4")
'org.sheinbergon:governator-vault:jar:1.17.4'
<dependency org="org.sheinbergon" name="governator-vault" rev="1.17.4">
  <artifact name="governator-vault" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.sheinbergon', module='governator-vault', version='1.17.4')
)
libraryDependencies += "org.sheinbergon" % "governator-vault" % "1.17.4"
[org.sheinbergon/governator-vault "1.17.4"]

Dependencies

compile (2)

Group / Artifact Type Version
com.netflix.governator : governator jar 1.17.4
com.bettercloud : vault-java-driver jar 3.0.0

test (4)

Group / Artifact Type Version
junit : junit jar 4.12
org.slf4j : slf4j-simple jar 1.7.2
org.hamcrest : hamcrest-core jar 1.3
org.hamcrest : hamcrest-library jar 1.3

Project Modules

There are no modules declared in this project.

governator-vault

Build Status License Maven Central GitHub release

This library provides smooth integration between Hashicorp's Vault and Netflix's Governator (Guice), allowing you to store and retrieve your application configuration transparently from the vault.

Up ahead on the roadmap :

  • More tests
  • More examples
  • Better support for token renewals
  • Multiple secrets/namespaces support
  • Different auth-backends support (currently, only App-Role is supported).
  • Nested data-structures (???)

Usage

Dependency configuration

Artifacts are available in maven central.

Maven:
<dependency>
    <groupId>org.sheinbergon</groupId>
    <artifactId>governator-vault</artifactId>
    <version>1.17.4</version>
</dependency>
Gradle:
compile "org.sheinbergon:governator-vault:1.17.4"

Simple setup:

BootstrapModule bootstrapModule = new VaultConfigurationProviderBoostrapModule(
                SECRET_PATH,VARIABLE_VALUES,
                VaultConfigBuilder
                    .start()
                    .token(VAULT_TOKEN)
                    .address(VAULT_URL)
                    .build();
                vaultConfig());

Where :

  • SECRET_PATH - Path to the vault secret stroing all of the configuration parameters ( WITHOUT leading '/')
  • VARIABLE_VALUES - A Map<String,String> of dynamic configuration variables as described here
  • VAULT_TOKEN - Vault access token (GUID), as provided/generated by the vault overseer
  • VAULT_URL - Vault access url.

Governator/Guice integration:

LifeCycleInjector injector = LifecycleInjector.builder().
                withBootstrapModule(bootstrapModule).
                withModules(...).
                requiringExplicitBindings().
                build().
                createInjector();

        LifecycleManager manager = injector.getInstance(LifecycleManager.class);
        manager.start();

Versions

Version
1.17.4