Commit Graph

257 Commits

Author SHA1 Message Date
Mark Paluch
47d37b513b Upgrade to Spring Framework 5.0.4 snapshots.
See gh-194.
2018-02-19 11:28:17 +01:00
Mark Paluch
c3b2aee11d Add unit test for VaultPropertySource with profiles.
See gh-193.
2018-02-09 11:56:41 +01:00
Mark Paluch
78197da7ad Rename AwsIamAuthenticationOptions#serverName to serverId.
Align naming with Vault's serverId that sets Vault-AWS-IAM-Server-ID headers on AWS requests for consistency. serverName builder/getter is deprecated now.

Closes gh-191.
2018-02-06 11:10:35 +01:00
Mark Paluch
443fc03f8a Polishing 2018-01-31 16:07:53 +01:00
Mark Paluch
ef84690804 Upgrade to Vault 0.9.3.
Closes gh-192.
2018-01-31 16:07:48 +01:00
Mark Paluch
1e7c385eb2 Add Spring Vault guides to project site. 2018-01-25 10:02:14 +01:00
Mark Paluch
8f19127584 [maven-release-plugin] prepare for next development iteration 2018-01-25 09:48:54 +01:00
Mark Paluch
a94cbc15ae [maven-release-plugin] prepare release 2.0.0.RC2 2018-01-25 09:48:53 +01:00
Mark Paluch
11a346ef2b Polishing.
Adjust generics and wording in reactive Template API.
2018-01-25 09:44:34 +01:00
Mark Paluch
6791533e0e Update changelog.
See gh-190.
2018-01-25 09:34:43 +01:00
Mark Paluch
f07257464a Upgrade dependencies.
Spring Framework 5.0.1 -> 5.0.3
Spring Data Kay SR1 -> Kay SR3
Reactor Bismuth SR3 -> Bismuth SR5
httpclient 4.5.3 -> 4.5.5
httpcore 4.4.8 -> 4.4.9
netty 4.1.17 -> 4.1.20
Jackson 2.9.2 -> 2.9.4

Closes gh-189
2018-01-25 09:30:11 +01:00
Mark Paluch
35b5797c63 Polishing.
See gh-187
2018-01-23 10:49:11 +01:00
Mark Paluch
9ed2196068 Polishing.
See gh-187
2018-01-22 19:29:09 +01:00
Mark Paluch
28ff17d4f8 Add VaultBytesEncryptor and VaultBytesKeyGenerator.
We now provide a Spring Security integration for Vault transit-based BytesEncryptor and BytesKeyGenerator.

VaultOperations operations = …;
VaultBytesKeyGenerator generator = new VaultBytesKeyGenerator(operations);

byte[] key = generator.generateKey();

VaultTransitOperations transit = …;
VaultBytesEncryptor encryptor = new VaultBytesEncryptor(transit, "my-key-name");

byte[] ciphertext = encryptor.encrypt(plaintext);
byte[] decrypted = encryptor.decrypt(ciphertext);

Closes gh-187.
2018-01-22 12:11:05 +01:00
Mark Paluch
3e6fbe7581 Polishing.
Remove PropertyTransformerSupport in favor of default method in PropertyTransformer and refactor PropertyTransformer to functional interface.

See gh-169.
2018-01-17 15:36:30 +01:00
Mark Paluch
f4d05a4fb6 Retain JSON data type in PropertySource.
We now retain the JSON data type in the property source. This change requires property transformers to accept/produce a Map of String to Object whereas it was String to String before.

See gh-169.
2018-01-17 13:06:08 +01:00
Mark Paluch
49079a8a39 Remove lockfile 2018-01-17 12:46:00 +01:00
Mark Paluch
747a270604 Introduce reactive SessionManager.
We now provide a reactive, lifecycle-aware SessionManager using WebClient. ReactiveSessionManager is mirroring imperative SessionManager functionality. Using AbstractReactiveVaultConfiguration will register an adapter between ReactiveSessionManager and SessionManager to reuse the same token for reactive and imperative API use.

Closes gh-159.
2018-01-17 12:44:09 +01:00
Mark Paluch
b757ff04dc Polishing.
Introduce convenience factory method to convert a VaultToken into LoginToken.

