Compare commits
4 Commits
Author | SHA1 | Date | |
---|---|---|---|
5f9950e048 | |||
e2c439379e | |||
ce33d37396 | |||
bdf4fc4b83 |
14
.drone.yml
14
.drone.yml
@ -8,7 +8,7 @@ steps:
|
||||
- mvn -B clean compile
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
- main
|
||||
- develop
|
||||
- feature/*
|
||||
- fix/*
|
||||
@ -25,15 +25,15 @@ steps:
|
||||
- name: unit-integration-tests
|
||||
image: maven:3-jdk-11
|
||||
environment:
|
||||
VAULT_VERSION: 1.7.0
|
||||
VAULT_VERSION: 1.7.2
|
||||
commands:
|
||||
- curl -s -o vault_1.7.0_linux_amd64.zip https://releases.hashicorp.com/vault/1.7.0/vault_1.7.0_linux_amd64.zip
|
||||
- curl -s https://releases.hashicorp.com/vault/1.7.0/vault_1.7.0_SHA256SUMS | grep linux_amd64 | sha256sum -c
|
||||
- unzip vault_1.7.0_linux_amd64.zip
|
||||
- rm vault_1.7.0_linux_amd64.zip
|
||||
- curl -s -o vault_1.7.2_linux_amd64.zip https://releases.hashicorp.com/vault/1.7.2/vault_1.7.2_linux_amd64.zip
|
||||
- curl -s https://releases.hashicorp.com/vault/1.7.2/vault_1.7.2_SHA256SUMS | grep linux_amd64 | sha256sum -c
|
||||
- unzip vault_1.7.2_linux_amd64.zip
|
||||
- rm vault_1.7.2_linux_amd64.zip
|
||||
- mv vault /bin/
|
||||
- mvn -B resources:testResources compiler:testCompile surefire:test
|
||||
when:
|
||||
branch:
|
||||
- master
|
||||
- main
|
||||
- release/*
|
@ -7,7 +7,7 @@ addons:
|
||||
secure: "sM9OfX5jW764pn9cb2LSXArnXucKMws+eGeg5NnZxHRcGYt4hpBKLSregBSsBNzUoWVj0zNzPCpnh+UQvgxQzUerOqwEdjTBpy3SNPaxSn7UpoSg+Wz3aUmL9ugmx01b51/wMG4UCHEwTZt2tpgTPVtw8K6uSO78e0dSICCBHDnRcdQwOjMEQHIJJ/qHVRwuy/MzLCAP3W1JPZlsphZg9QsFyhB4hW97dE90joZezfocQIv2xI/r6k+BLz0pY6MxYCul0RiDumaiaej0CPvEJI/uSu//BAQjUdHw+mQgnKUYIbrn2ONOviwNfwdr94JyoZEN2B6zASUmNLjPf4AbIojDeyS+CrpQpm17EVm/Qk/Ds+Xra4PPPIcsZhiWzV0KoDUz9xLfXuRJ526VT5tDPiaeI7oETf0+8l+JIS1b399FyqHi7smzjpvC6GuKflQrbuHK4MuKzDh7WTHiqokGG4SS0wOQIaaHB3dfdwwQzPh6IM24e8CETxh3DjMeqUTU4DWmv5po55jZ934TtxVQvVN78bTG9O0zS9u+JmRY04OZ+OaXuFam6MfMUFQi0EPZzdGul/oWSibGUu3bNfVEBp60CnJwYNM/dKG6U7pJthLHvSwiQFOdKzHZ+l1jZJ4gPaXaIGqpwqVGr28ntqA/El1rytPixr2driE6bYMt5jw="
|
||||
|
||||
env:
|
||||
- PATH=$PATH:. VAULT_VERSION=1.7.0 ANALYSIS=false
|
||||
- PATH=$PATH:. VAULT_VERSION=1.7.2 ANALYSIS=false
|
||||
|
||||
cache:
|
||||
directories:
|
||||
@ -18,12 +18,12 @@ jobs:
|
||||
include:
|
||||
- jdk: openjdk8
|
||||
- jdk: openjdk11
|
||||
env: PATH=$PATH:. VAULT_VERSION=1.7.0 ANALYSIS=true
|
||||
env: PATH=$PATH:. VAULT_VERSION=1.7.2 ANALYSIS=true
|
||||
- jdk: openjdk16
|
||||
|
||||
before_script:
|
||||
- |
|
||||
if [[ "$TRAVIS_BRANCH" =~ ^master|(release\/.+)$ ]]; then
|
||||
if [[ "$TRAVIS_BRANCH" =~ ^main|(release\/.+)$ ]]; then
|
||||
wget -q https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_linux_amd64.zip
|
||||
wget -q -O - https://releases.hashicorp.com/vault/${VAULT_VERSION}/vault_${VAULT_VERSION}_SHA256SUMS | grep linux_amd64 | sha256sum -c
|
||||
unzip vault_${VAULT_VERSION}_linux_amd64.zip
|
||||
@ -33,7 +33,7 @@ before_script:
|
||||
script:
|
||||
- mvn -B clean compile
|
||||
- |
|
||||
if [[ "$TRAVIS_BRANCH" =~ ^master|(release\/.+)$ ]]; then
|
||||
if [[ "$TRAVIS_BRANCH" =~ ^main|(release\/.+)$ ]]; then
|
||||
mvn -B resources:testResources compiler:testCompile surefire:test -P coverage
|
||||
else
|
||||
mvn -B resources:testResources compiler:testCompile surefire:test -P coverage -P offline-tests
|
||||
|
11
CHANGELOG.md
11
CHANGELOG.md
@ -1,3 +1,14 @@
|
||||
## 0.9.4 (2021-06-06)
|
||||
|
||||
### Deprecations
|
||||
* `AppRole.Builder#wit0hTokenPeriod()` is deprecated in favor of `#withTokenPeriod()` (#49)
|
||||
|
||||
### Improvements
|
||||
* Minor dependency updates
|
||||
|
||||
### Test
|
||||
* Tested against Vault 1.7.2
|
||||
|
||||
## 0.9.3 (2021-04-02)
|
||||
|
||||
### Improvements
|
||||
|
10
README.md
10
README.md
@ -1,11 +1,11 @@
|
||||
# Java Vault Connector
|
||||
|
||||
[](https://travis-ci.com/stklcode/jvaultconnector)
|
||||
[](https://travis-ci.com/stklcode/jvaultconnector)
|
||||
[](https://sonarcloud.io/dashboard?id=de.stklcode.jvault%3Ajvault-connector)
|
||||
[](https://github.com/stklcode/jvaultconnector/blob/master/LICENSE.txt)
|
||||
[](https://github.com/stklcode/jvaultconnector/blob/main/LICENSE.txt)
|
||||
[](https://search.maven.org/#search%7Cga%7C1%7Cg%3A%22de.stklcode.jvault%22%20AND%20a%3A%22jvault-connector%22)
|
||||
|
||||

|
||||

|
||||
|
||||
Java Vault Connector is a connector library for [Vault](https://www.vaultproject.io) by [Hashicorp](https://www.hashicorp.com) written in Java. The connector allows simple usage of Vault's secret store in own applications.
|
||||
|
||||
@ -32,7 +32,7 @@ Java Vault Connector is a connector library for [Vault](https://www.vaultproject
|
||||
* SQL secret handling
|
||||
* KV v1 and v2 support
|
||||
* Connector Factory with builder pattern
|
||||
* Tested against Vault 1.7.0
|
||||
* Tested against Vault 1.7.2
|
||||
|
||||
|
||||
## Maven Artifact
|
||||
@ -40,7 +40,7 @@ Java Vault Connector is a connector library for [Vault](https://www.vaultproject
|
||||
<dependency>
|
||||
<groupId>de.stklcode.jvault</groupId>
|
||||
<artifactId>jvault-connector</artifactId>
|
||||
<version>0.9.3</version>
|
||||
<version>0.9.4</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
|
25
pom.xml
25
pom.xml
@ -4,7 +4,7 @@
|
||||
|
||||
<groupId>de.stklcode.jvault</groupId>
|
||||
<artifactId>jvault-connector</artifactId>
|
||||
<version>0.9.3</version>
|
||||
<version>0.9.4</version>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
|
||||
@ -113,13 +113,13 @@
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>2.12.2</version>
|
||||
<version>2.12.3</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
<version>5.7.1</version>
|
||||
<version>5.7.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -131,13 +131,13 @@
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<version>3.11.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-inline</artifactId>
|
||||
<version>3.8.0</version>
|
||||
<version>3.11.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -149,7 +149,7 @@
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.8.0</version>
|
||||
<version>2.9.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
@ -159,7 +159,7 @@
|
||||
<dependency>
|
||||
<groupId>org.sonarsource.scanner.maven</groupId>
|
||||
<artifactId>sonar-maven-plugin</artifactId>
|
||||
<version>3.8.0.2131</version>
|
||||
<version>3.9.0.2155</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
@ -224,7 +224,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-gpg-plugin</artifactId>
|
||||
<version>1.6</version>
|
||||
<version>3.0.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>sign-artifacts</id>
|
||||
@ -249,17 +249,16 @@
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<version>0.8.6</version>
|
||||
<version>0.8.7</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>prepare-agent</id>
|
||||
<id>default-prepare-agent</id>
|
||||
<goals>
|
||||
<goal>prepare-agent</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>report</id>
|
||||
<phase>prepare-package</phase>
|
||||
<id>default-report</id>
|
||||
<goals>
|
||||
<goal>report</goal>
|
||||
</goals>
|
||||
@ -294,7 +293,7 @@
|
||||
<plugin>
|
||||
<groupId>org.owasp</groupId>
|
||||
<artifactId>dependency-check-maven</artifactId>
|
||||
<version>6.1.5</version>
|
||||
<version>6.2.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
|
@ -703,21 +703,34 @@ public final class AppRole {
|
||||
* @return self
|
||||
* @since 0.9
|
||||
*/
|
||||
public Builder wit0hTokenPeriod(final Integer tokenPeriod) {
|
||||
public Builder withTokenPeriod(final Integer tokenPeriod) {
|
||||
this.tokenPeriod = tokenPeriod;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set renewal period for generated token in seconds.
|
||||
*
|
||||
* @param tokenPeriod period in seconds
|
||||
* @return self
|
||||
* @since 0.9
|
||||
* @deprecated Use {@link #withTokenPeriod(Integer)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public Builder wit0hTokenPeriod(final Integer tokenPeriod) {
|
||||
return withTokenPeriod(tokenPeriod);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set renewal period for generated token in seconds.
|
||||
*
|
||||
* @param period period in seconds
|
||||
* @return self
|
||||
* @deprecated Use {@link #wit0hTokenPeriod(Integer)} instead.
|
||||
* @deprecated Use {@link #withTokenPeriod(Integer)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public Builder withPeriod(final Integer period) {
|
||||
return wit0hTokenPeriod(period);
|
||||
return withTokenPeriod(period);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -308,21 +308,34 @@ public final class AppRoleBuilder {
|
||||
* @return self
|
||||
* @since 0.9
|
||||
*/
|
||||
public AppRoleBuilder wit0hTokenPeriod(final Integer tokenPeriod) {
|
||||
public AppRoleBuilder withTokenPeriod(final Integer tokenPeriod) {
|
||||
this.tokenPeriod = tokenPeriod;
|
||||
return this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set renewal period for generated token in seconds.
|
||||
*
|
||||
* @param tokenPeriod period in seconds
|
||||
* @return self
|
||||
* @since 0.9
|
||||
* @deprecated Use {@link #withTokenPeriod(Integer)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public AppRoleBuilder wit0hTokenPeriod(final Integer tokenPeriod) {
|
||||
return withTokenPeriod(tokenPeriod);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set renewal period for generated token in seconds.
|
||||
*
|
||||
* @param period period in seconds
|
||||
* @return self
|
||||
* @deprecated Use {@link #wit0hTokenPeriod(Integer)} instead.
|
||||
* @deprecated Use {@link #withTokenPeriod(Integer)} instead.
|
||||
*/
|
||||
@Deprecated
|
||||
public AppRoleBuilder withPeriod(final Integer period) {
|
||||
return wit0hTokenPeriod(period);
|
||||
return withTokenPeriod(period);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -54,7 +54,7 @@ import static org.junit.jupiter.api.Assumptions.assumeTrue;
|
||||
*/
|
||||
@Tag("online")
|
||||
class HTTPVaultConnectorTest {
|
||||
private static String VAULT_VERSION = "1.7.0"; // the vault version this test is supposed to run against
|
||||
private static String VAULT_VERSION = "1.7.2"; // the vault version this test is supposed to run against
|
||||
private static final String KEY1 = "E38bkCm0VhUvpdCKGQpcohhD9XmcHJ/2hreOSY019Lho";
|
||||
private static final String KEY2 = "O5OHwDleY3IiPdgw61cgHlhsrEm6tVJkrxhF6QAnILd1";
|
||||
private static final String KEY3 = "mw7Bm3nbt/UWa/juDjjL2EPQ04kiJ0saC5JEXwJvXYsB";
|
||||
@ -771,7 +771,7 @@ class HTTPVaultConnectorTest {
|
||||
|
||||
/* Update role model with custom flags */
|
||||
AppRole role2 = AppRole.builder(roleName)
|
||||
.wit0hTokenPeriod(321)
|
||||
.withTokenPeriod(321)
|
||||
.build();
|
||||
|
||||
/* Create role */
|
||||
|
@ -138,7 +138,7 @@ class AppRoleBuilderTest {
|
||||
.withTokenExplicitMaxTtl(TOKEN_EXPLICIT_MAX_TTL)
|
||||
.withTokenNoDefaultPolicy(TOKEN_NO_DEFAULT_POLICY)
|
||||
.withTokenNumUses(TOKEN_NUM_USES)
|
||||
.wit0hTokenPeriod(TOKEN_PERIOD)
|
||||
.withTokenPeriod(TOKEN_PERIOD)
|
||||
.withTokenType(TOKEN_TYPE)
|
||||
.build();
|
||||
assertThat(role.getName(), is(NAME));
|
||||
@ -183,7 +183,7 @@ class AppRoleBuilderTest {
|
||||
.withTokenExplicitMaxTtl(TOKEN_EXPLICIT_MAX_TTL)
|
||||
.withTokenNoDefaultPolicy(TOKEN_NO_DEFAULT_POLICY)
|
||||
.withTokenNumUses(TOKEN_NUM_USES)
|
||||
.wit0hTokenPeriod(TOKEN_PERIOD)
|
||||
.withTokenPeriod(TOKEN_PERIOD)
|
||||
.withTokenType(TOKEN_TYPE)
|
||||
.build();
|
||||
assertThat(role.getName(), is(NAME));
|
||||
|
Reference in New Issue
Block a user