Compare commits
33 Commits
Author | SHA1 | Date | |
---|---|---|---|
622b13f508
|
|||
0f0b008f2f
|
|||
34322b389c
|
|||
7a813cdda3
|
|||
d9dbdad75b
|
|||
c97308fb4f
|
|||
fea27910bb
|
|||
4d79ef6634
|
|||
402567a0db
|
|||
00422ea00c
|
|||
01e1c6e8c7
|
|||
e322a74818
|
|||
f9fe57230f
|
|||
e0c33b51e4
|
|||
5e6dcc64cd
|
|||
70b7338f3e
|
|||
489e450dc8
|
|||
909eab762c
|
|||
abba4dff93
|
|||
712fab04e1
|
|||
39ac32a2f6
|
|||
31e20385d4
|
|||
30996e9fc9
|
|||
81decd1a4c
|
|||
adedc277fa
|
|||
0c56813121
|
|||
2412a291f6
|
|||
b5ed7704e3
|
|||
a1626aa1c7
|
|||
3fb8454711
|
|||
ecf18881b9
|
|||
69287f7196
|
|||
4b1b4399e1
|
31
.drone.yml
31
.drone.yml
@ -3,7 +3,7 @@ name: default
|
||||
|
||||
steps:
|
||||
- name: compile
|
||||
image: maven:3-jdk-11
|
||||
image: maven:3-eclipse-temurin-17
|
||||
commands:
|
||||
- mvn -B clean compile
|
||||
when:
|
||||
@ -14,7 +14,7 @@ steps:
|
||||
- fix/*
|
||||
- release/*
|
||||
- name: unit-tests
|
||||
image: maven:3-jdk-11
|
||||
image: maven:3-eclipse-temurin-17
|
||||
commands:
|
||||
- mvn -B test
|
||||
when:
|
||||
@ -22,16 +22,27 @@ steps:
|
||||
- develop
|
||||
- feature/*
|
||||
- fix/*
|
||||
- name: unit-integration-tests
|
||||
image: maven:3-jdk-11
|
||||
- name: setup-vault
|
||||
image: alpine:latest
|
||||
environment:
|
||||
VAULT_VERSION: 1.10.1
|
||||
VAULT_VERSION: 1.13.3
|
||||
commands:
|
||||
- curl -s -o vault_1.10.1_linux_amd64.zip https://releases.hashicorp.com/vault/1.10.1/vault_1.10.1_linux_amd64.zip
|
||||
- curl -s https://releases.hashicorp.com/vault/1.10.1/vault_1.10.1_SHA256SUMS | grep linux_amd64 | sha256sum -c
|
||||
- unzip vault_1.10.1_linux_amd64.zip
|
||||
- rm vault_1.10.1_linux_amd64.zip
|
||||
- mv vault /bin/
|
||||
- wget -q -O vault_$${VAULT_VERSION}_linux_amd64.zip 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
|
||||
- rm vault_$${VAULT_VERSION}_linux_amd64.zip
|
||||
- mkdir -p .bin
|
||||
- mv vault .bin/
|
||||
when:
|
||||
branch:
|
||||
- main
|
||||
- release/*
|
||||
- name: unit-integration-tests
|
||||
image: maven:3-eclipse-temurin-17
|
||||
environment:
|
||||
VAULT_VERSION: 1.13.3
|
||||
commands:
|
||||
- export PATH=.bin:$${PATH}
|
||||
- mvn -B -P integration-test verify
|
||||
when:
|
||||
branch:
|
||||
|
15
.github/workflows/ci.yml
vendored
15
.github/workflows/ci.yml
vendored
@ -5,19 +5,19 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
matrix:
|
||||
jdk: [ 11, 17 ]
|
||||
vault: [ '1.10.1' ]
|
||||
jdk: [ 11, 17, 20 ]
|
||||
vault: [ '1.2.0', '1.11.11', '1.13.3' ]
|
||||
include:
|
||||
- jdk: 11
|
||||
vault: '1.10.1'
|
||||
- jdk: 17
|
||||
vault: '1.11.11'
|
||||
analysis: true
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v2
|
||||
uses: actions/checkout@v3
|
||||
with:
|
||||
fetch-depth: 0
|
||||
- name: Set up Java
|
||||
uses: actions/setup-java@v2
|
||||
uses: actions/setup-java@v3
|
||||
with:
|
||||
java-version: ${{ matrix.jdk }}
|
||||
distribution: 'temurin'
|
||||
@ -40,12 +40,11 @@ jobs:
|
||||
if: github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/heads/release/')
|
||||
run: mvn -B -P coverage verify
|
||||
- name: Analysis
|
||||
if: matrix.analysis && github.event_name == 'push'
|
||||
if: matrix.analysis
|
||||
run: >
|
||||
mvn -B sonar:sonar
|
||||
-Dsonar.host.url=https://sonarcloud.io
|
||||
-Dsonar.organization=stklcode-github
|
||||
-Dsonar.login=$SONAR_TOKEN
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
|
||||
|
21
.gitignore
vendored
21
.gitignore
vendored
@ -1,5 +1,16 @@
|
||||
/target/
|
||||
/*.iml
|
||||
/.idea/
|
||||
/*.project
|
||||
*~
|
||||
target/
|
||||
pom.xml.tag
|
||||
pom.xml.releaseBackup
|
||||
pom.xml.versionsBackup
|
||||
pom.xml.next
|
||||
release.properties
|
||||
dependency-reduced-pom.xml
|
||||
buildNumber.properties
|
||||
.mvn/timing.properties
|
||||
|
||||
.idea
|
||||
*.iml
|
||||
|
||||
.bin
|
||||
|
||||
*~
|
||||
|
51
CHANGELOG.md
51
CHANGELOG.md
@ -1,3 +1,54 @@
|
||||
## 1.1.4 (2023-06-15)
|
||||
|
||||
### Fix
|
||||
* Use `[+-]XX:XX` notation for timezone in date/time parsing
|
||||
|
||||
### Improvements
|
||||
* Use explicit UTF-8 encoding for parsing responses
|
||||
|
||||
### Dependencies
|
||||
* Updated Jackson to 2.15.2
|
||||
|
||||
### Test
|
||||
* Tested against Vault 1.2.0 to 1.13.3
|
||||
|
||||
|
||||
## 1.1.3 (2023-01-31)
|
||||
|
||||
### Deprecations
|
||||
* AppID components (deprecated since 0.4) are marked for removal with the next major release
|
||||
|
||||
### Dependencies
|
||||
* Updated Jackson to 2.14.2
|
||||
|
||||
### Improvements
|
||||
* Minor internal refactoring
|
||||
|
||||
### Test
|
||||
* Tested against Vault 1.2.0 to 1.12.2
|
||||
|
||||
|
||||
## 1.1.2 (2022-10-26)
|
||||
|
||||
### Dependencies
|
||||
* Updated Jackson to 2.13.4.2
|
||||
|
||||
### Test
|
||||
* Tested against Vault 1.2.0 to 1.12.0
|
||||
* Disable AppID tests for Vault 1.12 and above (auth method removed)
|
||||
* Tested with Java 19
|
||||
|
||||
|
||||
## 1.1.1 (2022-08-29)
|
||||
|
||||
### Dependencies
|
||||
* Updated Jackson to 2.13.3
|
||||
|
||||
### Test
|
||||
* Tested against Vault 1.11.2
|
||||
* Tested with Java 18
|
||||
|
||||
|
||||
## 1.1.0 (2022-04-24)
|
||||
|
||||
### Fix
|
||||
|
@ -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.10.1
|
||||
* Tested against Vault 1.2 to 1.13
|
||||
|
||||
|
||||
## 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>1.1.0</version>
|
||||
<version>1.1.4</version>
|
||||
</dependency>
|
||||
```
|
||||
|
||||
|
102
pom.xml
102
pom.xml
@ -4,7 +4,7 @@
|
||||
|
||||
<groupId>de.stklcode.jvault</groupId>
|
||||
<artifactId>jvault-connector</artifactId>
|
||||
<version>1.1.0</version>
|
||||
<version>1.1.4</version>
|
||||
|
||||
<packaging>jar</packaging>
|
||||
|
||||
@ -46,19 +46,17 @@
|
||||
</issueManagement>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.10.1</version>
|
||||
<configuration>
|
||||
<source>11</source>
|
||||
<target>11</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
</plugins>
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>3.11.0</version>
|
||||
<configuration>
|
||||
<source>11</source>
|
||||
<target>11</target>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-clean-plugin</artifactId>
|
||||
@ -66,13 +64,29 @@
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.2.0</version>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>3.1.1</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-failsafe-plugin</artifactId>
|
||||
<version>3.1.2</version>
|
||||
<configuration>
|
||||
<argLine>
|
||||
@{argLine}
|
||||
--add-opens de.stklcode.jvault.connector/de.stklcode.jvault.connector.test=com.fasterxml.jackson.databind
|
||||
</argLine>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-install-plugin</artifactId>
|
||||
<version>3.1.1</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-jar-plugin</artifactId>
|
||||
<version>3.2.2</version>
|
||||
<version>3.3.0</version>
|
||||
<configuration>
|
||||
<archive>
|
||||
<manifestEntries>
|
||||
@ -83,18 +97,18 @@
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-install-plugin</artifactId>
|
||||
<version>2.5.2</version>
|
||||
<artifactId>maven-resources-plugin</artifactId>
|
||||
<version>3.3.1</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-deploy-plugin</artifactId>
|
||||
<version>2.8.2</version>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>3.3.0</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-surefire-plugin</artifactId>
|
||||
<version>2.22.2</version>
|
||||
<version>3.1.2</version>
|
||||
<configuration>
|
||||
<argLine>
|
||||
@{argLine}
|
||||
@ -108,6 +122,16 @@
|
||||
</argLine>
|
||||
</configuration>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<version>0.8.10</version>
|
||||
</plugin>
|
||||
<plugin>
|
||||
<groupId>org.sonarsource.scanner.maven</groupId>
|
||||
<artifactId>sonar-maven-plugin</artifactId>
|
||||
<version>3.9.1.2184</version>
|
||||
</plugin>
|
||||
</plugins>
|
||||
</pluginManagement>
|
||||
</build>
|
||||
@ -116,19 +140,19 @@
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-databind</artifactId>
|
||||
<version>2.13.2.2</version>
|
||||
<version>2.15.2</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.junit.jupiter</groupId>
|
||||
<artifactId>junit-jupiter</artifactId>
|
||||
<version>5.8.2</version>
|
||||
<version>5.9.3</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.mockito</groupId>
|
||||
<artifactId>mockito-core</artifactId>
|
||||
<version>4.5.1</version>
|
||||
<version>5.3.1</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
@ -140,34 +164,29 @@
|
||||
<dependency>
|
||||
<groupId>com.github.tomakehurst</groupId>
|
||||
<artifactId>wiremock-jre8</artifactId>
|
||||
<version>2.33.1</version>
|
||||
<version>2.35.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>commons-io</groupId>
|
||||
<artifactId>commons-io</artifactId>
|
||||
<version>2.11.0</version>
|
||||
<version>2.13.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>nl.jqno.equalsverifier</groupId>
|
||||
<artifactId>equalsverifier</artifactId>
|
||||
<version>3.10</version>
|
||||
<version>3.14.2</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.awaitility</groupId>
|
||||
<artifactId>awaitility</artifactId>
|
||||
<version>4.2.0</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.sonarsource.scanner.maven</groupId>
|
||||
<artifactId>sonar-maven-plugin</artifactId>
|
||||
<version>3.9.1.2184</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>sources</id>
|
||||
@ -179,7 +198,6 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-source-plugin</artifactId>
|
||||
<version>3.2.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>attach-sources</id>
|
||||
@ -203,7 +221,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-javadoc-plugin</artifactId>
|
||||
<version>3.4.0</version>
|
||||
<version>3.5.0</version>
|
||||
<configuration>
|
||||
<source>11</source>
|
||||
</configuration>
|
||||
@ -227,7 +245,7 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-gpg-plugin</artifactId>
|
||||
<version>3.0.1</version>
|
||||
<version>3.1.0</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>sign-artifacts</id>
|
||||
@ -252,7 +270,6 @@
|
||||
<plugin>
|
||||
<groupId>org.jacoco</groupId>
|
||||
<artifactId>jacoco-maven-plugin</artifactId>
|
||||
<version>0.8.8</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>default-prepare-agent</id>
|
||||
@ -279,7 +296,6 @@
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-failsafe-plugin</artifactId>
|
||||
<version>2.22.2</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
@ -300,7 +316,7 @@
|
||||
<plugin>
|
||||
<groupId>org.owasp</groupId>
|
||||
<artifactId>dependency-check-maven</artifactId>
|
||||
<version>7.1.0</version>
|
||||
<version>8.2.1</version>
|
||||
<executions>
|
||||
<execution>
|
||||
<goals>
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -41,24 +41,30 @@ import static java.util.Collections.singletonMap;
|
||||
* @since 0.1
|
||||
*/
|
||||
public class HTTPVaultConnector implements VaultConnector {
|
||||
private static final String PATH_SEAL_STATUS = "sys/seal-status";
|
||||
private static final String PATH_SEAL = "sys/seal";
|
||||
private static final String PATH_UNSEAL = "sys/unseal";
|
||||
private static final String PATH_RENEW = "sys/leases/renew";
|
||||
private static final String PATH_AUTH = "sys/auth";
|
||||
private static final String PATH_TOKEN = "auth/token";
|
||||
private static final String PATH_SYS = "sys";
|
||||
private static final String PATH_SYS_AUTH = PATH_SYS + "/auth";
|
||||
private static final String PATH_RENEW = PATH_SYS + "/leases/renew";
|
||||
private static final String PATH_REVOKE = PATH_SYS + "/leases/revoke/";
|
||||
private static final String PATH_HEALTH = PATH_SYS + "/health";
|
||||
private static final String PATH_SEAL = PATH_SYS + "/seal";
|
||||
private static final String PATH_SEAL_STATUS = PATH_SYS + "/seal-status";
|
||||
private static final String PATH_UNSEAL = PATH_SYS + "/unseal";
|
||||
|
||||
|
||||
private static final String PATH_AUTH = "auth";
|
||||
private static final String PATH_AUTH_TOKEN = PATH_AUTH + "/token";
|
||||
private static final String PATH_LOOKUP = "/lookup";
|
||||
private static final String PATH_CREATE = "/create";
|
||||
private static final String PATH_ROLES = "/roles";
|
||||
private static final String PATH_CREATE_ORPHAN = "/create-orphan";
|
||||
private static final String PATH_AUTH_USERPASS = "auth/userpass/login/";
|
||||
private static final String PATH_AUTH_APPID = "auth/app-id/";
|
||||
private static final String PATH_AUTH_APPROLE = "auth/approle/";
|
||||
private static final String PATH_AUTH_APPROLE_ROLE = "auth/approle/role/%s%s";
|
||||
private static final String PATH_REVOKE = "sys/leases/revoke/";
|
||||
private static final String PATH_HEALTH = "sys/health";
|
||||
private static final String PATH_AUTH_USERPASS = PATH_AUTH + "/userpass/login/";
|
||||
private static final String PATH_AUTH_APPID = PATH_AUTH + "/app-id";
|
||||
private static final String PATH_AUTH_APPROLE = PATH_AUTH + "/approle";
|
||||
private static final String PATH_AUTH_APPROLE_ROLE = PATH_AUTH_APPROLE + "/role/%s%s";
|
||||
|
||||
private static final String PATH_DATA = "/data/";
|
||||
private static final String PATH_METADATA = "/metadata/";
|
||||
private static final String PATH_LOGIN = "/login";
|
||||
private static final String PATH_DELETE = "/delete/";
|
||||
private static final String PATH_UNDELETE = "/undelete/";
|
||||
private static final String PATH_DESTROY = "/destroy/";
|
||||
@ -139,11 +145,10 @@ public class HTTPVaultConnector implements VaultConnector {
|
||||
|
||||
@Override
|
||||
public final SealResponse unseal(final String key, final Boolean reset) throws VaultConnectorException {
|
||||
Map<String, String> param = new HashMap<>(2, 1);
|
||||
param.put("key", key);
|
||||
if (reset != null) {
|
||||
param.put("reset", reset.toString());
|
||||
}
|
||||
Map<String, String> param = mapOfStrings(
|
||||
"key", key,
|
||||
"reset", reset
|
||||
);
|
||||
|
||||
return request.put(PATH_UNSEAL, param, token, SealResponse.class);
|
||||
}
|
||||
@ -172,7 +177,7 @@ public class HTTPVaultConnector implements VaultConnector {
|
||||
@Override
|
||||
public final List<AuthBackend> getAuthBackends() throws VaultConnectorException {
|
||||
/* Issue request and parse response */
|
||||
AuthMethodsResponse amr = request.get(PATH_AUTH, emptyMap(), token, AuthMethodsResponse.class);
|
||||
AuthMethodsResponse amr = request.get(PATH_SYS_AUTH, emptyMap(), token, AuthMethodsResponse.class);
|
||||
|
||||
return amr.getSupportedMethods().values().stream().map(AuthMethod::getType).collect(Collectors.toList());
|
||||
}
|
||||
@ -182,7 +187,7 @@ public class HTTPVaultConnector implements VaultConnector {
|
||||
/* set token */
|
||||
this.token = token;
|
||||
this.tokenTTL = 0;
|
||||
TokenResponse res = request.post(PATH_TOKEN + PATH_LOOKUP, emptyMap(), token, TokenResponse.class);
|
||||
TokenResponse res = request.post(PATH_AUTH_TOKEN + PATH_LOOKUP, emptyMap(), token, TokenResponse.class);
|
||||
authorized = true;
|
||||
|
||||
return res;
|
||||
@ -196,10 +201,10 @@ public class HTTPVaultConnector implements VaultConnector {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated(since = "0.4", forRemoval = false)
|
||||
@Deprecated(since = "0.4", forRemoval = true)
|
||||
public final AuthResponse authAppId(final String appID, final String userID) throws VaultConnectorException {
|
||||
return queryAuth(
|
||||
PATH_AUTH_APPID + "login",
|
||||
PATH_AUTH_APPID + PATH_LOGIN,
|
||||
Map.of(
|
||||
"app_id", appID,
|
||||
"user_id", userID
|
||||
@ -209,12 +214,11 @@ public class HTTPVaultConnector implements VaultConnector {
|
||||
|
||||
@Override
|
||||
public final AuthResponse authAppRole(final String roleID, final String secretID) throws VaultConnectorException {
|
||||
final Map<String, String> payload = new HashMap<>(2, 1);
|
||||
payload.put("role_id", roleID);
|
||||
if (secretID != null) {
|
||||
payload.put("secret_id", secretID);
|
||||
}
|
||||
return queryAuth(PATH_AUTH_APPROLE + "login", payload);
|
||||
final Map<String, String> payload = mapOfStrings(
|
||||
"role_id", roleID,
|
||||
"secret_id", secretID
|
||||
);
|
||||
return queryAuth(PATH_AUTH_APPROLE + PATH_LOGIN, payload);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -238,14 +242,14 @@ public class HTTPVaultConnector implements VaultConnector {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated(since = "0.4", forRemoval = false)
|
||||
@Deprecated(since = "0.4", forRemoval = true)
|
||||
public final boolean registerAppId(final String appID, final String policy, final String displayName)
|
||||
throws VaultConnectorException {
|
||||
requireAuth();
|
||||
|
||||
/* Issue request and expect code 204 with empty response */
|
||||
request.postWithoutResponse(
|
||||
PATH_AUTH_APPID + "map/app-id/" + appID,
|
||||
PATH_AUTH_APPID + "/map/app-id/" + appID,
|
||||
Map.of(
|
||||
"value", policy,
|
||||
"display_name", displayName
|
||||
@ -257,13 +261,13 @@ public class HTTPVaultConnector implements VaultConnector {
|
||||
}
|
||||
|
||||
@Override
|
||||
@Deprecated(since = "0.4", forRemoval = false)
|
||||
@Deprecated(since = "0.4", forRemoval = true)
|
||||
public final boolean registerUserId(final String appID, final String userID) throws VaultConnectorException {
|
||||
requireAuth();
|
||||
|
||||
/* Issue request and expect code 204 with empty response */
|
||||
request.postWithoutResponse(
|
||||
PATH_AUTH_APPID + "map/user-id/" + userID,
|
||||
PATH_AUTH_APPID + "/map/user-id/" + userID,
|
||||
singletonMap("value", appID),
|
||||
token
|
||||
);
|
||||
@ -384,7 +388,7 @@ public class HTTPVaultConnector implements VaultConnector {
|
||||
requireAuth();
|
||||
|
||||
SecretListResponse secrets = request.get(
|
||||
PATH_AUTH_APPROLE + "role?list=true",
|
||||
PATH_AUTH_APPROLE + "/role?list=true",
|
||||
emptyMap(),
|
||||
token,
|
||||
SecretListResponse.class
|
||||
@ -418,10 +422,7 @@ public class HTTPVaultConnector implements VaultConnector {
|
||||
public final SecretResponse readSecretVersion(final String mount, final String key, final Integer version) throws VaultConnectorException {
|
||||
requireAuth();
|
||||
/* Request HTTP response and parse secret metadata */
|
||||
Map<String, String> args = new HashMap<>(1, 1);
|
||||
if (version != null) {
|
||||
args.put("version", version.toString());
|
||||
}
|
||||
Map<String, String> args = mapOfStrings("version", version);
|
||||
|
||||
return request.get(mount + PATH_DATA + key, args, token, MetaSecretResponse.class);
|
||||
}
|
||||
@ -438,11 +439,10 @@ public class HTTPVaultConnector implements VaultConnector {
|
||||
public void updateSecretMetadata(final String mount, final String key, final Integer maxVersions, final boolean casRequired) throws VaultConnectorException {
|
||||
requireAuth();
|
||||
|
||||
Map<String, Object> payload = new HashMap<>(2, 1);
|
||||
if (maxVersions != null) {
|
||||
payload.put("max_versions", maxVersions);
|
||||
}
|
||||
payload.put("cas_required", casRequired);
|
||||
Map<String, Object> payload = mapOf(
|
||||
"max_versions", maxVersions,
|
||||
"cas_required", casRequired
|
||||
);
|
||||
|
||||
write(mount + PATH_METADATA + key, payload);
|
||||
}
|
||||
@ -456,12 +456,7 @@ public class HTTPVaultConnector implements VaultConnector {
|
||||
}
|
||||
|
||||
// Add CAS value to options map if present.
|
||||
Map<String, Object> options;
|
||||
if (cas != null) {
|
||||
options = singletonMap("cas", cas);
|
||||
} else {
|
||||
options = emptyMap();
|
||||
}
|
||||
Map<String, Object> options = mapOf("cas", cas);
|
||||
|
||||
/* Issue request and parse metadata response */
|
||||
return request.post(
|
||||
@ -572,11 +567,10 @@ public class HTTPVaultConnector implements VaultConnector {
|
||||
public final SecretResponse renew(final String leaseID, final Integer increment) throws VaultConnectorException {
|
||||
requireAuth();
|
||||
|
||||
Map<String, String> payload = new HashMap<>(2, 1);
|
||||
payload.put("lease_id", leaseID);
|
||||
if (increment != null) {
|
||||
payload.put("increment", increment.toString());
|
||||
}
|
||||
Map<String, String> payload = mapOfStrings(
|
||||
"lease_id", leaseID,
|
||||
"increment", increment
|
||||
);
|
||||
|
||||
/* Issue request and parse secret response */
|
||||
return request.put(PATH_RENEW, payload, token, SecretResponse.class);
|
||||
@ -584,12 +578,12 @@ public class HTTPVaultConnector implements VaultConnector {
|
||||
|
||||
@Override
|
||||
public final AuthResponse createToken(final Token token) throws VaultConnectorException {
|
||||
return createTokenInternal(token, PATH_TOKEN + PATH_CREATE);
|
||||
return createTokenInternal(token, PATH_AUTH_TOKEN + PATH_CREATE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public final AuthResponse createToken(final Token token, final boolean orphan) throws VaultConnectorException {
|
||||
return createTokenInternal(token, PATH_TOKEN + PATH_CREATE_ORPHAN);
|
||||
return createTokenInternal(token, PATH_AUTH_TOKEN + PATH_CREATE_ORPHAN);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -597,7 +591,7 @@ public class HTTPVaultConnector implements VaultConnector {
|
||||
if (role == null || role.isEmpty()) {
|
||||
throw new InvalidRequestException("No role name specified.");
|
||||
}
|
||||
return createTokenInternal(token, PATH_TOKEN + PATH_CREATE + "/" + role);
|
||||
return createTokenInternal(token, PATH_AUTH_TOKEN + PATH_CREATE + "/" + role);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -632,7 +626,7 @@ public class HTTPVaultConnector implements VaultConnector {
|
||||
|
||||
/* Request HTTP response and parse Secret */
|
||||
return request.get(
|
||||
PATH_TOKEN + PATH_LOOKUP,
|
||||
PATH_AUTH_TOKEN + PATH_LOOKUP,
|
||||
singletonMap("token", token),
|
||||
token,
|
||||
TokenResponse.class
|
||||
@ -650,7 +644,7 @@ public class HTTPVaultConnector implements VaultConnector {
|
||||
}
|
||||
|
||||
// Issue request and expect code 204 with empty response.
|
||||
request.postWithoutResponse(PATH_TOKEN + PATH_ROLES + "/" + name, role, token);
|
||||
request.postWithoutResponse(PATH_AUTH_TOKEN + PATH_ROLES + "/" + name, role, token);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -660,14 +654,14 @@ public class HTTPVaultConnector implements VaultConnector {
|
||||
requireAuth();
|
||||
|
||||
// Request HTTP response and parse response.
|
||||
return request.get(PATH_TOKEN + PATH_ROLES + "/" + name, emptyMap(), token, TokenRoleResponse.class);
|
||||
return request.get(PATH_AUTH_TOKEN + PATH_ROLES + "/" + name, emptyMap(), token, TokenRoleResponse.class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<String> listTokenRoles() throws VaultConnectorException {
|
||||
requireAuth();
|
||||
|
||||
return list(PATH_TOKEN + PATH_ROLES);
|
||||
return list(PATH_AUTH_TOKEN + PATH_ROLES);
|
||||
}
|
||||
|
||||
@Override
|
||||
@ -679,7 +673,7 @@ public class HTTPVaultConnector implements VaultConnector {
|
||||
}
|
||||
|
||||
// Issue request and expect code 204 with empty response.
|
||||
request.deleteWithoutResponse(PATH_TOKEN + PATH_ROLES + "/" + name, token);
|
||||
request.deleteWithoutResponse(PATH_AUTH_TOKEN + PATH_ROLES + "/" + name, token);
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -695,4 +689,42 @@ public class HTTPVaultConnector implements VaultConnector {
|
||||
throw new AuthorizationRequiredException();
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a map of non-null {@link String} keys and values
|
||||
*
|
||||
* @param keyValues Key-value tuples as vararg.
|
||||
* @return The map of non-null keys and values.
|
||||
*/
|
||||
private static Map<String, String> mapOfStrings(Object... keyValues) {
|
||||
Map<String, String> map = new HashMap<>(keyValues.length / 2, 1);
|
||||
for (int i = 0; i < keyValues.length -1; i = i + 2) {
|
||||
Object key = keyValues[i];
|
||||
Object val = keyValues[i + 1];
|
||||
if (key instanceof String && val != null) {
|
||||
map.put((String) key, val.toString());
|
||||
}
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
|
||||
/**
|
||||
* Generate a map of non-null {@link String} keys and {@link Object} values
|
||||
*
|
||||
* @param keyValues Key-value tuples as vararg.
|
||||
* @return The map of non-null keys and values.
|
||||
*/
|
||||
private static Map<String, Object> mapOf(Object... keyValues) {
|
||||
Map<String, Object> map = new HashMap<>(keyValues.length / 2, 1);
|
||||
for (int i = 0; i < keyValues.length; i = i + 2) {
|
||||
Object key = keyValues[i];
|
||||
Object val = keyValues[i + 1];
|
||||
if (key instanceof String && val != null) {
|
||||
map.put((String) key, val);
|
||||
}
|
||||
}
|
||||
|
||||
return map;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -119,9 +119,10 @@ public interface VaultConnector extends AutoCloseable, Serializable {
|
||||
* @param userID The User ID
|
||||
* @return The {@link AuthResponse}
|
||||
* @throws VaultConnectorException on error
|
||||
* @deprecated As of Vault 0.6.1 App-ID is superseded by AppRole. Consider using {@link #authAppRole} instead.
|
||||
* @deprecated As of Vault 0.6.1 App-ID is superseded by AppRole. App-ID was removed in Vault 1.12.
|
||||
* Consider using {@link #authAppRole} instead.
|
||||
*/
|
||||
@Deprecated(since = "0.4", forRemoval = false)
|
||||
@Deprecated(since = "0.4", forRemoval = true)
|
||||
AuthResponse authAppId(final String appID, final String userID) throws VaultConnectorException;
|
||||
|
||||
/**
|
||||
@ -155,9 +156,10 @@ public interface VaultConnector extends AutoCloseable, Serializable {
|
||||
* @param displayName Arbitrary name to display
|
||||
* @return {@code true} on success
|
||||
* @throws VaultConnectorException on error
|
||||
* @deprecated As of Vault 0.6.1 App-ID is superseded by AppRole. Consider using {@link #createAppRole} instead.
|
||||
* @deprecated As of Vault 0.6.1 App-ID is superseded by AppRole. App-ID was removed in Vault 1.12.
|
||||
* Consider using {@link #createAppRole} instead.
|
||||
*/
|
||||
@Deprecated(since = "0.4", forRemoval = false)
|
||||
@Deprecated(since = "0.4", forRemoval = true)
|
||||
boolean registerAppId(final String appID, final String policy, final String displayName)
|
||||
throws VaultConnectorException;
|
||||
|
||||
@ -349,10 +351,10 @@ public interface VaultConnector extends AutoCloseable, Serializable {
|
||||
* @param userID The User-ID
|
||||
* @return {@code true} on success
|
||||
* @throws VaultConnectorException on error
|
||||
* @deprecated As of Vault 0.6.1 App-ID is superseded by AppRole.
|
||||
* @deprecated As of Vault 0.6.1 App-ID is superseded by AppRole. App-ID was removed in Vault 1.12.
|
||||
* Consider using {@link #createAppRoleSecret} instead.
|
||||
*/
|
||||
@Deprecated(since = "0.4", forRemoval = false)
|
||||
@Deprecated(since = "0.4", forRemoval = true)
|
||||
boolean registerUserId(final String appID, final String userID) throws VaultConnectorException;
|
||||
|
||||
/**
|
||||
@ -364,9 +366,9 @@ public interface VaultConnector extends AutoCloseable, Serializable {
|
||||
* @param userID The User-ID
|
||||
* @return {@code true} on success
|
||||
* @throws VaultConnectorException on error
|
||||
* @deprecated As of Vault 0.6.1 App-ID is superseded by AppRole.
|
||||
* @deprecated As of Vault 0.6.1 App-ID is superseded by AppRole. App-ID was removed in Vault 1.12.
|
||||
*/
|
||||
@Deprecated(since = "0.4", forRemoval = false)
|
||||
@Deprecated(since = "0.4", forRemoval = true)
|
||||
default boolean registerAppUserId(final String appID,
|
||||
final String policy,
|
||||
final String displayName,
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -399,7 +399,7 @@ public final class RequestHelper implements Serializable {
|
||||
* @throws InvalidResponseException on reading errors
|
||||
*/
|
||||
private String handleResult(final HttpResponse<InputStream> response) throws InvalidResponseException {
|
||||
try (var reader = new BufferedReader(new InputStreamReader(response.body()))) {
|
||||
try (var reader = new BufferedReader(new InputStreamReader(response.body(), UTF_8))) {
|
||||
return reader.lines().collect(Collectors.joining("\n"));
|
||||
} catch (IOException ignored) {
|
||||
throw new InvalidResponseException(Error.READ_RESPONSE, 200);
|
||||
@ -414,7 +414,7 @@ public final class RequestHelper implements Serializable {
|
||||
*/
|
||||
private void handleError(final HttpResponse<InputStream> response) throws VaultConnectorException {
|
||||
if (response.body() != null) {
|
||||
try (var reader = new BufferedReader(new InputStreamReader(response.body()))) {
|
||||
try (var reader = new BufferedReader(new InputStreamReader(response.body(), UTF_8))) {
|
||||
var responseString = reader.lines().collect(Collectors.joining("\n"));
|
||||
ErrorResponse er = jsonMapper.readValue(responseString, ErrorResponse.class);
|
||||
/* Check for "permission denied" response */
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -24,6 +24,7 @@ package de.stklcode.jvault.connector.model;
|
||||
*/
|
||||
public enum AuthBackend {
|
||||
TOKEN("token"),
|
||||
@Deprecated(since = "1.1.3", forRemoval = true)
|
||||
APPID("app-id"),
|
||||
APPROLE("approle"),
|
||||
USERPASS("userpass"),
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -37,7 +37,7 @@ import java.util.Objects;
|
||||
public final class SecretMetadata implements Serializable {
|
||||
private static final long serialVersionUID = 1684891108903409038L;
|
||||
|
||||
private static final DateTimeFormatter TIME_FORMAT = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSSX");
|
||||
private static final DateTimeFormatter TIME_FORMAT = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSSXXX");
|
||||
|
||||
@JsonProperty("created_time")
|
||||
private String createdTimeString;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -36,7 +36,7 @@ import java.util.Objects;
|
||||
public final class VersionMetadata implements Serializable {
|
||||
private static final long serialVersionUID = -5286693953873839611L;
|
||||
|
||||
private static final DateTimeFormatter TIME_FORMAT = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSSX");
|
||||
private static final DateTimeFormatter TIME_FORMAT = DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ss.SSSSSSSSSXXX");
|
||||
|
||||
@JsonProperty("created_time")
|
||||
private String createdTimeString;
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -25,6 +25,7 @@ import de.stklcode.jvault.connector.model.response.*;
|
||||
import de.stklcode.jvault.connector.test.Credentials;
|
||||
import de.stklcode.jvault.connector.test.VaultConfiguration;
|
||||
import org.junit.jupiter.api.*;
|
||||
import org.junit.jupiter.api.condition.EnabledIf;
|
||||
import org.junit.jupiter.api.io.TempDir;
|
||||
|
||||
import java.io.*;
|
||||
@ -37,6 +38,7 @@ import java.util.regex.Pattern;
|
||||
|
||||
import static java.util.Collections.singletonMap;
|
||||
import static org.apache.commons.io.FileUtils.copyDirectory;
|
||||
import static org.awaitility.Awaitility.await;
|
||||
import static org.junit.jupiter.api.Assertions.*;
|
||||
import static org.junit.jupiter.api.Assumptions.assumeFalse;
|
||||
import static org.junit.jupiter.api.Assumptions.assumeTrue;
|
||||
@ -49,7 +51,7 @@ import static org.junit.jupiter.api.Assumptions.assumeTrue;
|
||||
* @since 0.1
|
||||
*/
|
||||
class HTTPVaultConnectorIT {
|
||||
private static String VAULT_VERSION = "1.10.1"; // The vault version this test is supposed to run against.
|
||||
private static String VAULT_VERSION = "1.13.3"; // 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";
|
||||
@ -57,6 +59,7 @@ class HTTPVaultConnectorIT {
|
||||
private static final String USER_VALID = "validUser";
|
||||
private static final String PASS_VALID = "validPass";
|
||||
|
||||
private static boolean legacy;
|
||||
private Process vaultProcess;
|
||||
private VaultConnector connector;
|
||||
|
||||
@ -67,6 +70,9 @@ class HTTPVaultConnectorIT {
|
||||
VAULT_VERSION = System.getenv("VAULT_VERSION");
|
||||
System.out.println("Vault version set to " + VAULT_VERSION);
|
||||
}
|
||||
if (compareVersions(VAULT_VERSION, "1.12.0") < 0) {
|
||||
legacy = true;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -80,11 +86,6 @@ class HTTPVaultConnectorIT {
|
||||
|
||||
// Initialize Vault.
|
||||
VaultConfiguration config = initializeVault(tempDir, isTls);
|
||||
try {
|
||||
TimeUnit.SECONDS.sleep(1);
|
||||
} catch (InterruptedException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
// Initialize connector.
|
||||
HTTPVaultConnectorBuilder builder = HTTPVaultConnector.builder()
|
||||
@ -551,6 +552,9 @@ class HTTPVaultConnectorIT {
|
||||
|
||||
@Nested
|
||||
@DisplayName("App-ID Tests")
|
||||
@EnabledIf(value = "de.stklcode.jvault.connector.HTTPVaultConnectorIT#isLegacy",
|
||||
disabledReason = "AppID tests no longer available for Vault 1.12 and above")
|
||||
@SuppressWarnings("deprecation")
|
||||
class AppIdTests {
|
||||
private static final String APP_ID = "152AEA38-85FB-47A8-9CBD-612D645BFACA";
|
||||
private static final String USER_ID = "5ADF8218-D7FB-4089-9E38-287465DBF37E";
|
||||
@ -561,7 +565,6 @@ class HTTPVaultConnectorIT {
|
||||
@Test
|
||||
@Order(10)
|
||||
@DisplayName("Authenticate with App-ID")
|
||||
@SuppressWarnings("deprecation")
|
||||
void authAppIdTest() {
|
||||
// Try unauthorized access first.
|
||||
assumeFalse(connector.isAuthorized());
|
||||
@ -584,7 +587,6 @@ class HTTPVaultConnectorIT {
|
||||
@Test
|
||||
@Order(20)
|
||||
@DisplayName("Register App-ID")
|
||||
@SuppressWarnings("deprecation")
|
||||
void registerAppIdTest() {
|
||||
// Authorize.
|
||||
authRoot();
|
||||
@ -908,7 +910,8 @@ class HTTPVaultConnectorIT {
|
||||
assertFalse(res.getAuth().isOrphan(), "Root token should not be orphan");
|
||||
|
||||
// Starting with Vault 1.0 a warning "custom ID uses weaker SHA1.." is given.
|
||||
assertEquals(1, res.getWarnings().size(), "Token creation did not return expected warning");
|
||||
// Starting with Vault 1.11 a second warning "Endpoint ignored unrecognized parameters" is given.
|
||||
assertFalse(res.getWarnings().isEmpty(), "Token creation did not return expected warning");
|
||||
|
||||
// Create token with attributes.
|
||||
Token token2 = Token.builder()
|
||||
@ -1077,8 +1080,13 @@ class HTTPVaultConnectorIT {
|
||||
() -> connector.getAuthBackends(),
|
||||
"Could not list supported auth backends"
|
||||
);
|
||||
assertEquals(4, supportedBackends.size());
|
||||
assertTrue(supportedBackends.containsAll(List.of(AuthBackend.TOKEN, AuthBackend.USERPASS, AuthBackend.APPID, AuthBackend.APPROLE)));
|
||||
if (legacy) {
|
||||
assertEquals(4, supportedBackends.size());
|
||||
assertTrue(supportedBackends.containsAll(List.of(AuthBackend.TOKEN, AuthBackend.USERPASS, AuthBackend.APPID, AuthBackend.APPROLE)));
|
||||
} else {
|
||||
assertEquals(3, supportedBackends.size());
|
||||
assertTrue(supportedBackends.containsAll(List.of(AuthBackend.TOKEN, AuthBackend.USERPASS, AuthBackend.APPROLE)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1204,7 +1212,11 @@ class HTTPVaultConnectorIT {
|
||||
*/
|
||||
private VaultConfiguration initializeVault(File dir, boolean tls) throws IllegalStateException, IOException {
|
||||
File dataDir = new File(dir, "data");
|
||||
copyDirectory(new File(getClass().getResource("/data_dir").getPath()), dataDir);
|
||||
if (legacy) {
|
||||
copyDirectory(new File(getClass().getResource("/data_dir_legacy").getPath()), dataDir);
|
||||
} else {
|
||||
copyDirectory(new File(getClass().getResource("/data_dir").getPath()), dataDir);
|
||||
}
|
||||
|
||||
// Generate vault local unencrypted configuration.
|
||||
VaultConfiguration config = new VaultConfiguration()
|
||||
@ -1221,30 +1233,37 @@ class HTTPVaultConnectorIT {
|
||||
}
|
||||
|
||||
// Write configuration file.
|
||||
BufferedWriter bw = null;
|
||||
File configFile;
|
||||
try {
|
||||
configFile = new File(dir, "vault.conf");
|
||||
bw = new BufferedWriter(new FileWriter(configFile));
|
||||
File configFile = new File(dir, "vault.conf");
|
||||
try (BufferedWriter bw = new BufferedWriter(new FileWriter(configFile))) {
|
||||
bw.write(config.toString());
|
||||
} catch (IOException e) {
|
||||
throw new IllegalStateException("Unable to generate config file", e);
|
||||
} finally {
|
||||
try {
|
||||
if (bw != null)
|
||||
bw.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
// Start vault process.
|
||||
try {
|
||||
vaultProcess = Runtime.getRuntime().exec("vault server -config " + configFile.toString());
|
||||
vaultProcess = Runtime.getRuntime().exec("vault server -config " + configFile);
|
||||
} catch (IOException e) {
|
||||
throw new IllegalStateException("Unable to start vault. Make sure vault binary is in your executable path", e);
|
||||
}
|
||||
|
||||
await().atMost(5, TimeUnit.SECONDS).until(() -> {
|
||||
try (InputStream stdout = vaultProcess.getInputStream();
|
||||
InputStreamReader reader = new InputStreamReader(stdout);
|
||||
BufferedReader br = new BufferedReader(reader)) {
|
||||
String line = br.readLine();
|
||||
while (line != null) {
|
||||
if (line.contains("Vault server started")) {
|
||||
return true;
|
||||
} else {
|
||||
line = br.readLine();
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
return config;
|
||||
}
|
||||
|
||||
@ -1269,28 +1288,14 @@ class HTTPVaultConnectorIT {
|
||||
* @return port number
|
||||
*/
|
||||
private static Integer getFreePort() {
|
||||
ServerSocket socket = null;
|
||||
try {
|
||||
socket = new ServerSocket(0);
|
||||
try (ServerSocket socket = new ServerSocket(0)) {
|
||||
socket.setReuseAddress(true);
|
||||
int port = socket.getLocalPort();
|
||||
try {
|
||||
socket.close();
|
||||
} catch (IOException e) {
|
||||
// Ignore IOException on close()
|
||||
}
|
||||
return port;
|
||||
|
||||
return socket.getLocalPort();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
} finally {
|
||||
if (socket != null) {
|
||||
try {
|
||||
socket.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
throw new IllegalStateException("Unable to find a free TCP port");
|
||||
}
|
||||
|
||||
@ -1305,4 +1310,35 @@ class HTTPVaultConnectorIT {
|
||||
th.printStackTrace(new PrintWriter(sw, true));
|
||||
return sw.getBuffer().toString();
|
||||
}
|
||||
|
||||
/**
|
||||
* Compare two version strings.
|
||||
*
|
||||
* @param version1 Version 1
|
||||
* @param version2 Version 2
|
||||
* @return negative value if version 1 is smaller than version2, positive value of version 1 is greater, 0 if equal
|
||||
*/
|
||||
private static int compareVersions(String version1, String version2) {
|
||||
int comparisonResult = 0;
|
||||
|
||||
String[] version1Splits = version1.split("\\.");
|
||||
String[] version2Splits = version2.split("\\.");
|
||||
int maxLengthOfVersionSplits = Math.max(version1Splits.length, version2Splits.length);
|
||||
|
||||
for (int i = 0; i < maxLengthOfVersionSplits; i++) {
|
||||
Integer v1 = i < version1Splits.length ? Integer.parseInt(version1Splits[i]) : 0;
|
||||
Integer v2 = i < version2Splits.length ? Integer.parseInt(version2Splits[i]) : 0;
|
||||
int compare = v1.compareTo(v2);
|
||||
if (compare != 0) {
|
||||
comparisonResult = compare;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
return comparisonResult;
|
||||
}
|
||||
|
||||
private static boolean isLegacy() {
|
||||
return legacy;
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,6 @@
|
||||
package de.stklcode.jvault.connector.model;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import nl.jqno.equalsverifier.EqualsVerifier;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@ -16,6 +17,7 @@ import static org.junit.jupiter.api.Assertions.fail;
|
||||
*/
|
||||
public abstract class AbstractModelTest<T> {
|
||||
protected final Class<?> modelClass;
|
||||
protected final ObjectMapper objectMapper;
|
||||
|
||||
/**
|
||||
* Test case constructor.
|
||||
@ -24,6 +26,7 @@ public abstract class AbstractModelTest<T> {
|
||||
*/
|
||||
protected AbstractModelTest(Class<T> modelClass) {
|
||||
this.modelClass = modelClass;
|
||||
this.objectMapper = new ObjectMapper();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -16,7 +16,6 @@
|
||||
|
||||
package de.stklcode.jvault.connector.model;
|
||||
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
@ -116,16 +115,14 @@ class AppRoleSecretTest extends AbstractModelTest<AppRoleSecret> {
|
||||
*/
|
||||
@Test
|
||||
void jsonTest() throws NoSuchFieldException, IllegalAccessException {
|
||||
ObjectMapper mapper = new ObjectMapper();
|
||||
|
||||
// A simple roundtrip first. All set fields should be present afterwards..
|
||||
AppRoleSecret secret = new AppRoleSecret(TEST_ID, TEST_META, TEST_CIDR);
|
||||
String secretJson = assertDoesNotThrow(() -> mapper.writeValueAsString(secret), "Serialization failed");
|
||||
String secretJson = assertDoesNotThrow(() -> objectMapper.writeValueAsString(secret), "Serialization failed");
|
||||
// CIDR list is comma-separated when used as input, but List otherwise, hence convert string to list.
|
||||
String secretJson2 = commaSeparatedToList(secretJson);
|
||||
|
||||
AppRoleSecret secret2 = assertDoesNotThrow(
|
||||
() -> mapper.readValue(secretJson2, AppRoleSecret.class),
|
||||
() -> objectMapper.readValue(secretJson2, AppRoleSecret.class),
|
||||
"Deserialization failed"
|
||||
);
|
||||
assertEquals(secret2.getId(), secret.getId());
|
||||
@ -145,9 +142,9 @@ class AppRoleSecretTest extends AbstractModelTest<AppRoleSecret> {
|
||||
assumeTrue(secret.getNumUses() == 678);
|
||||
setPrivateField(secret, "ttl", 12345);
|
||||
assumeTrue(secret.getTtl() == 12345);
|
||||
String secretJson3 = assertDoesNotThrow(() -> mapper.writeValueAsString(secret), "Serialization failed");
|
||||
String secretJson3 = assertDoesNotThrow(() -> objectMapper.writeValueAsString(secret), "Serialization failed");
|
||||
secret2 = assertDoesNotThrow(
|
||||
() -> mapper.readValue(commaSeparatedToList(secretJson3), AppRoleSecret.class),
|
||||
() -> objectMapper.readValue(commaSeparatedToList(secretJson3), AppRoleSecret.class),
|
||||
"Deserialization failed"
|
||||
);
|
||||
assertEquals(secret2.getId(), secret.getId());
|
||||
@ -165,7 +162,7 @@ class AppRoleSecretTest extends AbstractModelTest<AppRoleSecret> {
|
||||
"\"cidr_list\":[\"203.0.113.0/24\",\"198.51.100.0/24\"],\"secret_id_accessor\":\"TEST_ACCESSOR\"," +
|
||||
"\"creation_time\":\"TEST_CREATION\",\"expiration_time\":\"TEST_EXPIRATION\"," +
|
||||
"\"last_updated_time\":\"TEST_LASTUPDATE\",\"secret_id_num_uses\":678,\"secret_id_ttl\":12345}";
|
||||
secret2 = assertDoesNotThrow(() -> mapper.readValue(secretJson4, AppRoleSecret.class), "Deserialization failed");
|
||||
secret2 = assertDoesNotThrow(() -> objectMapper.readValue(secretJson4, AppRoleSecret.class), "Deserialization failed");
|
||||
assertEquals("TEST_ACCESSOR", secret2.getAccessor());
|
||||
assertEquals("TEST_CREATION", secret2.getCreationTime());
|
||||
assertEquals("TEST_EXPIRATION", secret2.getExpirationTime());
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -17,7 +17,6 @@
|
||||
package de.stklcode.jvault.connector.model;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@ -110,7 +109,7 @@ class AppRoleTest extends AbstractModelTest<AppRole> {
|
||||
assertNull(role.getTokenType());
|
||||
|
||||
// Optional fields should be ignored, so JSON string should only contain role_name.
|
||||
assertEquals(JSON_MIN, new ObjectMapper().writeValueAsString(role));
|
||||
assertEquals(JSON_MIN, objectMapper.writeValueAsString(role));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -137,7 +136,7 @@ class AppRoleTest extends AbstractModelTest<AppRole> {
|
||||
assertEquals(TOKEN_TYPE.value(), role.getTokenType());
|
||||
|
||||
// Verify that all parameters are included in JSON string.
|
||||
assertEquals(JSON_FULL, new ObjectMapper().writeValueAsString(role));
|
||||
assertEquals(JSON_FULL, objectMapper.writeValueAsString(role));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -33,6 +33,7 @@ class AuthBackendTest {
|
||||
* Test forType() method.
|
||||
*/
|
||||
@Test
|
||||
@SuppressWarnings("deprecation")
|
||||
void forTypeTest() {
|
||||
assertEquals(AuthBackend.TOKEN, AuthBackend.forType("token"));
|
||||
assertEquals(AuthBackend.APPID, AuthBackend.forType("app-id"));
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -17,7 +17,6 @@
|
||||
package de.stklcode.jvault.connector.model;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
import java.util.Arrays;
|
||||
@ -133,7 +132,7 @@ class TokenRoleTest extends AbstractModelTest<TokenRole> {
|
||||
assertNull(role.getTokenType());
|
||||
|
||||
// Optional fields should be ignored, so JSON string should be empty.
|
||||
assertEquals("{}", new ObjectMapper().writeValueAsString(role));
|
||||
assertEquals("{}", objectMapper.writeValueAsString(role));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -177,7 +176,7 @@ class TokenRoleTest extends AbstractModelTest<TokenRole> {
|
||||
assertEquals(role, new TokenRole());
|
||||
|
||||
// Optional fields should be ignored, so JSON string should be empty.
|
||||
assertEquals("{}", new ObjectMapper().writeValueAsString(role));
|
||||
assertEquals("{}", objectMapper.writeValueAsString(role));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -208,6 +207,6 @@ class TokenRoleTest extends AbstractModelTest<TokenRole> {
|
||||
assertEquals(TOKEN_TYPE.value(), role.getTokenType());
|
||||
|
||||
// Verify that all parameters are included in JSON string.
|
||||
assertEquals(JSON_FULL, new ObjectMapper().writeValueAsString(role));
|
||||
assertEquals(JSON_FULL, objectMapper.writeValueAsString(role));
|
||||
}
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -17,7 +17,6 @@
|
||||
package de.stklcode.jvault.connector.model;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import org.junit.jupiter.api.BeforeAll;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@ -103,7 +102,7 @@ class TokenTest extends AbstractModelTest<Token> {
|
||||
assertNull(token.getEntityAlias());
|
||||
|
||||
// Optional fields should be ignored, so JSON string should be empty.
|
||||
assertEquals("{}", new ObjectMapper().writeValueAsString(token));
|
||||
assertEquals("{}", objectMapper.writeValueAsString(token));
|
||||
|
||||
// Empty builder should be equal to no-arg construction.
|
||||
assertEquals(token, new Token());
|
||||
@ -129,7 +128,7 @@ class TokenTest extends AbstractModelTest<Token> {
|
||||
assertEquals(PERIOD, token.getPeriod());
|
||||
|
||||
// Verify that all parameters are included in JSON string.
|
||||
assertEquals(JSON_FULL, new ObjectMapper().writeValueAsString(token));
|
||||
assertEquals(JSON_FULL, objectMapper.writeValueAsString(token));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -17,7 +17,6 @@
|
||||
package de.stklcode.jvault.connector.model.response;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import de.stklcode.jvault.connector.model.AbstractModelTest;
|
||||
import de.stklcode.jvault.connector.model.AppRole;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@ -69,7 +68,7 @@ class AppRoleResponseTest extends AbstractModelTest<AppRoleResponse> {
|
||||
@Override
|
||||
protected AppRoleResponse createFull() {
|
||||
try {
|
||||
return new ObjectMapper().readValue(RES_JSON, AppRoleResponse.class);
|
||||
return objectMapper.readValue(RES_JSON, AppRoleResponse.class);
|
||||
} catch (JsonProcessingException e) {
|
||||
fail("Creation of full model instance failed", e);
|
||||
return null;
|
||||
@ -92,7 +91,7 @@ class AppRoleResponseTest extends AbstractModelTest<AppRoleResponse> {
|
||||
@Test
|
||||
void jsonRoundtrip() {
|
||||
AppRoleResponse res = assertDoesNotThrow(
|
||||
() -> new ObjectMapper().readValue(RES_JSON, AppRoleResponse.class),
|
||||
() -> objectMapper.readValue(RES_JSON, AppRoleResponse.class),
|
||||
"AuthResponse deserialization failed"
|
||||
);
|
||||
assertNotNull(res, "Parsed response is NULL");
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -17,7 +17,6 @@
|
||||
package de.stklcode.jvault.connector.model.response;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import de.stklcode.jvault.connector.model.AbstractModelTest;
|
||||
import de.stklcode.jvault.connector.model.AuthBackend;
|
||||
import de.stklcode.jvault.connector.model.response.embedded.AuthMethod;
|
||||
@ -83,7 +82,7 @@ class AuthMethodsResponseTest extends AbstractModelTest<AuthMethodsResponse> {
|
||||
@Override
|
||||
protected AuthMethodsResponse createFull() {
|
||||
try {
|
||||
return new ObjectMapper().readValue(RES_JSON, AuthMethodsResponse.class);
|
||||
return objectMapper.readValue(RES_JSON, AuthMethodsResponse.class);
|
||||
} catch (JsonProcessingException e) {
|
||||
fail("Creation of full model instance failed", e);
|
||||
return null;
|
||||
@ -106,7 +105,7 @@ class AuthMethodsResponseTest extends AbstractModelTest<AuthMethodsResponse> {
|
||||
@Test
|
||||
void jsonRoundtrip() {
|
||||
AuthMethodsResponse res = assertDoesNotThrow(
|
||||
() -> new ObjectMapper().readValue(RES_JSON, AuthMethodsResponse.class),
|
||||
() -> objectMapper.readValue(RES_JSON, AuthMethodsResponse.class),
|
||||
"AuthResponse deserialization failed"
|
||||
);
|
||||
assertNotNull(res, "Parsed response is NULL");
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -17,7 +17,6 @@
|
||||
package de.stklcode.jvault.connector.model.response;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import de.stklcode.jvault.connector.model.AbstractModelTest;
|
||||
import de.stklcode.jvault.connector.model.response.embedded.AuthData;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@ -76,7 +75,7 @@ class AuthResponseTest extends AbstractModelTest<AuthResponse> {
|
||||
@Override
|
||||
protected AuthResponse createFull() {
|
||||
try {
|
||||
return new ObjectMapper().readValue(RES_JSON, AuthResponse.class);
|
||||
return objectMapper.readValue(RES_JSON, AuthResponse.class);
|
||||
} catch (JsonProcessingException e) {
|
||||
fail("Creation of full model instance failed", e);
|
||||
return null;
|
||||
@ -89,7 +88,7 @@ class AuthResponseTest extends AbstractModelTest<AuthResponse> {
|
||||
@Test
|
||||
void jsonRoundtrip() {
|
||||
AuthResponse res = assertDoesNotThrow(
|
||||
() -> new ObjectMapper().readValue(RES_JSON, AuthResponse.class),
|
||||
() -> objectMapper.readValue(RES_JSON, AuthResponse.class),
|
||||
"AuthResponse deserialization failed"
|
||||
);
|
||||
assertNotNull(res, "Parsed response is NULL");
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -17,7 +17,6 @@
|
||||
package de.stklcode.jvault.connector.model.response;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import de.stklcode.jvault.connector.exception.InvalidResponseException;
|
||||
import de.stklcode.jvault.connector.model.AbstractModelTest;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@ -52,7 +51,7 @@ class CredentialsResponseTest extends AbstractModelTest<CredentialsResponse> {
|
||||
@Override
|
||||
protected CredentialsResponse createFull() {
|
||||
try {
|
||||
return new ObjectMapper().readValue(JSON, CredentialsResponse.class);
|
||||
return objectMapper.readValue(JSON, CredentialsResponse.class);
|
||||
} catch (JsonProcessingException e) {
|
||||
fail("Creation of full model instance failed", e);
|
||||
return null;
|
||||
@ -72,7 +71,7 @@ class CredentialsResponseTest extends AbstractModelTest<CredentialsResponse> {
|
||||
assertNull(res.getPassword(), "Password not present in data map should not return anything");
|
||||
|
||||
res = assertDoesNotThrow(
|
||||
() -> new ObjectMapper().readValue(JSON, CredentialsResponse.class),
|
||||
() -> objectMapper.readValue(JSON, CredentialsResponse.class),
|
||||
"Deserialization of CredentialsResponse failed"
|
||||
);
|
||||
assertEquals(VAL_USER, res.getUsername(), "Incorrect username");
|
||||
|
@ -17,7 +17,6 @@
|
||||
package de.stklcode.jvault.connector.model.response;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import de.stklcode.jvault.connector.model.AbstractModelTest;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@ -44,7 +43,7 @@ class ErrorResponseTest extends AbstractModelTest<ErrorResponse> {
|
||||
@Override
|
||||
protected ErrorResponse createFull() {
|
||||
try {
|
||||
return new ObjectMapper().readValue(JSON, ErrorResponse.class);
|
||||
return objectMapper.readValue(JSON, ErrorResponse.class);
|
||||
} catch (JsonProcessingException e) {
|
||||
fail("Creation of full model instance failed", e);
|
||||
return null;
|
||||
@ -56,16 +55,15 @@ class ErrorResponseTest extends AbstractModelTest<ErrorResponse> {
|
||||
*/
|
||||
@Test
|
||||
void jsonRoundtrip() {
|
||||
ObjectMapper om = new ObjectMapper();
|
||||
ErrorResponse res = assertDoesNotThrow(
|
||||
() -> om.readValue(JSON, ErrorResponse.class),
|
||||
() -> objectMapper.readValue(JSON, ErrorResponse.class),
|
||||
"ErrorResponse deserialization failed"
|
||||
);
|
||||
assertNotNull(res, "Parsed response is NULL");
|
||||
assertEquals(List.of(ERROR_1, ERROR_2), res.getErrors(), "Unexpected error messages");
|
||||
assertEquals(
|
||||
JSON,
|
||||
assertDoesNotThrow(() -> om.writeValueAsString(res), "ErrorResponse serialization failed"),
|
||||
assertDoesNotThrow(() -> objectMapper.writeValueAsString(res), "ErrorResponse serialization failed"),
|
||||
"Unexpected JSON string after serialization"
|
||||
);
|
||||
}
|
||||
@ -74,13 +72,13 @@ class ErrorResponseTest extends AbstractModelTest<ErrorResponse> {
|
||||
@Test
|
||||
void testToString() {
|
||||
ErrorResponse res = assertDoesNotThrow(
|
||||
() -> new ObjectMapper().readValue(JSON, ErrorResponse.class),
|
||||
() -> objectMapper.readValue(JSON, ErrorResponse.class),
|
||||
"ErrorResponse deserialization failed"
|
||||
);
|
||||
assertEquals(ERROR_1, res.toString());
|
||||
|
||||
res = assertDoesNotThrow(
|
||||
() -> new ObjectMapper().readValue(JSON_EMPTY, ErrorResponse.class),
|
||||
() -> objectMapper.readValue(JSON_EMPTY, ErrorResponse.class),
|
||||
"ErrorResponse deserialization failed with empty list"
|
||||
);
|
||||
assertEquals("error response", res.toString());
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -17,7 +17,6 @@
|
||||
package de.stklcode.jvault.connector.model.response;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import de.stklcode.jvault.connector.model.AbstractModelTest;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@ -61,7 +60,7 @@ class HealthResponseTest extends AbstractModelTest<HealthResponse> {
|
||||
@Override
|
||||
protected HealthResponse createFull() {
|
||||
try {
|
||||
return new ObjectMapper().readValue(RES_JSON, HealthResponse.class);
|
||||
return objectMapper.readValue(RES_JSON, HealthResponse.class);
|
||||
} catch (JsonProcessingException e) {
|
||||
fail("Creation of full model instance failed", e);
|
||||
return null;
|
||||
@ -74,7 +73,7 @@ class HealthResponseTest extends AbstractModelTest<HealthResponse> {
|
||||
@Test
|
||||
void jsonRoundtrip() {
|
||||
HealthResponse res = assertDoesNotThrow(
|
||||
() -> new ObjectMapper().readValue(RES_JSON, HealthResponse.class),
|
||||
() -> objectMapper.readValue(RES_JSON, HealthResponse.class),
|
||||
"Health deserialization failed"
|
||||
);
|
||||
assertNotNull(res, "Parsed response is NULL");
|
||||
|
@ -17,7 +17,6 @@
|
||||
package de.stklcode.jvault.connector.model.response;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import de.stklcode.jvault.connector.model.AbstractModelTest;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@ -40,7 +39,7 @@ class HelpResponseTest extends AbstractModelTest<HelpResponse> {
|
||||
@Override
|
||||
protected HelpResponse createFull() {
|
||||
try {
|
||||
return new ObjectMapper().readValue(JSON, HelpResponse.class);
|
||||
return objectMapper.readValue(JSON, HelpResponse.class);
|
||||
} catch (JsonProcessingException e) {
|
||||
fail("Creation of full model instance failed", e);
|
||||
return null;
|
||||
@ -52,16 +51,15 @@ class HelpResponseTest extends AbstractModelTest<HelpResponse> {
|
||||
*/
|
||||
@Test
|
||||
void jsonRoundtrip() {
|
||||
ObjectMapper om = new ObjectMapper();
|
||||
HelpResponse res = assertDoesNotThrow(
|
||||
() -> om.readValue(JSON, HelpResponse.class),
|
||||
() -> objectMapper.readValue(JSON, HelpResponse.class),
|
||||
"HelpResponse deserialization failed"
|
||||
);
|
||||
assertNotNull(res, "Parsed response is NULL");
|
||||
assertEquals(HELP, res.getHelp(), "Unexpected help text");
|
||||
assertEquals(
|
||||
JSON,
|
||||
assertDoesNotThrow(() -> om.writeValueAsString(res), "HelpResponse serialization failed"),
|
||||
assertDoesNotThrow(() -> objectMapper.writeValueAsString(res), "HelpResponse serialization failed"),
|
||||
"Unexpected JSON string after serialization"
|
||||
);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -17,7 +17,6 @@
|
||||
package de.stklcode.jvault.connector.model.response;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import de.stklcode.jvault.connector.model.AbstractModelTest;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@ -89,7 +88,7 @@ class MetaSecretResponseTest extends AbstractModelTest<MetaSecretResponse> {
|
||||
@Override
|
||||
protected MetaSecretResponse createFull() {
|
||||
try {
|
||||
return new ObjectMapper().readValue(SECRET_JSON_V2, MetaSecretResponse.class);
|
||||
return objectMapper.readValue(SECRET_JSON_V2, MetaSecretResponse.class);
|
||||
} catch (JsonProcessingException e) {
|
||||
fail("Creation of full model instance failed", e);
|
||||
return null;
|
||||
@ -103,7 +102,7 @@ class MetaSecretResponseTest extends AbstractModelTest<MetaSecretResponse> {
|
||||
void jsonRoundtrip() {
|
||||
// KV v2 secret.
|
||||
MetaSecretResponse res = assertDoesNotThrow(
|
||||
() -> new ObjectMapper().readValue(SECRET_JSON_V2, MetaSecretResponse.class),
|
||||
() -> objectMapper.readValue(SECRET_JSON_V2, MetaSecretResponse.class),
|
||||
"SecretResponse deserialization failed"
|
||||
);
|
||||
assertSecretData(res);
|
||||
@ -117,7 +116,7 @@ class MetaSecretResponseTest extends AbstractModelTest<MetaSecretResponse> {
|
||||
|
||||
// Deleted KV v2 secret.
|
||||
res = assertDoesNotThrow(
|
||||
() -> new ObjectMapper().readValue(SECRET_JSON_V2_2, MetaSecretResponse.class),
|
||||
() -> objectMapper.readValue(SECRET_JSON_V2_2, MetaSecretResponse.class),
|
||||
"SecretResponse deserialization failed"
|
||||
);
|
||||
assertSecretData(res);
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -17,7 +17,6 @@
|
||||
package de.stklcode.jvault.connector.model.response;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import de.stklcode.jvault.connector.model.AbstractModelTest;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@ -71,7 +70,7 @@ class MetadataResponseTest extends AbstractModelTest<MetadataResponse> {
|
||||
@Override
|
||||
protected MetadataResponse createFull() {
|
||||
try {
|
||||
return new ObjectMapper().readValue(META_JSON, MetadataResponse.class);
|
||||
return objectMapper.readValue(META_JSON, MetadataResponse.class);
|
||||
} catch (JsonProcessingException e) {
|
||||
fail("Creation of full model instance failed", e);
|
||||
return null;
|
||||
@ -84,7 +83,7 @@ class MetadataResponseTest extends AbstractModelTest<MetadataResponse> {
|
||||
@Test
|
||||
void jsonRoundtrip() {
|
||||
MetadataResponse res = assertDoesNotThrow(
|
||||
() -> new ObjectMapper().readValue(META_JSON, MetadataResponse.class),
|
||||
() -> objectMapper.readValue(META_JSON, MetadataResponse.class),
|
||||
"MetadataResponse deserialization failed"
|
||||
);
|
||||
assertNotNull(res, "Parsed response is NULL");
|
||||
|
@ -17,7 +17,6 @@
|
||||
package de.stklcode.jvault.connector.model.response;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import de.stklcode.jvault.connector.model.AbstractModelTest;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@ -60,7 +59,7 @@ class PlainSecretResponseTest extends AbstractModelTest<PlainSecretResponse> {
|
||||
@Override
|
||||
protected PlainSecretResponse createFull() {
|
||||
try {
|
||||
return new ObjectMapper().readValue(SECRET_JSON, PlainSecretResponse.class);
|
||||
return objectMapper.readValue(SECRET_JSON, PlainSecretResponse.class);
|
||||
} catch (JsonProcessingException e) {
|
||||
fail("Creation of full model instance failed", e);
|
||||
return null;
|
||||
@ -73,7 +72,7 @@ class PlainSecretResponseTest extends AbstractModelTest<PlainSecretResponse> {
|
||||
@Test
|
||||
void jsonRoundtrip() {
|
||||
SecretResponse res = assertDoesNotThrow(
|
||||
() -> new ObjectMapper().readValue(SECRET_JSON, PlainSecretResponse.class),
|
||||
() -> objectMapper.readValue(SECRET_JSON, PlainSecretResponse.class),
|
||||
"SecretResponse deserialization failed"
|
||||
);
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -17,7 +17,6 @@
|
||||
package de.stklcode.jvault.connector.model.response;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import de.stklcode.jvault.connector.model.AbstractModelTest;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@ -80,7 +79,7 @@ class SealResponseTest extends AbstractModelTest<SealResponse> {
|
||||
@Override
|
||||
protected SealResponse createFull() {
|
||||
try {
|
||||
return new ObjectMapper().readValue(RES_UNSEALED, SealResponse.class);
|
||||
return objectMapper.readValue(RES_UNSEALED, SealResponse.class);
|
||||
} catch (JsonProcessingException e) {
|
||||
fail("Creation of full model instance failed", e);
|
||||
return null;
|
||||
@ -94,7 +93,7 @@ class SealResponseTest extends AbstractModelTest<SealResponse> {
|
||||
void jsonRoundtripSealed() {
|
||||
// First test sealed Vault's response.
|
||||
SealResponse res = assertDoesNotThrow(
|
||||
() -> new ObjectMapper().readValue(RES_SEALED, SealResponse.class),
|
||||
() -> objectMapper.readValue(RES_SEALED, SealResponse.class),
|
||||
"SealResponse deserialization failed"
|
||||
);
|
||||
assertNotNull(res, "Parsed response is NULL");
|
||||
@ -116,7 +115,7 @@ class SealResponseTest extends AbstractModelTest<SealResponse> {
|
||||
|
||||
// Not test unsealed Vault's response.
|
||||
res = assertDoesNotThrow(
|
||||
() -> new ObjectMapper().readValue(RES_UNSEALED, SealResponse.class),
|
||||
() -> objectMapper.readValue(RES_UNSEALED, SealResponse.class),
|
||||
"SealResponse deserialization failed"
|
||||
);
|
||||
assertNotNull(res, "Parsed response is NULL");
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -17,7 +17,6 @@
|
||||
package de.stklcode.jvault.connector.model.response;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import de.stklcode.jvault.connector.model.AbstractModelTest;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@ -54,7 +53,7 @@ class SecretListResponseTest extends AbstractModelTest<SecretListResponse> {
|
||||
@Override
|
||||
protected SecretListResponse createFull() {
|
||||
try {
|
||||
return new ObjectMapper().readValue(JSON, SecretListResponse.class);
|
||||
return objectMapper.readValue(JSON, SecretListResponse.class);
|
||||
} catch (JsonProcessingException e) {
|
||||
fail("Creation of full model instance failed", e);
|
||||
return null;
|
||||
@ -67,7 +66,7 @@ class SecretListResponseTest extends AbstractModelTest<SecretListResponse> {
|
||||
@Test
|
||||
void getKeysTest() {
|
||||
SecretListResponse res = assertDoesNotThrow(
|
||||
() -> new ObjectMapper().readValue(JSON, SecretListResponse.class),
|
||||
() -> objectMapper.readValue(JSON, SecretListResponse.class),
|
||||
"SecretListResponse deserialization failed"
|
||||
);
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -17,7 +17,6 @@
|
||||
package de.stklcode.jvault.connector.model.response;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import de.stklcode.jvault.connector.model.AbstractModelTest;
|
||||
import org.junit.jupiter.api.Test;
|
||||
|
||||
@ -50,7 +49,7 @@ class SecretVersionResponseTest extends AbstractModelTest<SecretVersionResponse>
|
||||
@Override
|
||||
protected SecretVersionResponse createFull() {
|
||||
try {
|
||||
return new ObjectMapper().readValue(META_JSON, SecretVersionResponse.class);
|
||||
return objectMapper.readValue(META_JSON, SecretVersionResponse.class);
|
||||
} catch (JsonProcessingException e) {
|
||||
fail("Creation of full model instance failed", e);
|
||||
return null;
|
||||
@ -63,7 +62,7 @@ class SecretVersionResponseTest extends AbstractModelTest<SecretVersionResponse>
|
||||
@Test
|
||||
void jsonRoundtrip() {
|
||||
SecretVersionResponse res = assertDoesNotThrow(
|
||||
() -> new ObjectMapper().readValue(META_JSON, SecretVersionResponse.class),
|
||||
() -> objectMapper.readValue(META_JSON, SecretVersionResponse.class),
|
||||
"SecretVersionResponse deserialization failed"
|
||||
);
|
||||
assertNotNull(res, "Parsed response is NULL");
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@ -17,7 +17,6 @@
|
||||
package de.stklcode.jvault.connector.model.response;
|
||||
|
||||
import com.fasterxml.jackson.core.JsonProcessingException;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
import de.stklcode.jvault.connector.model.AbstractModelTest;
|
||||
import de.stklcode.jvault.connector.model.response.embedded.TokenData;
|
||||
import org.junit.jupiter.api.Test;
|
||||
@ -96,7 +95,7 @@ class TokenResponseTest extends AbstractModelTest<TokenResponse> {
|
||||
@Override
|
||||
protected TokenResponse createFull() {
|
||||
try {
|
||||
return new ObjectMapper().readValue(RES_JSON, TokenResponse.class);
|
||||
return objectMapper.readValue(RES_JSON, TokenResponse.class);
|
||||
} catch (JsonProcessingException e) {
|
||||
fail("Creation of full model instance failed", e);
|
||||
return null;
|
||||
@ -119,7 +118,7 @@ class TokenResponseTest extends AbstractModelTest<TokenResponse> {
|
||||
@Test
|
||||
void jsonRoundtrip() {
|
||||
TokenResponse res = assertDoesNotThrow(
|
||||
() -> new ObjectMapper().readValue(RES_JSON, TokenResponse.class),
|
||||
() -> objectMapper.readValue(RES_JSON, TokenResponse.class),
|
||||
"TokenResponse deserialization failed"
|
||||
);
|
||||
assertNotNull(res, "Parsed response is NULL");
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2016-2022 Stefan Kalscheuer
|
||||
* Copyright 2016-2023 Stefan Kalscheuer
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
|
@ -1 +1 @@
|
||||
{"Value":"AAAAAQKHd7fFuNKfj/RnIQoxQEOTorNNl1NfcVtynLwYvtvZGDvhAO34YmOFKJSQVSiT4Js08ik48DWWnZHCZzAyMlK0HqNGYQRzCkuHkzYpH0uLrTcddXLuKyc7j6IiRTl3qYb1pzdlTzDtlwsi4J7s+7orETS146yY/GnGPWM/Tmet7p5qOECRq7m04gBX0pnwZl12iRqWG4aHHY5D4aFp9KjKUBKCIhz2Tb9wcSKV/Aa/ct1d0K0k8pyu1r1OkaJqCQXQeIaJR/WBMECR4omezvg7IGCoBIkMjwFR1urSaB0xNdgk+ByZE0C5zeDfmVRylYlypPAlIBrGL/Q/d6+NWiiOzXdoQoqAa/Pyg7e2gClsKDBFDvSL1QVBdsnBIskDeig2t46Ew5qM00wY58BWlUxqjlCgsNm3nPHtWpc6+XiR4ZkEZ9VeEIQhwC/R+NxS+QCDKeuSfyZM3OqQBwOx22mTL0i86YzlUph0alBmDF1b1FkDbg46MSWTANrkov1LPDnOvvNet7pb0L6exN5Q+HKitmxn36E0KAiqj1hEaHMZF6Pe+IIScLPClgPNeMkZWLeD5kvLv9kfObTYneHVHqj8O9jGtk03T4vOoaUNJY9U0irBGzlV+GkneJUgBL1QBspfK4GvFvUrd0Ds/teayJba8HDxlpCEWr6h062BXsNPg5gUn4H/uvginsFng02M8IyrDA1QOb4XS1zdfrvq"}
|
||||
{"Value":"AAAAAQK788ueZMqWkxK0+QrdrSU6/fJE0BHpMFCmXuZch21YdFNQSxZwgbTTH6uAyzxlEpHvAa4v9ScNyYXqRCLFK4X0DtDmpheIr/Ow6BPU8yxNglfI+qW5SKZKeYAYMHal0jX1MYsaIdYp8LJm52VMa+CdjTRx1J7ZhrNqiNHXbVJr6uOM+FDbGU4W8LyDy1ZhBKo17fwMnOycl5vBHu7b964iVHAIDkZHBq/4N1R/w7Sne7K/JvNPfuBNd1evRSErRNJRPp4DEkpK2v8lgIAXFjemE+aOysWYjGh/XVi8EzP09K1QFwfsvgIeIX0XVP4wMNn2xHedDyWQV55FJbD1LcrM2Q54HAHM0YGItI+MwPPzmP06Udoq3PZNRMWRI3l1rdjnIT+3FtbJr43EF8mf6SuYCzf9QWkGkixWAPAsMO+ZYCkHfsp8Ebq5IQmgK2IXzR7Dw8+tizs+8jaXB5JJ1vru0dZJa3b1oV9eizW5U53yIWNhC2v/d0rVxivvMbZ2deAP9OaqXm+oFukIjaFHDNbAskqvpHh8/7e91fqDFla2ZNEEPtVSsBBmyKHO0gDiDHKC3T2hrvvSRHsMHplIpD1mnppE2E4BlngIDgrfAe3G2jKUHg9eYLq9dMXBeysfzc8UtBI="}
|
||||
|
@ -0,0 +1 @@
|
||||
{"Value":"AAAAAQINZKQEssY4IzHI/0k27nBtxSvnC6LkivYrqky6CblcjyAmQIg/4/cKQIBCXzmrWEv/SqMQbLw+4Lp63Xu1niF+U0NbyqDmFaPqnD2yfPs7meXvZr21+P9E/0APZMHQaSR7DIEY46zedHRjQ/pkhR2Axcjuy5gdfzBzC2XvUcNqdyR0pQwcDwGhAIdO0gxJfZCeBuvv8ceYS+aPs4gDHtIlA3szi+5qAQ8HvPBTDKQn1lHVYnzTdNbMS7v3mtzCyG8AeMkaUw=="}
|
@ -0,0 +1 @@
|
||||
{"Value":"AAAAAQJiN0bHxM8aNJpY7aHGZ/p3qOhJbd7JIXwFMEI4LtKmO6pP5Oa4P5z+2LK+2qzZhhX/iDeM4u+nR+lxt/GsBPKf"}
|
@ -0,0 +1 @@
|
||||
{"Value":"AAAAAQIZ5rvzLtBcBQvWqwwDoRADwUo6W0ECKgmcvXejbLKiYcbO0hP8fceCqB12J41wxcMViQ8vvWoIgyOX2HwcZS09GGCqQbjvyVfz/w+kyox9dJzr845f26tJjHVYlHX2YFsnxytwe5qCKdCsD5QP9kyz8J0="}
|
@ -0,0 +1 @@
|
||||
{"Value":"AAAAAQJIKXgvJ2Prr92Fn7qZK/WZxb+Q+vJsXyjMo44en/+zqbbnLfs5m7uH7hEUOfDM/MjzTrhfkOWxf6qcrC4MR3ocrFJwtbJ6j+QrNLg61gVIiLBUVBkvh8ErqCFnSjNIqhaIMQhuZXWANsgGF9K2+HBGJerWGe26C1rdWRZV4J0M23HnxLBf8aYDlOfkHe24I30rHUqXIk9/BKEuekcnhETw9Tx4Fk7KxxxEdGmHPbg+4G14c27wVj8IrpWHBpyLmt55Qdb/y24i5RzFYv1FQ2kQZIO6TQiYkwAUxJ5cIdCiAsEDNt+rBJ9zX1MvkEfkVj/WvzC9pxB7ad+j5vYIJgCUD1o09t0w2ChjBojGoOAWDSvNAeY8kr5PDKwYk+gBY5M2JHDI6ELvOVu8gsW+sqk9St9V3VisShTfU3+qln7TOWw/LQ+fUzGvYrAWG6UyPVpIEYeNmN0iGCIM8rzjQYvVC3KcQMG96MwK3ZlSQzgPpvTGxNxFm2omTn3ue7QHn7Ni6+c/K6xVy0bbJ+jS4yyfl2wFBm1tF1l3BITLqw3TiP3LEw=="}
|
@ -0,0 +1 @@
|
||||
{"Value":"AAAAAQIUt2iYYy9zOwkx1mtNMHt69RjdHbUmcN8zydVQTMGjhv1kjEW+d4AaBv1qE22rPTs0xL3pJ1AjIvkBXXVBAuc/FE63t5dE81Fa+MvSY4tBeMtl6i09ykkAYyQUeeV2HlbjRpMUwPyq2QIslYw3d4lc73yT0S82s5I3MfjodKmDpheWMOgg5hGes/wstBHN5HEZkKV8gOPRZ/BsTM7tMXH1piM/JT8sNfsDh6TAGD1OEsS+N2QlKvS4yImNzcKrH0EgdkXB4sRZ9e/SmMaEVaagB1n0M5LukC+pyExgC7eK4EU8o2Xye3iij3YMWBaGollDzJBJFP5aSO4E5u+NnRc5/ZbLRCbqgfQj8IY86WF9hya31aJxbc8Pg28Yfez8hbGRJZZws/ojIUgEz+VtH3OyaW2Wohnycop7i4fK8xlJ2gYOGvlw43czOH6Y6joTce+QBZWI7KR6ugB0dI8pnK2eFy14OZeww1NEew7r1u7PgD10Obg8okIJSD8cGkxUHu/oOLxvKKOAJBLSPfKnJfKEiKrqYED7EPkmgP/t7okvo4c95qeuWy1BLtKfxw5lkv0="}
|
@ -0,0 +1 @@
|
||||
{"Value":"AAAAAQKv0Yr+QFSWxYe8o51TBwGz/yAhNYFmkNHPISEK6EbIVGkpEJMHFYvHWxTXUzF7f2/a"}
|
@ -0,0 +1 @@
|
||||
{"Value":"AAAAAQKs2/ICwQPLv6siBGDbBnB52fBVo52BkSKGvm74p4oHrdMEvejJ4cJljOADYyDT2QYa"}
|
@ -0,0 +1 @@
|
||||
{"Value":"AAAAAQIq05o3NmsucipTxPrcRbT1sXpAJ8w2PpiShnof74Kuzf/4kkHj3AZL5AObGFLAkYUvUrv3RRmYBIhw6Jk4FCbgdQyJAjPNVUTwBun/kQVyzP5sQ9hUFgHJwINomtVDiDgPkOc92zk8ydr1hfnMmTAtS71G3xloHDn6CF/1Y9WI1PkHdSkZ8d+yBNxr+qjGyewrV3QVmQvAfpY56uQ6AOztItD9NgiPrtNP+clbCczsieY6Y9Ce2FZawmuKFi9svMcBtnEcMILV/SGt4iCiMgFwkCJ9gQsGEdWPifu6ITPB92LgT4Ccw4gVRO31QVcPl6S+FG6iCeN6lk2yRXYjyhBuU+GklouEZIsA6SoxlIXPZuvauyS1MWwMxtSOQUFVYr3kvtXzCpcpEHDyBOEUdxPaYUZXHNdhGtMr/JuJCN50t0ng5mEAqfhjoJfJ/tBTqAjySj4zmEHuY0RnqYLPmsp203Q="}
|
1
src/test/resources/data_dir_legacy/core/_audit
Normal file
1
src/test/resources/data_dir_legacy/core/_audit
Normal file
@ -0,0 +1 @@
|
||||
{"Value":"AAAAAQI695zhv1Tv/6m1Fx/L62lITd+ZWCi+xCDHkev2YtCSIDPrZgNzYnrCHG3cUjBePZt6NYUSgzvZTXbxZPN4rK2rPj/BN9xj9v1vH1woOMY6lNPmBR7r"}
|
1
src/test/resources/data_dir_legacy/core/_auth
Normal file
1
src/test/resources/data_dir_legacy/core/_auth
Normal file
@ -0,0 +1 @@
|
||||
{"Value":"AAAAAQKHd7fFuNKfj/RnIQoxQEOTorNNl1NfcVtynLwYvtvZGDvhAO34YmOFKJSQVSiT4Js08ik48DWWnZHCZzAyMlK0HqNGYQRzCkuHkzYpH0uLrTcddXLuKyc7j6IiRTl3qYb1pzdlTzDtlwsi4J7s+7orETS146yY/GnGPWM/Tmet7p5qOECRq7m04gBX0pnwZl12iRqWG4aHHY5D4aFp9KjKUBKCIhz2Tb9wcSKV/Aa/ct1d0K0k8pyu1r1OkaJqCQXQeIaJR/WBMECR4omezvg7IGCoBIkMjwFR1urSaB0xNdgk+ByZE0C5zeDfmVRylYlypPAlIBrGL/Q/d6+NWiiOzXdoQoqAa/Pyg7e2gClsKDBFDvSL1QVBdsnBIskDeig2t46Ew5qM00wY58BWlUxqjlCgsNm3nPHtWpc6+XiR4ZkEZ9VeEIQhwC/R+NxS+QCDKeuSfyZM3OqQBwOx22mTL0i86YzlUph0alBmDF1b1FkDbg46MSWTANrkov1LPDnOvvNet7pb0L6exN5Q+HKitmxn36E0KAiqj1hEaHMZF6Pe+IIScLPClgPNeMkZWLeD5kvLv9kfObTYneHVHqj8O9jGtk03T4vOoaUNJY9U0irBGzlV+GkneJUgBL1QBspfK4GvFvUrd0Ds/teayJba8HDxlpCEWr6h062BXsNPg5gUn4H/uvginsFng02M8IyrDA1QOb4XS1zdfrvq"}
|
1
src/test/resources/data_dir_legacy/core/_keyring
Normal file
1
src/test/resources/data_dir_legacy/core/_keyring
Normal file
@ -0,0 +1 @@
|
||||
{"Value":"AAAAAQKyaZ3WVPXS+CbQr/JTfSM4yHT5DN21JfJlKh7ALVkue05z4cy703LvXnlfx5ZRqszSbFAe98ZzwELK89SEq26v2GYe2/7tFYeIAp0YvWNe5uahL0N6KUhFArPtC9gMV+9f7ZdjRDS6AKIHmzWRiXVtTsb+j4MnE+RM9NmwmvpDDTRAFgzjxEQ9IT/nGXieacg49U8NhjmZMh9Dt/7db3e5bGRJFDc3IDuF5xgHr5q+NJBbGrU3X1siH0oiCUbHUKsssmbVI0rwf6lkhvFQIIckYRgwL8/70WjrfELZeN+CgBliwQ=="}
|
1
src/test/resources/data_dir_legacy/core/_local-audit
Normal file
1
src/test/resources/data_dir_legacy/core/_local-audit
Normal file
@ -0,0 +1 @@
|
||||
{"Value":"AAAAAQII71tl2nQI+IFOoGw3z5x+xUwHdaZUXNW2GLNCJaq7tc2Lv3cLz9loi+q9yDVm/tVDhqK8k0D8lA2adOOGXOiaituANawDLAZu8VrwzpX73+mwtoEk"}
|
1
src/test/resources/data_dir_legacy/core/_local-auth
Normal file
1
src/test/resources/data_dir_legacy/core/_local-auth
Normal file
@ -0,0 +1 @@
|
||||
{"Value":"AAAAAQKKxZ6U5JakeVWOBYonzhPVLF2WNyxMYFqpYnb000GLiTWD0kLJQG5rBFyPadehhAmlQQvy7zDpCf5RCcsZbeCTSIA9yUiGp+G2uBsXAgLYKRocHTw="}
|
1
src/test/resources/data_dir_legacy/core/_local-mounts
Normal file
1
src/test/resources/data_dir_legacy/core/_local-mounts
Normal file
@ -0,0 +1 @@
|
||||
{"Value":"AAAAAQJEF2Kc5GCivEaBANB/amJG+W92c2JbCPoQsFfTNcycNMXgy4famQHdKIBQgp+44HNa+OLTfzOoO4gO0c8pk9mvZrLHN4Bb0ot1aC/pmaT7MGn+6ZyrpyHr86oqMc/Dl91bV2bZjsCosUhZAQDhyjXLm2IVgAU51TldHuDvz3+yWvn5rorZiyDAo4bIYhA8QPlCM71heQMVTXWk3/IynsO6gsg25vJpLrJXO2ixDo2gWsVOH1PD0Qu2dPsRyHcdER4HYmCWcPcLS+0kKsspsAEZrqch45OKd0zrWtWrrlf3QLBFhw2N/gWVy4alSNuzYgJHf25k4xotsjO5S2H8qeWJd9qllHKUuci8fa3V8OtE03xlQM2UYkKm4pf++Xjrwc2HZhHXPP8c7Ufo6bJLYmB79GMv0HmsVpBieze/+XqvibVccdoUAw=="}
|
1
src/test/resources/data_dir_legacy/core/_master
Normal file
1
src/test/resources/data_dir_legacy/core/_master
Normal file
@ -0,0 +1 @@
|
||||
{"Value":"AAAAAQL1R9YHyyYMvRbw3Q5EU2oYcg77tz5teL6j9/fzZWhU953/pLdeNSLvTThDX9S9/1PX7awbCihQgV3X+buJVpaSZi4Zpo6T/emsgS3U/Hp8Ml+B8xLhbNeTZ7Swi0rL1X//qYEp8BA7znHHbaL5CWbiaTdP1oZAnfS72FvhjZ4kdQge0Vtyoxrmyy+6K18S"}
|
1
src/test/resources/data_dir_legacy/core/_mounts
Normal file
1
src/test/resources/data_dir_legacy/core/_mounts
Normal file
@ -0,0 +1 @@
|
||||
{"Value":"AAAAAQIOTEuNxtf2ZfGu6k9+65GFonDBiaetJnyLYFk1qfWPrE/VqUunbxuTv/QyK4pgC/q14sqypdxPe4Ygp/5mxzzuY6JXB0VKiDMXe9R5BltTG7++rLmKH/j+G7nEh71LER1/qVktU6x8dmDmTbpTgl5xzAB5DIXLMMKjjWda/7qJ3ivNI0pEOQ3JyT27SkqjqM49Dp1JIgKnjIEVQORqKcsSP+aqIncMjIo2iGXOGlDYAesp5tZ4hln3VCwXaIlrU8z6Mmntgcg7NeK/O2WTl86K644dbJUh6frGFDujrjOh/Pgp9n9u0BI3E9K9GD1Z1S1wEb1MCqzT/e9oHG7I7D8ku8PH11wGWGH6BmYlESYUG/KRVqu0XOQEfroLHZQiLE00yHBdStW/UJ9y5pmGpu1aiQ88Q8fpjF5xmRey99b4c6KUIpHjw5Af0XA9ZKsEJUyjS/dbMKPM6PBOW21LYefXH5b0poXMWgLW6LJV0zLuVMyVZJqANbzCVtheDPSsEjkHHwR/CLa2zs2Z6wJF3j1GDZxUFf4nbnuXQzz3M3kVPPtS6htlb0d8RN0/dkOrqUue+c4UjnXhiacXyVUnQQzUVu0sGak4vrQi0020aBzMXM2ZG7rNgvw+wcYFS4txO90kwJL6aOMXT2BeJiQ3wjjHb7M74/sSd0ffRTUlJSODSDotO7Q7Dfcnc1FLrIhXPRFPavTjFoL5HRy77xuGG7U7jTMoGra+rK54v0sxqKbS5WZi1hADQmAVIO8bPb+jA1qoejRFygW6sLgAdmEFQQJOhCV/BoKP3A=="}
|
1
src/test/resources/data_dir_legacy/core/_seal-config
Normal file
1
src/test/resources/data_dir_legacy/core/_seal-config
Normal file
@ -0,0 +1 @@
|
||||
{"Value":"eyJ0eXBlIjoic2hhbWlyIiwic2VjcmV0X3NoYXJlcyI6Mywic2VjcmV0X3RocmVzaG9sZCI6MiwicGdwX2tleXMiOm51bGwsIm5vbmNlIjoiIiwiYmFja3VwIjpmYWxzZSwic3RvcmVkX3NoYXJlcyI6MH0="}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user