See gh-159.
2018-01-17 12:44:09 +01:00
Mark Paluch
0710ae838a Extract common base class for LifecycleAwareSessionManager.
See gh-159.
2018-01-17 12:44:09 +01:00
Mark Paluch
ca874a6a31 Polishing.
Update license copyright years to 2018.
2018-01-16 14:35:51 +01:00
Mark Paluch
eacfcbfd5b Support Vault HA with redirects.
Fixes gh-184.
2018-01-16 14:34:49 +01:00
Mark Paluch
7244973bef Make RoleId and SecretId public.
AppRoleAuthenticationOptions.RoleId and AppRoleAuthenticationOptions.SecretId interfaces are now public.

Closes gh-179.
2017-11-23 12:07:44 +01:00
Mark Paluch
db195be8d8 Polishing.
Improve Javadoc.

See gh-177.
2017-11-16 12:19:55 +01:00
Mark Paluch
08063cc940 Return VaultResponse in ReactiveVaultOperations.write(…).
We now return the actual response when writing to a Vault path.

Closes gh-177.
2017-11-16 12:14:52 +01:00
Mark Paluch
29c4827d41 Polishing.
Guard tests to run with the appropriate Vault version.

See gh-158.
2017-11-15 20:16:34 +01:00
Mark Paluch
b74059038b Consider login token TTL after renewal.
We now consider the token TTL after renewal to calculate the next renewal time to prevent stale token use. Previously, we assumed the TTL to be the same as the initial TTL. This caused the token to render invalid for a period of time.

We now also check the TTL after renewal whether a subsequent renewal run makes sense for the token. If the remaining TTL exceeds the minimum valid TTL we drop the token and re-login upon the next session token request. We do not revoke the token explicitly to not interrupt processes that obtained the token during the renewal period. Since the remaining TTL is rather short the token will silently expire.

Closes gh-176.
2017-11-15 16:06:42 +01:00
Mark Paluch
b122d7510c [maven-release-plugin] prepare for next development iteration
See gh-173.
2017-11-15 08:22:50 +01:00
Mark Paluch
829e6ffc88 [maven-release-plugin] prepare release 2.0.0.RC1
See gh-173.
2017-11-15 08:22:50 +01:00
Mark Paluch
1010a9379f Polishing. 2017-11-15 08:22:47 +01:00
Mark Paluch
15af94ed96 Upgrade dependencies.
httpcore 4.4.7 -> 4.4.8
netty 4.1.16.Final -> 4.1.17.Final
Jackson 2.9.1 -> 2.9.2
Spring Data Kay GA -> Kay SR1
Reactor Bismuth GA -> Bismuth SR3

Closes gh-174
2017-11-15 08:22:38 +01:00
Mark Paluch
e0a5b92cb9 Update changelog.
See gh-173.
2017-11-15 08:09:16 +01:00
Mark Paluch
1ab9bcd5ac Upgrade to Vault 0.9.0.
Closes gh-172.
2017-11-14 22:08:47 +01:00
Mark Paluch
bba0a7f096 Polishing.
See gh-158.
2017-11-14 15:25:03 +01:00
Mark Paluch
a1cc3a7cb2 Provide AuthenticationSteps for token authentication with self-lookup.
Closes gh-158.
2017-11-14 15:23:28 +01:00
Mark Paluch
00b6a55689 Enhance VaultToken with self-lookup using LifecycleAwareSessionManager.
We now enhance VaultTokens obtained from a ClientAuthentication with a self-lookup to determine renewability and the remaining TTL. Self-lookup creates a LoginToken: We need to make sure to only revoke tokens that were initially a LoginToken supplied by the authentication and not LoginToken created by augmentation.

