Commit Graph

84 Commits

Author SHA1 Message Date
Mark Paluch
d8d85e1a67 Polishing.
Align wording in JavaDoc. Provide package-level JavaDoc.
2017-03-08 21:41:03 +01:00
Mark Paluch
51c6a81c25 Add LeaseAwareVaultPropertySource.
We now provide a Lease-aware PropertySource to renew and rotate secrets requested by that PropertySource. Lease renewal is applied per property source to control individual secrets with individual lease durations. A terminal expired lease can be either rotated to obtain new credentials. A non-rotated secret that terminally expires is removed from the property source. LeaseAwareVaultPropertySource is updated by SecretLeaseContainer on a background thread.

Components created with properties retrieved from LeaseAwareVaultPropertySource are not refreshed upon secret rotation.

@VaultPropertySource(value = "aws/creds/s3", renewal = Renewal.ROTATE)
public class Config {
}

@VaultPropertySource(value = "mysql/creds/my-role", renewal = Renewal.RENEW)
public class Config {
}

Closes gh-50.
2017-03-08 21:41:00 +01:00
Mark Paluch
81ade23b8c Add SecretLeaseContainer to renew leases and rotate secrets.
We now provide an event-driven container to request secrets with renewal and rotation on terminal lease expiration.

See gh-50.
2017-03-08 21:18:34 +01:00
Mark Paluch
f8a4e3a4fd Add EnvironmentVaultConfiguration.
Provide a EnvironmentVaultConfiguration for common configuration scenarios to obtain configuration from Spring's Environment. EnvironmentVaultConfiguration supports various authentication mechanisms: Token, AppId, AppRole, AWS EC2, Client-Certificates, and Cubbyhole.

Java-based configuration class:

  @PropertySource("vault.properties")
  @Import(EnvironmentVaultConfiguration.class)
  public class MyConfiguration{
  }

vault.properties

  vault.uri=https://localhost:8200
  vault.token=…

Closes gh-30.
2017-03-02 11:58:44 +01:00
Mark Paluch
64e3f577e6 Upgrade to Spring Framework 4.3.7.
Closes gh-58.
2017-03-02 09:32:54 +01:00
Mark Paluch
7101a38ace Cleanup transit keys after test run.
Remove transit keys before/after testrun to leave a clean state.

See gh-53.
2017-02-20 11:30:31 -05:00
Mark Paluch
d3491dd712 Configure RestTemplate with required HttpMessageConverters.
VaultClients.createRestTemplate() creates a RestTemplate that is configured with ByteArray, String and Jackson 2 message converters to avoid additional message converters to be registered, if they were on available on the classpath.

Fixes gh-47.
2017-02-16 16:23:52 +01:00
Mark Paluch
c9bde5a15f Allow listing transit keys.
VaultTransitOperations exposes now getKeys() to retrieve transit key names.

Closes gh-53.
2017-02-16 16:00:16 +01:00
Mark Paluch
feb12c517c Provide an empty VaultTransitContext.
Provide VaultTransitContext.empty() to create an empty VaultTransitContext for encryption/decryption of binary plaintext without requiring to use VaultTransitContext builder.

Closes gh-54.
2017-02-16 15:42:50 +01:00
Mark Paluch
5078a4c133 Remove VaultClient in favor of RestOperations.
Remove VaultClient from VaultTemplate and switch implementations to use RestOperations directly. VaultClient provided an additional abstraction level over RestTemplate with a large API surface adding only little value.

Implementations work directly with RestOperations. Relative URI expansion is handled by DefaultUriTemplateHandler configured with the VaultEndpoint base URI.

Closes gh-49.

Original pull request: gh-57.
2017-02-16 14:34:21 +01:00
Mark Paluch
b1e28c4dae Upgrade LibSSL on TravisCI.
Fixes gh-56.
2017-02-08 08:51:42 +01:00
Mark Paluch
648762d41a Enable Vault output in start.sh. 2017-02-08 08:38:16 +01:00
Mark Paluch
cf0852308e Upgrade to Vault 0.6.5.
Closes gh-55.
2017-02-08 08:34:15 +01:00
Mark Paluch
746fceee0f Polishing.
SPR-14744 was resolved so the netty test can be enabled again.
2017-02-05 17:11:14 +01:00
Mark Paluch
d3af1d49ce Support JVM proxy settings using Apache HttpComponents.
Closes gh-52.
2017-02-05 17:09:22 +01:00
Mark Paluch
f8409e2f80 Support property prefixes with VaultPropertySource.
We now support optional prefixing of property names. Property names coming from Vault are exposed with a prefixed name through VaultPropertySource.

@VaultPropertySource(value = "mysql/creds/readonly", propertyNamePrefix = "database.")
static class Configuration{}

will expose all keys under "mysql/creds/readonly" prefixed with "database." that lead properties known as "database.username" and "database.password".

Closes gh-48.
2017-02-02 17:16:58 +01:00
Mark Paluch
6a98ab9d5a Upgrade to Spring Framework 4.3.6.
Closes gh-46.
2017-01-25 16:56:52 +01:00
Mark Paluch
d0b09912ab Post-release cleanups.
Fixes gh-45.
2017-01-17 10:46:24 +01:00
Mark Paluch
bd91e94ebc [maven-release-plugin] prepare for next development iteration 2017-01-17 10:39:58 +01:00
Mark Paluch
d9ee8d0eb5 [maven-release-plugin] prepare release 1.0.0.M2 2017-01-17 10:39:52 +01:00
Mark Paluch
18f8318014 Polishing.
Add OkHttp3 to reference documentation. Add java hint to code fences.

