Compare commits
9 Commits
Author | SHA1 | Date | |
---|---|---|---|
f9fe57230f
|
|||
e0c33b51e4
|
|||
5e6dcc64cd
|
|||
70b7338f3e
|
|||
489e450dc8
|
|||
909eab762c
|
|||
abba4dff93
|
|||
712fab04e1
|
|||
39ac32a2f6
|
@ -25,7 +25,7 @@ steps:
|
|||||||
- name: setup-vault
|
- name: setup-vault
|
||||||
image: alpine:latest
|
image: alpine:latest
|
||||||
environment:
|
environment:
|
||||||
VAULT_VERSION: 1.12.0
|
VAULT_VERSION: 1.12.2
|
||||||
commands:
|
commands:
|
||||||
- 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 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
|
- wget -q -O - https://releases.hashicorp.com/vault/$${VAULT_VERSION}/vault_$${VAULT_VERSION}_SHA256SUMS | grep linux_amd64 | sha256sum -c
|
||||||
@ -40,7 +40,7 @@ steps:
|
|||||||
- name: unit-integration-tests
|
- name: unit-integration-tests
|
||||||
image: maven:3-eclipse-temurin-17
|
image: maven:3-eclipse-temurin-17
|
||||||
environment:
|
environment:
|
||||||
VAULT_VERSION: 1.12.0
|
VAULT_VERSION: 1.12.2
|
||||||
commands:
|
commands:
|
||||||
- export PATH=.bin:$${PATH}
|
- export PATH=.bin:$${PATH}
|
||||||
- mvn -B -P integration-test verify
|
- mvn -B -P integration-test verify
|
||||||
|
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -6,7 +6,7 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
jdk: [ 11, 17, 19 ]
|
jdk: [ 11, 17, 19 ]
|
||||||
vault: [ '1.2.0', '1.11.4', '1.12.0' ]
|
vault: [ '1.2.0', '1.11.4', '1.12.2' ]
|
||||||
include:
|
include:
|
||||||
- jdk: 17
|
- jdk: 17
|
||||||
vault: '1.11.4'
|
vault: '1.11.4'
|
||||||
@ -40,7 +40,7 @@ jobs:
|
|||||||
if: github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/heads/release/')
|
if: github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/heads/release/')
|
||||||
run: mvn -B -P coverage verify
|
run: mvn -B -P coverage verify
|
||||||
- name: Analysis
|
- name: Analysis
|
||||||
if: matrix.analysis && github.event_name == 'push'
|
if: matrix.analysis
|
||||||
run: >
|
run: >
|
||||||
mvn -B sonar:sonar
|
mvn -B sonar:sonar
|
||||||
-Dsonar.host.url=https://sonarcloud.io
|
-Dsonar.host.url=https://sonarcloud.io
|
||||||
|
21
.gitignore
vendored
21
.gitignore
vendored
@ -1,5 +1,16 @@
|
|||||||
/target/
|
target/
|
||||||
/*.iml
|
pom.xml.tag
|
||||||
/.idea/
|
pom.xml.releaseBackup
|
||||||
/*.project
|
pom.xml.versionsBackup
|
||||||
*~
|
pom.xml.next
|
||||||
|
release.properties
|
||||||
|
dependency-reduced-pom.xml
|
||||||
|
buildNumber.properties
|
||||||
|
.mvn/timing.properties
|
||||||
|
|
||||||
|
.idea
|
||||||
|
*.iml
|
||||||
|
|
||||||
|
.bin
|
||||||
|
|
||||||
|
*~
|
||||||
|
15
CHANGELOG.md
15
CHANGELOG.md
@ -1,3 +1,18 @@
|
|||||||
|
## 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)
|
## 1.1.2 (2022-10-26)
|
||||||
|
|
||||||
### Dependencies
|
### Dependencies
|
||||||
|
@ -32,7 +32,7 @@ Java Vault Connector is a connector library for [Vault](https://www.vaultproject
|
|||||||
* SQL secret handling
|
* SQL secret handling
|
||||||
* KV v1 and v2 support
|
* KV v1 and v2 support
|
||||||
* Connector Factory with builder pattern
|
* Connector Factory with builder pattern
|
||||||
* Tested against Vault 1.2.0 to 1.12.0
|
* Tested against Vault 1.2.0 to 1.12.2
|
||||||
|
|
||||||
|
|
||||||
## Maven Artifact
|
## Maven Artifact
|
||||||
@ -40,7 +40,7 @@ Java Vault Connector is a connector library for [Vault](https://www.vaultproject
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>de.stklcode.jvault</groupId>
|
<groupId>de.stklcode.jvault</groupId>
|
||||||
<artifactId>jvault-connector</artifactId>
|
<artifactId>jvault-connector</artifactId>
|
||||||
<version>1.1.2</version>
|
<version>1.1.3</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
12
pom.xml
12
pom.xml
@ -4,7 +4,7 @@
|
|||||||
|
|
||||||
<groupId>de.stklcode.jvault</groupId>
|
<groupId>de.stklcode.jvault</groupId>
|
||||||
<artifactId>jvault-connector</artifactId>
|
<artifactId>jvault-connector</artifactId>
|
||||||
<version>1.1.2</version>
|
<version>1.1.3</version>
|
||||||
|
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
|
|
||||||
@ -134,19 +134,19 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
<artifactId>jackson-databind</artifactId>
|
<artifactId>jackson-databind</artifactId>
|
||||||
<version>2.13.4.2</version>
|
<version>2.14.2</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.junit.jupiter</groupId>
|
<groupId>org.junit.jupiter</groupId>
|
||||||
<artifactId>junit-jupiter</artifactId>
|
<artifactId>junit-jupiter</artifactId>
|
||||||
<version>5.9.1</version>
|
<version>5.9.2</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.mockito</groupId>
|
<groupId>org.mockito</groupId>
|
||||||
<artifactId>mockito-core</artifactId>
|
<artifactId>mockito-core</artifactId>
|
||||||
<version>4.8.1</version>
|
<version>5.1.1</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -158,7 +158,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.github.tomakehurst</groupId>
|
<groupId>com.github.tomakehurst</groupId>
|
||||||
<artifactId>wiremock-jre8</artifactId>
|
<artifactId>wiremock-jre8</artifactId>
|
||||||
<version>2.34.0</version>
|
<version>2.35.0</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
@ -170,7 +170,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>nl.jqno.equalsverifier</groupId>
|
<groupId>nl.jqno.equalsverifier</groupId>
|
||||||
<artifactId>equalsverifier</artifactId>
|
<artifactId>equalsverifier</artifactId>
|
||||||
<version>3.10.1</version>
|
<version>3.12.4</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016-2022 Stefan Kalscheuer
|
* Copyright 2016-2023 Stefan Kalscheuer
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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
|
* @since 0.1
|
||||||
*/
|
*/
|
||||||
public class HTTPVaultConnector implements VaultConnector {
|
public class HTTPVaultConnector implements VaultConnector {
|
||||||
private static final String PATH_SEAL_STATUS = "sys/seal-status";
|
private static final String PATH_SYS = "sys";
|
||||||
private static final String PATH_SEAL = "sys/seal";
|
private static final String PATH_SYS_AUTH = PATH_SYS + "/auth";
|
||||||
private static final String PATH_UNSEAL = "sys/unseal";
|
private static final String PATH_RENEW = PATH_SYS + "/leases/renew";
|
||||||
private static final String PATH_RENEW = "sys/leases/renew";
|
private static final String PATH_REVOKE = PATH_SYS + "/leases/revoke/";
|
||||||
private static final String PATH_AUTH = "sys/auth";
|
private static final String PATH_HEALTH = PATH_SYS + "/health";
|
||||||
private static final String PATH_TOKEN = "auth/token";
|
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_LOOKUP = "/lookup";
|
||||||
private static final String PATH_CREATE = "/create";
|
private static final String PATH_CREATE = "/create";
|
||||||
private static final String PATH_ROLES = "/roles";
|
private static final String PATH_ROLES = "/roles";
|
||||||
private static final String PATH_CREATE_ORPHAN = "/create-orphan";
|
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_USERPASS = PATH_AUTH + "/userpass/login/";
|
||||||
private static final String PATH_AUTH_APPID = "auth/app-id/";
|
private static final String PATH_AUTH_APPID = PATH_AUTH + "/app-id";
|
||||||
private static final String PATH_AUTH_APPROLE = "auth/approle/";
|
private static final String PATH_AUTH_APPROLE = PATH_AUTH + "/approle";
|
||||||
private static final String PATH_AUTH_APPROLE_ROLE = "auth/approle/role/%s%s";
|
private static final String PATH_AUTH_APPROLE_ROLE = PATH_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_DATA = "/data/";
|
private static final String PATH_DATA = "/data/";
|
||||||
private static final String PATH_METADATA = "/metadata/";
|
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_DELETE = "/delete/";
|
||||||
private static final String PATH_UNDELETE = "/undelete/";
|
private static final String PATH_UNDELETE = "/undelete/";
|
||||||
private static final String PATH_DESTROY = "/destroy/";
|
private static final String PATH_DESTROY = "/destroy/";
|
||||||
@ -139,11 +145,10 @@ public class HTTPVaultConnector implements VaultConnector {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final SealResponse unseal(final String key, final Boolean reset) throws VaultConnectorException {
|
public final SealResponse unseal(final String key, final Boolean reset) throws VaultConnectorException {
|
||||||
Map<String, String> param = new HashMap<>(2, 1);
|
Map<String, String> param = mapOfStrings(
|
||||||
param.put("key", key);
|
"key", key,
|
||||||
if (reset != null) {
|
"reset", reset
|
||||||
param.put("reset", reset.toString());
|
);
|
||||||
}
|
|
||||||
|
|
||||||
return request.put(PATH_UNSEAL, param, token, SealResponse.class);
|
return request.put(PATH_UNSEAL, param, token, SealResponse.class);
|
||||||
}
|
}
|
||||||
@ -172,7 +177,7 @@ public class HTTPVaultConnector implements VaultConnector {
|
|||||||
@Override
|
@Override
|
||||||
public final List<AuthBackend> getAuthBackends() throws VaultConnectorException {
|
public final List<AuthBackend> getAuthBackends() throws VaultConnectorException {
|
||||||
/* Issue request and parse response */
|
/* 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());
|
return amr.getSupportedMethods().values().stream().map(AuthMethod::getType).collect(Collectors.toList());
|
||||||
}
|
}
|
||||||
@ -182,7 +187,7 @@ public class HTTPVaultConnector implements VaultConnector {
|
|||||||
/* set token */
|
/* set token */
|
||||||
this.token = token;
|
this.token = token;
|
||||||
this.tokenTTL = 0;
|
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;
|
authorized = true;
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
@ -196,10 +201,10 @@ public class HTTPVaultConnector implements VaultConnector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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 {
|
public final AuthResponse authAppId(final String appID, final String userID) throws VaultConnectorException {
|
||||||
return queryAuth(
|
return queryAuth(
|
||||||
PATH_AUTH_APPID + "login",
|
PATH_AUTH_APPID + PATH_LOGIN,
|
||||||
Map.of(
|
Map.of(
|
||||||
"app_id", appID,
|
"app_id", appID,
|
||||||
"user_id", userID
|
"user_id", userID
|
||||||
@ -209,12 +214,11 @@ public class HTTPVaultConnector implements VaultConnector {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final AuthResponse authAppRole(final String roleID, final String secretID) throws VaultConnectorException {
|
public final AuthResponse authAppRole(final String roleID, final String secretID) throws VaultConnectorException {
|
||||||
final Map<String, String> payload = new HashMap<>(2, 1);
|
final Map<String, String> payload = mapOfStrings(
|
||||||
payload.put("role_id", roleID);
|
"role_id", roleID,
|
||||||
if (secretID != null) {
|
"secret_id", secretID
|
||||||
payload.put("secret_id", secretID);
|
);
|
||||||
}
|
return queryAuth(PATH_AUTH_APPROLE + PATH_LOGIN, payload);
|
||||||
return queryAuth(PATH_AUTH_APPROLE + "login", payload);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -238,14 +242,14 @@ public class HTTPVaultConnector implements VaultConnector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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)
|
public final boolean registerAppId(final String appID, final String policy, final String displayName)
|
||||||
throws VaultConnectorException {
|
throws VaultConnectorException {
|
||||||
requireAuth();
|
requireAuth();
|
||||||
|
|
||||||
/* Issue request and expect code 204 with empty response */
|
/* Issue request and expect code 204 with empty response */
|
||||||
request.postWithoutResponse(
|
request.postWithoutResponse(
|
||||||
PATH_AUTH_APPID + "map/app-id/" + appID,
|
PATH_AUTH_APPID + "/map/app-id/" + appID,
|
||||||
Map.of(
|
Map.of(
|
||||||
"value", policy,
|
"value", policy,
|
||||||
"display_name", displayName
|
"display_name", displayName
|
||||||
@ -257,13 +261,13 @@ public class HTTPVaultConnector implements VaultConnector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@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 {
|
public final boolean registerUserId(final String appID, final String userID) throws VaultConnectorException {
|
||||||
requireAuth();
|
requireAuth();
|
||||||
|
|
||||||
/* Issue request and expect code 204 with empty response */
|
/* Issue request and expect code 204 with empty response */
|
||||||
request.postWithoutResponse(
|
request.postWithoutResponse(
|
||||||
PATH_AUTH_APPID + "map/user-id/" + userID,
|
PATH_AUTH_APPID + "/map/user-id/" + userID,
|
||||||
singletonMap("value", appID),
|
singletonMap("value", appID),
|
||||||
token
|
token
|
||||||
);
|
);
|
||||||
@ -384,7 +388,7 @@ public class HTTPVaultConnector implements VaultConnector {
|
|||||||
requireAuth();
|
requireAuth();
|
||||||
|
|
||||||
SecretListResponse secrets = request.get(
|
SecretListResponse secrets = request.get(
|
||||||
PATH_AUTH_APPROLE + "role?list=true",
|
PATH_AUTH_APPROLE + "/role?list=true",
|
||||||
emptyMap(),
|
emptyMap(),
|
||||||
token,
|
token,
|
||||||
SecretListResponse.class
|
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 {
|
public final SecretResponse readSecretVersion(final String mount, final String key, final Integer version) throws VaultConnectorException {
|
||||||
requireAuth();
|
requireAuth();
|
||||||
/* Request HTTP response and parse secret metadata */
|
/* Request HTTP response and parse secret metadata */
|
||||||
Map<String, String> args = new HashMap<>(1, 1);
|
Map<String, String> args = mapOfStrings("version", version);
|
||||||
if (version != null) {
|
|
||||||
args.put("version", version.toString());
|
|
||||||
}
|
|
||||||
|
|
||||||
return request.get(mount + PATH_DATA + key, args, token, MetaSecretResponse.class);
|
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 {
|
public void updateSecretMetadata(final String mount, final String key, final Integer maxVersions, final boolean casRequired) throws VaultConnectorException {
|
||||||
requireAuth();
|
requireAuth();
|
||||||
|
|
||||||
Map<String, Object> payload = new HashMap<>(2, 1);
|
Map<String, Object> payload = mapOf(
|
||||||
if (maxVersions != null) {
|
"max_versions", maxVersions,
|
||||||
payload.put("max_versions", maxVersions);
|
"cas_required", casRequired
|
||||||
}
|
);
|
||||||
payload.put("cas_required", casRequired);
|
|
||||||
|
|
||||||
write(mount + PATH_METADATA + key, payload);
|
write(mount + PATH_METADATA + key, payload);
|
||||||
}
|
}
|
||||||
@ -456,12 +456,7 @@ public class HTTPVaultConnector implements VaultConnector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add CAS value to options map if present.
|
// Add CAS value to options map if present.
|
||||||
Map<String, Object> options;
|
Map<String, Object> options = mapOf("cas", cas);
|
||||||
if (cas != null) {
|
|
||||||
options = singletonMap("cas", cas);
|
|
||||||
} else {
|
|
||||||
options = emptyMap();
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Issue request and parse metadata response */
|
/* Issue request and parse metadata response */
|
||||||
return request.post(
|
return request.post(
|
||||||
@ -572,11 +567,10 @@ public class HTTPVaultConnector implements VaultConnector {
|
|||||||
public final SecretResponse renew(final String leaseID, final Integer increment) throws VaultConnectorException {
|
public final SecretResponse renew(final String leaseID, final Integer increment) throws VaultConnectorException {
|
||||||
requireAuth();
|
requireAuth();
|
||||||
|
|
||||||
Map<String, String> payload = new HashMap<>(2, 1);
|
Map<String, String> payload = mapOfStrings(
|
||||||
payload.put("lease_id", leaseID);
|
"lease_id", leaseID,
|
||||||
if (increment != null) {
|
"increment", increment
|
||||||
payload.put("increment", increment.toString());
|
);
|
||||||
}
|
|
||||||
|
|
||||||
/* Issue request and parse secret response */
|
/* Issue request and parse secret response */
|
||||||
return request.put(PATH_RENEW, payload, token, SecretResponse.class);
|
return request.put(PATH_RENEW, payload, token, SecretResponse.class);
|
||||||
@ -584,12 +578,12 @@ public class HTTPVaultConnector implements VaultConnector {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final AuthResponse createToken(final Token token) throws VaultConnectorException {
|
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
|
@Override
|
||||||
public final AuthResponse createToken(final Token token, final boolean orphan) throws VaultConnectorException {
|
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
|
@Override
|
||||||
@ -597,7 +591,7 @@ public class HTTPVaultConnector implements VaultConnector {
|
|||||||
if (role == null || role.isEmpty()) {
|
if (role == null || role.isEmpty()) {
|
||||||
throw new InvalidRequestException("No role name specified.");
|
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
|
@Override
|
||||||
@ -632,7 +626,7 @@ public class HTTPVaultConnector implements VaultConnector {
|
|||||||
|
|
||||||
/* Request HTTP response and parse Secret */
|
/* Request HTTP response and parse Secret */
|
||||||
return request.get(
|
return request.get(
|
||||||
PATH_TOKEN + PATH_LOOKUP,
|
PATH_AUTH_TOKEN + PATH_LOOKUP,
|
||||||
singletonMap("token", token),
|
singletonMap("token", token),
|
||||||
token,
|
token,
|
||||||
TokenResponse.class
|
TokenResponse.class
|
||||||
@ -650,7 +644,7 @@ public class HTTPVaultConnector implements VaultConnector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Issue request and expect code 204 with empty response.
|
// 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;
|
return true;
|
||||||
}
|
}
|
||||||
@ -660,14 +654,14 @@ public class HTTPVaultConnector implements VaultConnector {
|
|||||||
requireAuth();
|
requireAuth();
|
||||||
|
|
||||||
// Request HTTP response and parse response.
|
// 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
|
@Override
|
||||||
public List<String> listTokenRoles() throws VaultConnectorException {
|
public List<String> listTokenRoles() throws VaultConnectorException {
|
||||||
requireAuth();
|
requireAuth();
|
||||||
|
|
||||||
return list(PATH_TOKEN + PATH_ROLES);
|
return list(PATH_AUTH_TOKEN + PATH_ROLES);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@ -679,7 +673,7 @@ public class HTTPVaultConnector implements VaultConnector {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Issue request and expect code 204 with empty response.
|
// 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;
|
return true;
|
||||||
}
|
}
|
||||||
@ -695,4 +689,42 @@ public class HTTPVaultConnector implements VaultConnector {
|
|||||||
throw new AuthorizationRequiredException();
|
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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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
|
* @param userID The User ID
|
||||||
* @return The {@link AuthResponse}
|
* @return The {@link AuthResponse}
|
||||||
* @throws VaultConnectorException on error
|
* @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;
|
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
|
* @param displayName Arbitrary name to display
|
||||||
* @return {@code true} on success
|
* @return {@code true} on success
|
||||||
* @throws VaultConnectorException on error
|
* @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)
|
boolean registerAppId(final String appID, final String policy, final String displayName)
|
||||||
throws VaultConnectorException;
|
throws VaultConnectorException;
|
||||||
|
|
||||||
@ -349,10 +351,10 @@ public interface VaultConnector extends AutoCloseable, Serializable {
|
|||||||
* @param userID The User-ID
|
* @param userID The User-ID
|
||||||
* @return {@code true} on success
|
* @return {@code true} on success
|
||||||
* @throws VaultConnectorException on error
|
* @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.
|
* 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;
|
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
|
* @param userID The User-ID
|
||||||
* @return {@code true} on success
|
* @return {@code true} on success
|
||||||
* @throws VaultConnectorException on error
|
* @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,
|
default boolean registerAppUserId(final String appID,
|
||||||
final String policy,
|
final String policy,
|
||||||
final String displayName,
|
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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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 {
|
public enum AuthBackend {
|
||||||
TOKEN("token"),
|
TOKEN("token"),
|
||||||
|
@Deprecated(since = "1.1.3", forRemoval = true)
|
||||||
APPID("app-id"),
|
APPID("app-id"),
|
||||||
APPROLE("approle"),
|
APPROLE("approle"),
|
||||||
USERPASS("userpass"),
|
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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -51,7 +51,7 @@ import static org.junit.jupiter.api.Assumptions.assumeTrue;
|
|||||||
* @since 0.1
|
* @since 0.1
|
||||||
*/
|
*/
|
||||||
class HTTPVaultConnectorIT {
|
class HTTPVaultConnectorIT {
|
||||||
private static String VAULT_VERSION = "1.12.0"; // The vault version this test is supposed to run against.
|
private static String VAULT_VERSION = "1.12.2"; // The vault version this test is supposed to run against.
|
||||||
private static final String KEY1 = "E38bkCm0VhUvpdCKGQpcohhD9XmcHJ/2hreOSY019Lho";
|
private static final String KEY1 = "E38bkCm0VhUvpdCKGQpcohhD9XmcHJ/2hreOSY019Lho";
|
||||||
private static final String KEY2 = "O5OHwDleY3IiPdgw61cgHlhsrEm6tVJkrxhF6QAnILd1";
|
private static final String KEY2 = "O5OHwDleY3IiPdgw61cgHlhsrEm6tVJkrxhF6QAnILd1";
|
||||||
private static final String KEY3 = "mw7Bm3nbt/UWa/juDjjL2EPQ04kiJ0saC5JEXwJvXYsB";
|
private static final String KEY3 = "mw7Bm3nbt/UWa/juDjjL2EPQ04kiJ0saC5JEXwJvXYsB";
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2016-2022 Stefan Kalscheuer
|
* Copyright 2016-2023 Stefan Kalscheuer
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
@ -33,6 +33,7 @@ class AuthBackendTest {
|
|||||||
* Test forType() method.
|
* Test forType() method.
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
|
@SuppressWarnings("deprecation")
|
||||||
void forTypeTest() {
|
void forTypeTest() {
|
||||||
assertEquals(AuthBackend.TOKEN, AuthBackend.forType("token"));
|
assertEquals(AuthBackend.TOKEN, AuthBackend.forType("token"));
|
||||||
assertEquals(AuthBackend.APPID, AuthBackend.forType("app-id"));
|
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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with 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");
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
* you may not use this file except in compliance with the License.
|
* you may not use this file except in compliance with the License.
|
||||||
|
Reference in New Issue
Block a user