Closes gh-161.
2017-11-14 12:33:28 +01:00
Pedro Castineiras
96581a1ece Fix assert to verify the correct variable.
Original pull request: gh-170.
Closes: gh-170.
2017-11-14 11:28:39 +01:00
Mark Paluch
33397e7002 Adapt to TravisCI changes.
Closes gh-171.
2017-11-14 10:37:57 +01:00
Mark Paluch
ebd9d4da29 Move minikube start from start.sh to Travis build definition.
See gh-143, gh-166.
2017-11-02 13:03:33 +01:00
Mark Paluch
e5f96dd352 Polishing.
Rename Kube* authentication classes to Kubernetes*. Refactor KubernetesJwtSupplier to extend Supplier<String>. Load token file content eagerly. Extend Javadoc. Reformat code. Remove superfluous exception declarations in tests. Remove commented code from local_run_k8s.sh. Copy CA file from pod.

Reinstantiate AuthenticationStepsFactory for KubernetesAuthentication.

Add Kubernetes authentication to the reference documentation.

Original pull request: gh-166.
Related ticket: gh-143.
Closes gh-166.
2017-11-01 19:25:32 +01:00
Michal Budzyn
696d047760 Add authentication for Kubernetes Service Account Token
We now support authentication via Kubernetes using Service Account Tokens.

KubernetesAuthenticationOptions options = KubernetesAuthenticationOptions.builder().role("dev-role").build();
KubernetesAuthentication authentication = new KubernetesAuthentication(options, restTemplate);

Original pull request: gh-166.
Closes gh-143.
2017-11-01 19:25:22 +01:00
Mark Paluch
cfb84fe2b5 Encapsulate RoleId and SecretId modes for AppRole authentication.
Encapsulate RoleId and SecretId modes (pull, provided, wrapped, absent) with value objects. Adapt AppRoleAuthentication for imperative and AuthenticationSteps authentication. Split imperative and AuthenticationSteps tests.

Use the deprecated cubbyhole response unwrapping endpoint to unwrap responses.

Original pull request: gh-165.
Closes: gh-165.
2017-10-25 15:15:35 +02:00
Mark Paluch
e256add757 Polishing.
Add author tags. Reformat code.

Original pull request: gh-165.
2017-10-25 15:13:39 +02:00
christophetd
a69719d573 Add the ability to use response wrapping for AppRole secretId responses.
Original pull request: gh-165.
Closes: gh-164.
2017-10-25 15:13:12 +02:00
Mark Paluch
cec3d28faf Polishing.
Remove VaultTransitContext from Hmac and Signature types and requests. Introduce SignatureValidation to encapsulate validation outcome. Refactor request objects to pure value objects. Build request body inside of VaultTransitTemplate from request objects. Refactor request types to use Plaintext/Signature/Hmac types instead of String primitives.

Remove Hmac/Signature factory methods from bytes to keep Vault responses encapsulated.

Reorder field order/parameters in signatures/methods according their parameter significance. Extend Javadoc, add tests, add author tags. Guard tests to run against the appropriate Vault version.

Original pull request: gh-162.
Closes: gh-162.
2017-10-25 11:47:45 +02:00
Luander Ribeiro
10488de17a Extend Transit API to support Hashing and Signing Operations.
Transit API now has support to generate HMAC digests, signatures and verify signatures.

Plaintext plaintext = Plaintext.of("hello-world");

Signature signature = transitOperations.sign(keyName, plaintext);
boolean valid = transitOperations.verify(keyName, plaintext, signature);

Hmac hmac = transitOperations.getHmac(keyName, plaintext);
SignatureValidation validation = transitOperations.verify(keyName,
		VaultSignatureVerificationRequest.create(plaintext, hmac));

Original pull request: gh-162.
Closes: gh-148.
2017-10-25 11:46:32 +02:00
Mark Paluch
438b8db745 Upgrade to Spring Framework 5.0.1.
Closes gh-167.
2017-10-25 08:52:22 +02:00
Mark Paluch
bee76beff1 Polishing.
Fix javadoc links.

See gh-125.
2017-10-19 08:24:48 +02:00
Mark Paluch
b30d81fa43 Support CSR signing, certificate revocation and CRL retrieval.
We now support CSR signing, certificate revocation and CRL retrieval via VaultPkiTemplate.

Closes gh-125.
2017-10-19 08:18:20 +02:00
Mark Paluch
f46066382b Introduce VaultTokenLookupException.
Throw dedicated exception if token self-lookup fails to improve error handling.

Enhance javadoc.

See gh-161.
2017-10-18 21:12:29 +02:00