See gh-45.
2017-01-17 10:34:50 +01:00
Mark Paluch
a114fa244d Prepare release.
See gh-45.
2017-01-17 10:25:00 +01:00
Mark Paluch
53416a19bb Upgrade test dependencies.
Mockito 2.1.0-RC.1 -> 2.6.2
AssertJ 3.5.2 -> 3.6.1

Fixes gh-44.
2017-01-13 16:59:24 +01:00
Mark Paluch
2799fbc115 Upgrade to OkHttp 3.5.0.
Fixes gh-43.
2017-01-10 15:57:21 +01:00
Mark Paluch
50a9aa7d76 Upgrade to Vault 0.6.4
Fixes gh-42.
2017-01-02 12:09:01 +01:00
Mark Paluch
94c416c3a7 Upgrade to Spring 4.3.5.
Fixes gh-41.
2017-01-02 12:07:15 +01:00
Mark Paluch
587394aa97 Polishing.
Enhance JavaDoc.

See gh-40.
2016-12-15 10:48:11 +01:00
Mark Paluch
c387aec23e Flatten hierarchical JSON objects into property paths.
Hierarchical JSON data stored in Vault is flattened to property paths with dot-notation.

  {
    "database": {
      "password": ...
    },
    "items": ["one", "two"],
    "user.name": ...,
  }

results in

  database.password=...
  items[0]=one
  items[1]=two
  user.name=...

Fixes gh-40.
2016-12-15 10:36:19 +01:00
Mark Paluch
65494e4e63 Add support for OkHttp 3.
Fixes gh-39.
2016-12-14 11:30:22 +01:00
Mark Paluch
d1a76b7ed4 Add plugin versions for deploy, dependency and gpg plugins.
Fixes gh-32.
2016-12-11 21:48:18 +01:00
Mark Paluch
41681b196c Upgrade to Vault 0.6.3.
Fixes gh-38.
2016-12-11 21:48:15 +01:00
Mark Paluch
4d337b1923 Add warnings to VaultResponseSupport.
Fixes gh-36.
2016-11-30 11:03:59 +01:00
Mark Paluch
a76ad22174 Setup tests for Spring 4 and 5 snapshots. 2016-11-09 13:04:56 +01:00
Mark Paluch
dd67ffa582 Disable netty-based tests.
See SPR-14744.

See gh-35.
2016-11-09 11:44:54 +01:00
Mark Paluch
1626e1cbd6 Upgrade to netty 4.1.6 and HttpCore 4.4.5.
See gh-35.
2016-11-09 11:24:27 +01:00
Mark Paluch
fc966cd607 Upgrade to Spring 4.3.4.
Fixes gh-35.
2016-11-09 11:21:16 +01:00
Mark Paluch
017ea87c1e Switch Readme links to snapshot documentation.
For now, there is no release version yet so readme points to snapshots.

Fixes gh-34.
2016-11-09 08:27:40 +01:00
Mark Paluch
62a9110160 Fix documentation indentation levels.
Fixes gh-12.
2016-11-09 08:26:04 +01:00
Mark Paluch
0a4c902ec7 Fix HashiCorp lettercasing.
Fixes gh-33.
2016-10-28 16:57:45 +02:00
Mark Paluch
4e507f209e Update readme.
Add quickstart, point pom.xml samples and usage samples.

See gh-31.
2016-10-28 12:34:28 +02:00
Mark Paluch
aa0c3638af Post-release cleanups.
See gh-31.
2016-10-28 12:09:30 +02:00
Mark Paluch
d6dea09311 [maven-release-plugin] prepare for next development iteration 2016-10-28 11:33:48 +02:00
Mark Paluch
2b2862960b [maven-release-plugin] prepare release 1.0.0.M1 2016-10-28 11:33:44 +02:00
Mark Paluch
b2e0496575 Prepare release.
See gh-31.
2016-10-28 11:30:22 +02:00
Mark Paluch
ddbfe047b2 Polishing.
Adopt milestone repository path.

Original pull request: gh-29.
2016-10-28 08:27:23 +02:00
Rob Winch
9cc82daefe Add SNAPSHOT repository to documentation.
Fixes gh-28

Original pull request: gh-29.
2016-10-28 08:27:08 +02:00
Mark Paluch
9ad5705ddf Polishing.
Add named anchors to sections. Adopt consistent indentation of 4 spaces.
2016-10-27 23:04:26 +02:00
Mark Paluch
23a95dd961 Expose Environment in AbstractVaultConfiguration.
Accessing Environment when providing a VaultPropertySource in bean bootstrapping requires a class to implement ApplicationContextAware. This is, because autowiring didn't happen yet and the exposed method provides Environment in the appropriate way.

See gh-26.
2016-10-27 16:52:07 +02:00
Mark Paluch
67f7119d22 Document how to externalize login credentials.
Fixes gh-26.
2016-10-27 16:02:44 +02:00
Mark Paluch
799ab8f8dd Fix String format in VaultEndpoint.toString.
Fixes gh-27.
2016-10-27 14:26:03 +02:00