Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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

Netflix's Governator integration with Hashicorp's Vault
https://github.com/sheinbergon/governator-vault

guice hashicorp java netflix netflix-oss vault

Last synced: 18 days ago
JSON representation

Netflix's Governator integration with Hashicorp's Vault

Awesome Lists containing this project

README

        

# governator-vault
[![Build Status](https://travis-ci.org/sheinbergon/governator-vault.svg?branch=master)](https://travis-ci.org/sheinbergon/governator-vault) [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/org.sheinbergon/governator-vault/badge.svg)](https://maven-badges.herokuapp.com/maven-central/org.sheinbergon/governator-vault) [![GitHub release](https://img.shields.io/github/release/sheinbergon/governator-vault.svg)](https://img.shields.io/github/release/sheinbergon/governator-vault)

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:

```xml

org.sheinbergon
governator-vault
1.17.4

```

##### Gradle:
```groovy
compile "org.sheinbergon:governator-vault:1.17.4"
```

#### Simple setup:
```java
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` of dynamic configuration variables as described [here](https://github.com/Netflix/governator/wiki/Configuration-Mapping)
- `VAULT_TOKEN` - Vault access token (GUID), as provided/generated by the vault overseer
- `VAULT_URL` - Vault access url.

#### Governator/Guice integration:
```java
LifeCycleInjector injector = LifecycleInjector.builder().
withBootstrapModule(bootstrapModule).
withModules(...).
requiringExplicitBindings().
build().
createInjector();

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