test: minor adjustments for integration tests against Vault 1.10
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Accept token prefixes "hvb." and "b." as valid results for creation without specific preferences.
This commit is contained in:
parent
bd0c5b08fe
commit
912b9ec61b
10
.drone.yml
10
.drone.yml
@ -25,12 +25,12 @@ steps:
|
|||||||
- name: unit-integration-tests
|
- name: unit-integration-tests
|
||||||
image: maven:3-jdk-11
|
image: maven:3-jdk-11
|
||||||
environment:
|
environment:
|
||||||
VAULT_VERSION: 1.9.4
|
VAULT_VERSION: 1.10.0
|
||||||
commands:
|
commands:
|
||||||
- curl -s -o vault_1.9.4_linux_amd64.zip https://releases.hashicorp.com/vault/1.9.4/vault_1.9.4_linux_amd64.zip
|
- curl -s -o vault_1.10.0_linux_amd64.zip https://releases.hashicorp.com/vault/1.10.0/vault_1.10.0_linux_amd64.zip
|
||||||
- curl -s https://releases.hashicorp.com/vault/1.9.4/vault_1.9.4_SHA256SUMS | grep linux_amd64 | sha256sum -c
|
- curl -s https://releases.hashicorp.com/vault/1.10.0/vault_1.10.0_SHA256SUMS | grep linux_amd64 | sha256sum -c
|
||||||
- unzip vault_1.9.4_linux_amd64.zip
|
- unzip vault_1.10.0_linux_amd64.zip
|
||||||
- rm vault_1.9.4_linux_amd64.zip
|
- rm vault_1.10.0_linux_amd64.zip
|
||||||
- mv vault /bin/
|
- mv vault /bin/
|
||||||
- mvn -B -P integration-test verify
|
- mvn -B -P integration-test verify
|
||||||
when:
|
when:
|
||||||
|
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@ -6,10 +6,10 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
jdk: [ 11, 17 ]
|
jdk: [ 11, 17 ]
|
||||||
vault: [ '1.9.4' ]
|
vault: [ '1.10.0' ]
|
||||||
include:
|
include:
|
||||||
- jdk: 11
|
- jdk: 11
|
||||||
vault: '1.9.4'
|
vault: '1.10.0'
|
||||||
analysis: true
|
analysis: true
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
* Add support for `wrap_info` in data response models
|
* Add support for `wrap_info` in data response models
|
||||||
|
|
||||||
### Test
|
### Test
|
||||||
* Tested against Vault 1.9.4
|
* Tested against Vault 1.10.0
|
||||||
|
|
||||||
|
|
||||||
## 1.0.1 (2021-11-21)
|
## 1.0.1 (2021-11-21)
|
||||||
|
@ -49,7 +49,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.9.4"; // The vault version this test is supposed to run against.
|
private static String VAULT_VERSION = "1.10.0"; // 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";
|
||||||
@ -952,7 +952,11 @@ class HTTPVaultConnectorIT {
|
|||||||
.withType(Token.Type.BATCH)
|
.withType(Token.Type.BATCH)
|
||||||
.build();
|
.build();
|
||||||
res = assertDoesNotThrow(() -> connector.createToken(token4), "Token creation failed");
|
res = assertDoesNotThrow(() -> connector.createToken(token4), "Token creation failed");
|
||||||
assertTrue(res.getAuth().getClientToken().startsWith("b"), "Unexpected token prefix");
|
assertTrue(
|
||||||
|
// Expecting batch token. "hvb." Prefix as of Vault 1.10, "b." before.
|
||||||
|
res.getAuth().getClientToken().startsWith("b.") || res.getAuth().getClientToken().startsWith("hvb."),
|
||||||
|
"Unexpected token prefix"
|
||||||
|
);
|
||||||
assertEquals(1, res.getAuth().getPolicies().size(), "Invalid number of policies returned");
|
assertEquals(1, res.getAuth().getPolicies().size(), "Invalid number of policies returned");
|
||||||
assertTrue(res.getAuth().getPolicies().contains("batchpolicy"), "Custom policy policy not set");
|
assertTrue(res.getAuth().getPolicies().contains("batchpolicy"), "Custom policy policy not set");
|
||||||
assertFalse(res.getAuth().isRenewable(), "Token should not be renewable");
|
assertFalse(res.getAuth().isRenewable(), "Token should not be renewable");
|
||||||
|
Loading…
x
Reference in New Issue
Block a user