From d743f158f3f38c858a993e9fdf94c76b4ad5ae50 Mon Sep 17 00:00:00 2001 From: chris-j-h Date: Thu, 24 Oct 2019 10:08:26 +0100 Subject: [PATCH 01/21] [maven-release-plugin] prepare release tessera-0.10.1 --- argon2/pom.xml | 2 +- cli/admin-cli/pom.xml | 2 +- cli/cli-api/pom.xml | 6 +- cli/config-cli/pom.xml | 2 +- cli/pom.xml | 2 +- config-migration/pom.xml | 2 +- config/pom.xml | 2 +- data-migration/pom.xml | 2 +- ddls/pom.xml | 4 +- enclave/enclave-api/pom.xml | 2 +- enclave/enclave-jaxrs/pom.xml | 2 +- enclave/enclave-server/pom.xml | 2 +- enclave/pom.xml | 2 +- encryption/encryption-api/pom.xml | 2 +- encryption/encryption-jnacl/pom.xml | 2 +- encryption/encryption-kalium/pom.xml | 2 +- encryption/pom.xml | 2 +- key-generation/pom.xml | 2 +- key-vault/azure-key-vault/pom.xml | 2 +- key-vault/hashicorp-key-vault/pom.xml | 2 +- key-vault/key-vault-api/pom.xml | 2 +- key-vault/pom.xml | 2 +- pom.xml | 78 +++++++++---------- security/pom.xml | 2 +- server/jaxrs-client-unixsocket/pom.xml | 2 +- server/jersey-server/pom.xml | 2 +- server/pom.xml | 4 +- server/server-api/pom.xml | 2 +- server/server-utils/pom.xml | 2 +- server/websockets-server/pom.xml | 2 +- service-locator/pom.xml | 2 +- service-locator/service-locator-api/pom.xml | 2 +- .../service-locator-spring/pom.xml | 2 +- shared/pom.xml | 2 +- tessera-admin/pom.xml | 2 +- tessera-core/pom.xml | 2 +- tessera-data/pom.xml | 2 +- tessera-dist/pom.xml | 6 +- tessera-dist/tessera-app/pom.xml | 2 +- tessera-dist/tessera-grpc-dist/pom.xml | 2 +- tessera-dist/tessera-launcher/pom.xml | 4 +- tessera-dist/tessera-simple/pom.xml | 2 +- tessera-grpc/grpc-api/pom.xml | 2 +- tessera-grpc/grpc-server/pom.xml | 2 +- tessera-grpc/grpc-service/pom.xml | 4 +- tessera-grpc/grpc/pom.xml | 2 +- tessera-grpc/pom.xml | 8 +- tessera-jaxrs/admin-jaxrs/pom.xml | 4 +- tessera-jaxrs/common-jaxrs/pom.xml | 4 +- tessera-jaxrs/jaxrs-client/pom.xml | 2 +- tessera-jaxrs/pom.xml | 2 +- tessera-jaxrs/sync-jaxrs/pom.xml | 6 +- tessera-jaxrs/thirdparty-jaxrs/pom.xml | 4 +- tessera-jaxrs/transaction-jaxrs/pom.xml | 4 +- tessera-partyinfo/pom.xml | 2 +- tessera-sync/pom.xml | 6 +- test-utils/mock-jaxrs/pom.xml | 2 +- test-utils/mock-service-locator/pom.xml | 2 +- test-utils/mock-websocket-container/pom.xml | 2 +- test-utils/pom.xml | 2 +- tests/acceptance-test/pom.xml | 10 +-- tests/jmeter-test/pom.xml | 2 +- tests/pom.xml | 10 +-- tests/test-util/pom.xml | 2 +- 64 files changed, 128 insertions(+), 130 deletions(-) diff --git a/argon2/pom.xml b/argon2/pom.xml index 9b9fce95a9..521cf4ac77 100644 --- a/argon2/pom.xml +++ b/argon2/pom.xml @@ -11,7 +11,7 @@ tessera com.jpmorgan.quorum - 0.11-SNAPSHOT + 0.10.1 diff --git a/cli/admin-cli/pom.xml b/cli/admin-cli/pom.xml index 9a7b496344..972ca0f12a 100644 --- a/cli/admin-cli/pom.xml +++ b/cli/admin-cli/pom.xml @@ -3,7 +3,7 @@ cli com.jpmorgan.quorum - 0.11-SNAPSHOT + 0.10.1 4.0.0 diff --git a/cli/cli-api/pom.xml b/cli/cli-api/pom.xml index 8bef00af4a..ba83516a65 100644 --- a/cli/cli-api/pom.xml +++ b/cli/cli-api/pom.xml @@ -1,7 +1,5 @@ - + 4.0.0 @@ -12,7 +10,7 @@ cli com.jpmorgan.quorum - 0.11-SNAPSHOT + 0.10.1 diff --git a/cli/config-cli/pom.xml b/cli/config-cli/pom.xml index a3a1a0892a..c68a0b7b80 100644 --- a/cli/config-cli/pom.xml +++ b/cli/config-cli/pom.xml @@ -3,7 +3,7 @@ cli com.jpmorgan.quorum - 0.11-SNAPSHOT + 0.10.1 4.0.0 diff --git a/cli/pom.xml b/cli/pom.xml index 02010d98fc..ca00d28f5e 100644 --- a/cli/pom.xml +++ b/cli/pom.xml @@ -11,7 +11,7 @@ com.jpmorgan.quorum tessera - 0.11-SNAPSHOT + 0.10.1 cli diff --git a/config-migration/pom.xml b/config-migration/pom.xml index 2fda425eaf..3e2a57dfdf 100644 --- a/config-migration/pom.xml +++ b/config-migration/pom.xml @@ -6,7 +6,7 @@ com.jpmorgan.quorum tessera - 0.11-SNAPSHOT + 0.10.1 config-migration diff --git a/config/pom.xml b/config/pom.xml index 44a39de34f..a6a55d083c 100644 --- a/config/pom.xml +++ b/config/pom.xml @@ -11,7 +11,7 @@ com.jpmorgan.quorum tessera - 0.11-SNAPSHOT + 0.10.1 diff --git a/data-migration/pom.xml b/data-migration/pom.xml index 148c8e4d04..08314e1160 100644 --- a/data-migration/pom.xml +++ b/data-migration/pom.xml @@ -9,7 +9,7 @@ com.jpmorgan.quorum tessera - 0.11-SNAPSHOT + 0.10.1 diff --git a/ddls/pom.xml b/ddls/pom.xml index d6cdb1365a..10049168b5 100644 --- a/ddls/pom.xml +++ b/ddls/pom.xml @@ -4,7 +4,7 @@ com.jpmorgan.quorum tessera - 0.11-SNAPSHOT + 0.10.1 ddls jar @@ -46,7 +46,7 @@ com.jpmorgan.quorum tessera-core - 0.11-SNAPSHOT + 0.10.1 diff --git a/enclave/enclave-api/pom.xml b/enclave/enclave-api/pom.xml index 9d51ac00eb..a66cf363a5 100644 --- a/enclave/enclave-api/pom.xml +++ b/enclave/enclave-api/pom.xml @@ -8,7 +8,7 @@ enclave com.jpmorgan.quorum - 0.11-SNAPSHOT + 0.10.1 diff --git a/enclave/enclave-jaxrs/pom.xml b/enclave/enclave-jaxrs/pom.xml index b001f67aa4..e518bf7f8f 100644 --- a/enclave/enclave-jaxrs/pom.xml +++ b/enclave/enclave-jaxrs/pom.xml @@ -4,7 +4,7 @@ com.jpmorgan.quorum enclave - 0.11-SNAPSHOT + 0.10.1 enclave-jaxrs jar diff --git a/enclave/enclave-server/pom.xml b/enclave/enclave-server/pom.xml index 4acd9eb8e0..acb1adb18e 100644 --- a/enclave/enclave-server/pom.xml +++ b/enclave/enclave-server/pom.xml @@ -4,7 +4,7 @@ com.jpmorgan.quorum enclave - 0.11-SNAPSHOT + 0.10.1 enclave-server jar diff --git a/enclave/pom.xml b/enclave/pom.xml index 391c778e97..d5b3e9c0d5 100644 --- a/enclave/pom.xml +++ b/enclave/pom.xml @@ -3,7 +3,7 @@ tessera com.jpmorgan.quorum - 0.11-SNAPSHOT + 0.10.1 4.0.0 diff --git a/encryption/encryption-api/pom.xml b/encryption/encryption-api/pom.xml index e0b838ad54..98303ea4b7 100644 --- a/encryption/encryption-api/pom.xml +++ b/encryption/encryption-api/pom.xml @@ -9,7 +9,7 @@ com.jpmorgan.quorum encryption - 0.11-SNAPSHOT + 0.10.1 diff --git a/encryption/encryption-jnacl/pom.xml b/encryption/encryption-jnacl/pom.xml index b5cf41cf7c..363900da29 100644 --- a/encryption/encryption-jnacl/pom.xml +++ b/encryption/encryption-jnacl/pom.xml @@ -11,7 +11,7 @@ com.jpmorgan.quorum encryption - 0.11-SNAPSHOT + 0.10.1 diff --git a/encryption/encryption-kalium/pom.xml b/encryption/encryption-kalium/pom.xml index 6619458296..b56cc8f18c 100644 --- a/encryption/encryption-kalium/pom.xml +++ b/encryption/encryption-kalium/pom.xml @@ -11,7 +11,7 @@ com.jpmorgan.quorum encryption - 0.11-SNAPSHOT + 0.10.1 diff --git a/encryption/pom.xml b/encryption/pom.xml index a24b06eca4..d0982453ed 100644 --- a/encryption/pom.xml +++ b/encryption/pom.xml @@ -9,7 +9,7 @@ tessera com.jpmorgan.quorum - 0.11-SNAPSHOT + 0.10.1 diff --git a/key-generation/pom.xml b/key-generation/pom.xml index e65ab10414..648be1f907 100644 --- a/key-generation/pom.xml +++ b/key-generation/pom.xml @@ -3,7 +3,7 @@ tessera com.jpmorgan.quorum - 0.11-SNAPSHOT + 0.10.1 4.0.0 diff --git a/key-vault/azure-key-vault/pom.xml b/key-vault/azure-key-vault/pom.xml index 97936d9621..19ec325df9 100644 --- a/key-vault/azure-key-vault/pom.xml +++ b/key-vault/azure-key-vault/pom.xml @@ -3,7 +3,7 @@ key-vault com.jpmorgan.quorum - 0.11-SNAPSHOT + 0.10.1 4.0.0 diff --git a/key-vault/hashicorp-key-vault/pom.xml b/key-vault/hashicorp-key-vault/pom.xml index 4b7ec06773..41368bfb29 100644 --- a/key-vault/hashicorp-key-vault/pom.xml +++ b/key-vault/hashicorp-key-vault/pom.xml @@ -3,7 +3,7 @@ key-vault com.jpmorgan.quorum - 0.11-SNAPSHOT + 0.10.1 4.0.0 diff --git a/key-vault/key-vault-api/pom.xml b/key-vault/key-vault-api/pom.xml index ef03d11095..7178106402 100644 --- a/key-vault/key-vault-api/pom.xml +++ b/key-vault/key-vault-api/pom.xml @@ -3,7 +3,7 @@ key-vault com.jpmorgan.quorum - 0.11-SNAPSHOT + 0.10.1 4.0.0 diff --git a/key-vault/pom.xml b/key-vault/pom.xml index d6015ec182..8b80a15052 100644 --- a/key-vault/pom.xml +++ b/key-vault/pom.xml @@ -3,7 +3,7 @@ tessera com.jpmorgan.quorum - 0.11-SNAPSHOT + 0.10.1 4.0.0 diff --git a/pom.xml b/pom.xml index 3365820df2..51fa5130e7 100644 --- a/pom.xml +++ b/pom.xml @@ -5,7 +5,7 @@ com.jpmorgan.quorum tessera - 0.11-SNAPSHOT + 0.10.1 tessera pom @@ -20,7 +20,7 @@ https://github.com/jpmorganchase/tessera scm:git:https://github.com/jpmorganchase/tessera.git scm:git:https://github.com/jpmorganchase/tessera.git - HEAD + tessera-0.10.1 Tessera is a stateless Java system that is used to enable the encryption, decryption, and distribution @@ -490,229 +490,229 @@ com.jpmorgan.quorum encryption-api - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum argon2 - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum config - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum cli-api - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum config-cli - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum admin-cli - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum security - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum encryption-jnacl - 0.11-SNAPSHOT + 0.10.1 runtime com.jpmorgan.quorum encryption-kalium - 0.11-SNAPSHOT + 0.10.1 runtime com.jpmorgan.quorum service-locator-api - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum enclave-api - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum tessera-partyinfo - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum tessera-admin - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum enclave-jaxrs - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum enclave-jaxrs - 0.11-SNAPSHOT + 0.10.1 server com.jpmorgan.quorum service-locator-spring - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum mock-service-locator - 0.11-SNAPSHOT + 0.10.1 test com.jpmorgan.quorum server-api - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum jersey-server - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum test-util - 0.11-SNAPSHOT + 0.10.1 test com.jpmorgan.quorum shared - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum tessera-core - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum admin-jaxrs - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum sync-jaxrs - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum transaction-jaxrs - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum thirdparty-jaxrs - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum key-vault-api - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum azure-key-vault - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum hashicorp-key-vault - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum key-generation - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum jaxrs-client - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum ddls - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum jaxrs-client-unixsocket - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum tessera-data - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum grpc-server - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum grpc - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum grpc-api - 0.11-SNAPSHOT + 0.10.1 diff --git a/security/pom.xml b/security/pom.xml index 1b68c86ae5..a8c740254d 100644 --- a/security/pom.xml +++ b/security/pom.xml @@ -4,7 +4,7 @@ tessera com.jpmorgan.quorum - 0.11-SNAPSHOT + 0.10.1 4.0.0 diff --git a/server/jaxrs-client-unixsocket/pom.xml b/server/jaxrs-client-unixsocket/pom.xml index 2a92c19a25..ad536a9185 100644 --- a/server/jaxrs-client-unixsocket/pom.xml +++ b/server/jaxrs-client-unixsocket/pom.xml @@ -4,7 +4,7 @@ com.jpmorgan.quorum server - 0.11-SNAPSHOT + 0.10.1 jaxrs-client-unixsocket jar diff --git a/server/jersey-server/pom.xml b/server/jersey-server/pom.xml index ff6c935108..9f9d2a0449 100644 --- a/server/jersey-server/pom.xml +++ b/server/jersey-server/pom.xml @@ -6,7 +6,7 @@ com.jpmorgan.quorum server - 0.11-SNAPSHOT + 0.10.1 jersey-server diff --git a/server/pom.xml b/server/pom.xml index f980d0008d..528e51577f 100644 --- a/server/pom.xml +++ b/server/pom.xml @@ -10,7 +10,7 @@ tessera com.jpmorgan.quorum - 0.11-SNAPSHOT + 0.10.1 @@ -27,7 +27,7 @@ com.jpmorgan.quorum server-utils - 0.11-SNAPSHOT + 0.10.1 diff --git a/server/server-api/pom.xml b/server/server-api/pom.xml index 333494961e..448620bd63 100644 --- a/server/server-api/pom.xml +++ b/server/server-api/pom.xml @@ -10,7 +10,7 @@ com.jpmorgan.quorum server - 0.11-SNAPSHOT + 0.10.1 diff --git a/server/server-utils/pom.xml b/server/server-utils/pom.xml index 997bb14594..7e2d9d3460 100644 --- a/server/server-utils/pom.xml +++ b/server/server-utils/pom.xml @@ -4,7 +4,7 @@ com.jpmorgan.quorum server - 0.11-SNAPSHOT + 0.10.1 server-utils jar diff --git a/server/websockets-server/pom.xml b/server/websockets-server/pom.xml index e6e297a1a5..53026c819b 100644 --- a/server/websockets-server/pom.xml +++ b/server/websockets-server/pom.xml @@ -4,7 +4,7 @@ com.jpmorgan.quorum server - 0.11-SNAPSHOT + 0.10.1 websockets-server jar diff --git a/service-locator/pom.xml b/service-locator/pom.xml index 30885bc63e..b34de87dac 100644 --- a/service-locator/pom.xml +++ b/service-locator/pom.xml @@ -9,7 +9,7 @@ tessera com.jpmorgan.quorum - 0.11-SNAPSHOT + 0.10.1 diff --git a/service-locator/service-locator-api/pom.xml b/service-locator/service-locator-api/pom.xml index 595c09fe37..102600d8bc 100644 --- a/service-locator/service-locator-api/pom.xml +++ b/service-locator/service-locator-api/pom.xml @@ -11,7 +11,7 @@ com.jpmorgan.quorum service-locator - 0.11-SNAPSHOT + 0.10.1 diff --git a/service-locator/service-locator-spring/pom.xml b/service-locator/service-locator-spring/pom.xml index 79ef6ae808..152daa6051 100644 --- a/service-locator/service-locator-spring/pom.xml +++ b/service-locator/service-locator-spring/pom.xml @@ -11,7 +11,7 @@ com.jpmorgan.quorum service-locator - 0.11-SNAPSHOT + 0.10.1 diff --git a/shared/pom.xml b/shared/pom.xml index 2af54b1c52..5743a1d278 100644 --- a/shared/pom.xml +++ b/shared/pom.xml @@ -4,7 +4,7 @@ com.jpmorgan.quorum tessera - 0.11-SNAPSHOT + 0.10.1 shared jar diff --git a/tessera-admin/pom.xml b/tessera-admin/pom.xml index 18431f5c46..c225598f4a 100644 --- a/tessera-admin/pom.xml +++ b/tessera-admin/pom.xml @@ -4,7 +4,7 @@ com.jpmorgan.quorum tessera - 0.11-SNAPSHOT + 0.10.1 tessera-admin jar diff --git a/tessera-core/pom.xml b/tessera-core/pom.xml index 5bb9f8a20f..432ce8f492 100644 --- a/tessera-core/pom.xml +++ b/tessera-core/pom.xml @@ -4,7 +4,7 @@ com.jpmorgan.quorum tessera - 0.11-SNAPSHOT + 0.10.1 tessera-core jar diff --git a/tessera-data/pom.xml b/tessera-data/pom.xml index 3ddeaca0a2..0da113b0ad 100644 --- a/tessera-data/pom.xml +++ b/tessera-data/pom.xml @@ -4,7 +4,7 @@ com.jpmorgan.quorum tessera - 0.11-SNAPSHOT + 0.10.1 tessera-data jar diff --git a/tessera-dist/pom.xml b/tessera-dist/pom.xml index 70e9b4355b..3285a03e28 100644 --- a/tessera-dist/pom.xml +++ b/tessera-dist/pom.xml @@ -4,7 +4,7 @@ com.jpmorgan.quorum tessera - 0.11-SNAPSHOT + 0.10.1 tessera-dist pom @@ -22,13 +22,13 @@ com.jpmorgan.quorum tessera-launcher - 0.11-SNAPSHOT + 0.10.1 jar com.jpmorgan.quorum grpc-service - 0.11-SNAPSHOT + 0.10.1 runtime diff --git a/tessera-dist/tessera-app/pom.xml b/tessera-dist/tessera-app/pom.xml index 32cfc4e731..5a93766880 100644 --- a/tessera-dist/tessera-app/pom.xml +++ b/tessera-dist/tessera-app/pom.xml @@ -8,7 +8,7 @@ com.jpmorgan.quorum tessera-dist - 0.11-SNAPSHOT + 0.10.1 diff --git a/tessera-dist/tessera-grpc-dist/pom.xml b/tessera-dist/tessera-grpc-dist/pom.xml index 503b0e6bdb..7a58bdabd1 100644 --- a/tessera-dist/tessera-grpc-dist/pom.xml +++ b/tessera-dist/tessera-grpc-dist/pom.xml @@ -4,7 +4,7 @@ com.jpmorgan.quorum tessera-dist - 0.11-SNAPSHOT + 0.10.1 tessera-grpc-dist jar diff --git a/tessera-dist/tessera-launcher/pom.xml b/tessera-dist/tessera-launcher/pom.xml index f464b8cda8..6af840057f 100644 --- a/tessera-dist/tessera-launcher/pom.xml +++ b/tessera-dist/tessera-launcher/pom.xml @@ -4,7 +4,7 @@ com.jpmorgan.quorum tessera-dist - 0.11-SNAPSHOT + 0.10.1 tessera-launcher jar @@ -23,7 +23,7 @@ com.jpmorgan.quorum common-jaxrs - 0.11-SNAPSHOT + 0.10.1 diff --git a/tessera-dist/tessera-simple/pom.xml b/tessera-dist/tessera-simple/pom.xml index 9a538ce65b..5d8f741a1c 100644 --- a/tessera-dist/tessera-simple/pom.xml +++ b/tessera-dist/tessera-simple/pom.xml @@ -4,7 +4,7 @@ com.jpmorgan.quorum tessera-dist - 0.11-SNAPSHOT + 0.10.1 tessera-simple tessera-simple diff --git a/tessera-grpc/grpc-api/pom.xml b/tessera-grpc/grpc-api/pom.xml index e810846502..b4cac05d99 100644 --- a/tessera-grpc/grpc-api/pom.xml +++ b/tessera-grpc/grpc-api/pom.xml @@ -3,7 +3,7 @@ tessera-grpc com.jpmorgan.quorum - 0.11-SNAPSHOT + 0.10.1 4.0.0 diff --git a/tessera-grpc/grpc-server/pom.xml b/tessera-grpc/grpc-server/pom.xml index 84a6f168cd..b04a39d26a 100644 --- a/tessera-grpc/grpc-server/pom.xml +++ b/tessera-grpc/grpc-server/pom.xml @@ -4,7 +4,7 @@ tessera-grpc com.jpmorgan.quorum - 0.11-SNAPSHOT + 0.10.1 4.0.0 diff --git a/tessera-grpc/grpc-service/pom.xml b/tessera-grpc/grpc-service/pom.xml index d49cff9b83..e20bf44dc4 100644 --- a/tessera-grpc/grpc-service/pom.xml +++ b/tessera-grpc/grpc-service/pom.xml @@ -4,7 +4,7 @@ com.jpmorgan.quorum tessera-grpc - 0.11-SNAPSHOT + 0.10.1 grpc-service jar @@ -15,7 +15,7 @@ com.jpmorgan.quorum mock-service-locator test - 0.11-SNAPSHOT + 0.10.1 jar diff --git a/tessera-grpc/grpc/pom.xml b/tessera-grpc/grpc/pom.xml index a3d32a0824..5618653759 100644 --- a/tessera-grpc/grpc/pom.xml +++ b/tessera-grpc/grpc/pom.xml @@ -3,7 +3,7 @@ tessera-grpc com.jpmorgan.quorum - 0.11-SNAPSHOT + 0.10.1 4.0.0 diff --git a/tessera-grpc/pom.xml b/tessera-grpc/pom.xml index 379d0af6b3..5d81b96205 100644 --- a/tessera-grpc/pom.xml +++ b/tessera-grpc/pom.xml @@ -4,7 +4,7 @@ com.jpmorgan.quorum tessera - 0.11-SNAPSHOT + 0.10.1 tessera-grpc pom @@ -19,19 +19,19 @@ com.jpmorgan.quorum grpc - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum grpc-api - 0.11-SNAPSHOT + 0.10.1 com.jpmorgan.quorum grpc-service - 0.11-SNAPSHOT + 0.10.1 @@ -1179,7 +1184,6 @@ 2.7 - commons-codec commons-codec @@ -1264,19 +1268,45 @@ ${asm.version} - org.jasypt jasypt ${jasypt.version} + + info.picocli + picocli + ${picocli.version} + + software.amazon.awssdk secretsmanager ${awssdk.version} + + + io.netty + netty-handler + 4.1.42.Final + + + + + io.netty + netty-codec-http + 4.1.42.Final + + + + + org.apache.httpcomponents + httpclient + 4.5.9 + + @@ -1313,7 +1343,7 @@ system-rules test - + com.google.code.gson gson @@ -1351,8 +1381,6 @@ test - - diff --git a/settings.gradle b/settings.gradle index d1f154b2ed..edc95b08f2 100644 --- a/settings.gradle +++ b/settings.gradle @@ -3,7 +3,6 @@ include(':argon2') include(':config') include(':cli:cli-api') include(':cli:config-cli') -include(':cli:admin-cli') include(':cli') include(':tests:acceptance-test') include(':tests:test-util') @@ -59,7 +58,6 @@ include(':tessera-jaxrs') include(':tessera-data') project(':cli:cli-api').projectDir = file('cli/cli-api') project(':cli:config-cli').projectDir = file('cli/config-cli') -project(':cli:admin-cli').projectDir = file('cli/admin-cli') project(':tests:acceptance-test').projectDir = file('tests/acceptance-test') project(':tests:test-util').projectDir = file('tests/test-util') project(':tests:jmeter-test').projectDir = file('tests/jmeter-test') diff --git a/tessera-core/pom.xml b/tessera-core/pom.xml index 5bb9f8a20f..4df29ab5cc 100644 --- a/tessera-core/pom.xml +++ b/tessera-core/pom.xml @@ -12,8 +12,8 @@ com.jpmorgan.quorum tessera-data - - + + io.swagger swagger-annotations @@ -67,7 +67,7 @@ spring-orm runtime - + org.springframework spring-test @@ -86,14 +86,14 @@ test jar - + com.jpmorgan.quorum mock-service-locator test jar - + tessera-core diff --git a/tessera-core/src/test/java/com/quorum/tessera/core/CoreIT.java b/tessera-core/src/test/java/com/quorum/tessera/core/CoreIT.java index d48416820b..ab9d23c33a 100644 --- a/tessera-core/src/test/java/com/quorum/tessera/core/CoreIT.java +++ b/tessera-core/src/test/java/com/quorum/tessera/core/CoreIT.java @@ -1,7 +1,5 @@ - package com.quorum.tessera.core; -import com.quorum.tessera.cli.CliDelegate; import com.quorum.tessera.transaction.TransactionManager; import org.junit.BeforeClass; import org.junit.Test; @@ -19,9 +17,7 @@ @ContextConfiguration(locations = "classpath:tessera-core-spring.xml") public class CoreIT { - - @Inject - private TransactionManager transactionManager; + @Inject private TransactionManager transactionManager; @PersistenceContext(unitName = "tessera") private EntityManager entityManager; @@ -29,13 +25,14 @@ public class CoreIT { @BeforeClass public static void onSetup() throws Exception { String configPath = CoreIT.class.getResource("/config1.json").getPath(); - CliDelegate.INSTANCE.execute("-configfile",configPath); -} + // TODO(cjh) introduces a circular dependency between jaxrs-client module and picocli module + // PicoCliDelegate picoCliDelegate = new PicoCliDelegate(); + // picoCliDelegate.execute("-configfile", configPath); + } @Test public void doStuff() throws Exception { assertThat(transactionManager).isNotNull(); assertThat(entityManager).isNotNull(); } - } diff --git a/tessera-dist/tessera-app/build.gradle b/tessera-dist/tessera-app/build.gradle index 011060ee4a..3572c44cb8 100644 --- a/tessera-dist/tessera-app/build.gradle +++ b/tessera-dist/tessera-app/build.gradle @@ -23,7 +23,6 @@ dependencies { compile project(':tessera-core') compile project(':cli:cli-api') compile project(':cli:config-cli') - compile project(':cli:admin-cli') compile project(':tessera-jaxrs:admin-jaxrs') compile project(':tessera-jaxrs:sync-jaxrs') compile project(':tessera-jaxrs:transaction-jaxrs') diff --git a/tessera-dist/tessera-app/pom.xml b/tessera-dist/tessera-app/pom.xml index 6a2eb2bd71..f05d72c0f2 100644 --- a/tessera-dist/tessera-app/pom.xml +++ b/tessera-dist/tessera-app/pom.xml @@ -30,12 +30,6 @@ runtime - - com.jpmorgan.quorum - admin-cli - runtime - - com.jpmorgan.quorum encryption-api @@ -154,30 +148,6 @@ aws-key-vault runtime - - io.netty - netty-codec - - - io.netty - netty-codec-http - - - io.netty - netty-transport - - - io.netty - netty-handler - - - io.netty - netty-common - - - io.netty - netty-buffer - commons-logging commons-logging diff --git a/tessera-dist/tessera-launcher/build.gradle b/tessera-dist/tessera-launcher/build.gradle index 5695fa2884..bf776c1faf 100644 --- a/tessera-dist/tessera-launcher/build.gradle +++ b/tessera-dist/tessera-launcher/build.gradle @@ -2,6 +2,7 @@ dependencies { compile project(':config') compile project(':cli:cli-api') + compile project(':cli:config-cli') compile project(':server:server-api') compile project(':tessera-jaxrs:common-jaxrs') compile 'org.apache.commons:commons-lang3' diff --git a/tessera-dist/tessera-launcher/pom.xml b/tessera-dist/tessera-launcher/pom.xml index f464b8cda8..cf1f5f5e76 100644 --- a/tessera-dist/tessera-launcher/pom.xml +++ b/tessera-dist/tessera-launcher/pom.xml @@ -19,11 +19,17 @@ server-api jar - + com.jpmorgan.quorum common-jaxrs 0.11-SNAPSHOT + + + com.jpmorgan.quorum + config-cli + + diff --git a/tessera-dist/tessera-launcher/src/main/java/com/quorum/tessera/launcher/Main.java b/tessera-dist/tessera-launcher/src/main/java/com/quorum/tessera/launcher/Main.java index b3d60e81fe..d137f0e60e 100644 --- a/tessera-dist/tessera-launcher/src/main/java/com/quorum/tessera/launcher/Main.java +++ b/tessera-dist/tessera-launcher/src/main/java/com/quorum/tessera/launcher/Main.java @@ -8,6 +8,7 @@ import com.quorum.tessera.config.Config; import com.quorum.tessera.config.ConfigException; import com.quorum.tessera.config.apps.TesseraAppFactory; +import com.quorum.tessera.config.cli.PicoCliDelegate; import com.quorum.tessera.server.TesseraServer; import com.quorum.tessera.server.TesseraServerFactory; import org.apache.commons.lang3.exception.ExceptionUtils; @@ -26,12 +27,14 @@ public class Main { private static final Logger LOGGER = LoggerFactory.getLogger(Main.class); public static void main(final String... args) throws Exception { - System.setProperty(CliType.CLI_TYPE_KEY,CliType.CONFIG.name()); + System.setProperty(CliType.CLI_TYPE_KEY, CliType.CONFIG.name()); System.setProperty("javax.xml.bind.JAXBContextFactory", "org.eclipse.persistence.jaxb.JAXBContextFactory"); System.setProperty("javax.xml.bind.context.factory", "org.eclipse.persistence.jaxb.JAXBContextFactory"); try { - final CliResult cliResult = CliDelegate.instance().execute(args); + PicoCliDelegate picoCliDelegate = new PicoCliDelegate(); + final CliResult cliResult = picoCliDelegate.execute(args); + CliDelegate.instance().setConfig(cliResult.getConfig().orElse(null)); if (cliResult.isSuppressStartup()) { System.exit(0); diff --git a/tessera-dist/tessera-simple/pom.xml b/tessera-dist/tessera-simple/pom.xml index 9a538ce65b..d65ea86d6e 100644 --- a/tessera-dist/tessera-simple/pom.xml +++ b/tessera-dist/tessera-simple/pom.xml @@ -34,12 +34,6 @@ runtime - - com.jpmorgan.quorum - admin-cli - runtime - - com.jpmorgan.quorum encryption-api diff --git a/tessera-partyinfo/src/main/java/com/quorum/tessera/partyinfo/PartyInfoPoller.java b/tessera-partyinfo/src/main/java/com/quorum/tessera/partyinfo/PartyInfoPoller.java index 35f45250e9..d1ba81f81f 100644 --- a/tessera-partyinfo/src/main/java/com/quorum/tessera/partyinfo/PartyInfoPoller.java +++ b/tessera-partyinfo/src/main/java/com/quorum/tessera/partyinfo/PartyInfoPoller.java @@ -6,6 +6,9 @@ import org.slf4j.LoggerFactory; import java.util.Objects; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.Executor; +import java.util.concurrent.Executors; /** * Polls every so often to all known nodes for any new discoverable nodes. This keeps all nodes up-to date and @@ -21,15 +24,21 @@ public class PartyInfoPoller implements Runnable { private final P2pClient p2pClient; + private final Executor executor; + public PartyInfoPoller(final PartyInfoService partyInfoService, final P2pClient p2pClient) { - this(partyInfoService, PartyInfoParser.create(), p2pClient); + this(partyInfoService, PartyInfoParser.create(), p2pClient, Executors.newFixedThreadPool(20)); } public PartyInfoPoller( - final PartyInfoService partyInfoService, final PartyInfoParser partyInfoParser, final P2pClient p2pClient) { + final PartyInfoService partyInfoService, + final PartyInfoParser partyInfoParser, + final P2pClient p2pClient, + final Executor executor) { this.partyInfoService = Objects.requireNonNull(partyInfoService); this.partyInfoParser = Objects.requireNonNull(partyInfoParser); this.p2pClient = Objects.requireNonNull(p2pClient); + this.executor = Objects.requireNonNull(executor); } /** @@ -64,11 +73,12 @@ public void run() { * @param encodedPartyInfo the encoded current party information */ private void pollSingleParty(final String url, final byte[] encodedPartyInfo) { - try { - p2pClient.sendPartyInfo(url, encodedPartyInfo); - } catch (final Exception ex) { - LOGGER.warn("Error {} when connecting to {}", ex.getMessage(), url); - LOGGER.debug(null, ex); - } + CompletableFuture.runAsync(() -> p2pClient.sendPartyInfo(url, encodedPartyInfo), executor) + .exceptionally( + ex -> { + LOGGER.warn("Error {} when connecting to {}", ex.getMessage(), url); + LOGGER.debug(null, ex); + return null; + }); } } diff --git a/tessera-partyinfo/src/main/java/com/quorum/tessera/partyinfo/PartyInfoServiceImpl.java b/tessera-partyinfo/src/main/java/com/quorum/tessera/partyinfo/PartyInfoServiceImpl.java index d0d5b29a27..c0ea42467d 100644 --- a/tessera-partyinfo/src/main/java/com/quorum/tessera/partyinfo/PartyInfoServiceImpl.java +++ b/tessera-partyinfo/src/main/java/com/quorum/tessera/partyinfo/PartyInfoServiceImpl.java @@ -72,8 +72,8 @@ public PartyInfo updatePartyInfo(final PartyInfo partyInfo) { if (!this.validateKeysToUrls(existingPartyInfo, partyInfo)) { LOGGER.warn( - "Attempt is being made to update existing key with new url. Terminating party info update."); - return this.getPartyInfo(); + "Attempt is being made to update existing key with new url. " + + "Please switch on remote key validation to avoid a security breach."); } } diff --git a/tessera-partyinfo/src/test/java/com/quorum/tessera/partyinfo/PartyInfoPollerTest.java b/tessera-partyinfo/src/test/java/com/quorum/tessera/partyinfo/PartyInfoPollerTest.java index 484573b5e3..4b9a922f5e 100644 --- a/tessera-partyinfo/src/test/java/com/quorum/tessera/partyinfo/PartyInfoPollerTest.java +++ b/tessera-partyinfo/src/test/java/com/quorum/tessera/partyinfo/PartyInfoPollerTest.java @@ -5,10 +5,12 @@ import org.junit.After; import org.junit.Before; import org.junit.Test; +import org.mockito.invocation.InvocationOnMock; import java.util.Arrays; import java.util.HashSet; import java.util.Set; +import java.util.concurrent.Executor; import static java.util.Collections.emptySet; import static java.util.Collections.singleton; @@ -34,15 +36,25 @@ public class PartyInfoPollerTest { private P2pClient p2pClient; + private Executor executor; + @Before public void setUp() { this.partyInfoService = mock(PartyInfoService.class); this.partyInfoParser = mock(PartyInfoParser.class); this.p2pClient = mock(P2pClient.class); + this.executor = mock(Executor.class); + + doAnswer( + (InvocationOnMock invocation) -> { + ((Runnable) invocation.getArguments()[0]).run(); + return null; + } + ).when(executor).execute(any(Runnable.class)); when(partyInfoParser.to(any(PartyInfo.class))).thenReturn(DATA); - this.partyInfoPoller = new PartyInfoPoller(partyInfoService, partyInfoParser, p2pClient); + this.partyInfoPoller = new PartyInfoPoller(partyInfoService, partyInfoParser, p2pClient, executor); } @After @@ -86,6 +98,7 @@ public void exceptionThrowByPostDoesntBubble() { final Throwable throwable = catchThrowable(partyInfoPoller::run); assertThat(throwable).isNull(); + verify(p2pClient).sendPartyInfo(TARGET_URL, DATA); verify(p2pClient).sendPartyInfo(TARGET_URL_2, DATA); verify(partyInfoService).getPartyInfo(); diff --git a/tessera-partyinfo/src/test/java/com/quorum/tessera/partyinfo/PartyInfoServiceTest.java b/tessera-partyinfo/src/test/java/com/quorum/tessera/partyinfo/PartyInfoServiceTest.java index 9187577e5b..8b82e4debd 100644 --- a/tessera-partyinfo/src/test/java/com/quorum/tessera/partyinfo/PartyInfoServiceTest.java +++ b/tessera-partyinfo/src/test/java/com/quorum/tessera/partyinfo/PartyInfoServiceTest.java @@ -276,7 +276,7 @@ public void createWithFactoryConstructor() throws Exception { } @Test - public void attemptToUpdateRecipientWithExistingKeyWithNewUrlIsIgnoredIfToggleDisabled() { + public void attemptToUpdateRecipientWithExistingKeyWithNewUrlIfToggleDisabled() { // setup services final FeatureToggles featureToggles = new FeatureToggles(); featureToggles.setEnableRemoteKeyValidation(false); @@ -305,6 +305,7 @@ public void attemptToUpdateRecipientWithExistingKeyWithNewUrlIsIgnoredIfToggleDi assertThat(updatedInfo.getRecipients()).hasSize(1).containsExactly(new Recipient(testKey, uri)); verify(partyInfoStore, times(2)).getPartyInfo(); verify(configService).featureToggles(); + verify(configService).isDisablePeerDiscovery(); } @Test diff --git a/tests/acceptance-test/pom.xml b/tests/acceptance-test/pom.xml index b72ef6bc59..fd465d1008 100644 --- a/tests/acceptance-test/pom.xml +++ b/tests/acceptance-test/pom.xml @@ -99,12 +99,6 @@ wiremock-jre8 2.24.1 test - - - org.apache.httpcomponents - httpclient - - diff --git a/tests/acceptance-test/src/test/java/admin/cmd/Utils.java b/tests/acceptance-test/src/test/java/admin/cmd/Utils.java index 4160958198..9773370d1b 100644 --- a/tests/acceptance-test/src/test/java/admin/cmd/Utils.java +++ b/tests/acceptance-test/src/test/java/admin/cmd/Utils.java @@ -22,8 +22,6 @@ public class Utils { private static final Logger LOGGER = LoggerFactory.getLogger(Utils.class); - - public static ExecutionResult start(Party party) throws IOException, InterruptedException { List args = @@ -91,16 +89,14 @@ public static ExecutionResult start(Party party) throws IOException, Interrupted public static int addPeer(Party party, String url) throws IOException, InterruptedException { - List args = new ExecArgsBuilder() - .withJvmArg(String.format("-Dnode.number=%S", party.getAlias())) - .withStartScriptOrExecutableJarFile(Paths.get(jarPath)) - .withConfigFile(party.getConfigFilePath()) - .withArg("admin") - .withArg("-addpeer",url) - .withArg("-configfile",party.getConfigFilePath().toAbsolutePath().toString()) - .build(); - - + List args = + new ExecArgsBuilder() + .withJvmArg(String.format("-Dnode.number=%S", party.getAlias())) + .withStartScriptOrExecutableJarFile(Paths.get(jarPath)) + .withConfigFile(party.getConfigFilePath()) + .withSubcommands("admin", "addpeer") + .withArg(url) + .build(); LOGGER.info("exec : {}", String.join(" ", args)); ProcessBuilder processBuilder = new ProcessBuilder(args); diff --git a/tests/acceptance-test/src/test/java/com/quorum/tessera/test/cli/keygen/FileKeygenSteps.java b/tests/acceptance-test/src/test/java/com/quorum/tessera/test/cli/keygen/FileKeygenSteps.java index 154474f223..e7cfe7c11a 100644 --- a/tests/acceptance-test/src/test/java/com/quorum/tessera/test/cli/keygen/FileKeygenSteps.java +++ b/tests/acceptance-test/src/test/java/com/quorum/tessera/test/cli/keygen/FileKeygenSteps.java @@ -80,9 +80,7 @@ public FileKeygenSteps() { // here to explicitly state we are doing nothing Given("no file path is provided", () -> {}); - Given( - "a file path of {string}", - (String path) -> this.args.addAll(Arrays.asList("-filename", path, "--encryptor.type", "NACL"))); + Given("a file path of {string}", (String path) -> this.args.addAll(Arrays.asList("-filename", path))); When( "new keys are generated", diff --git a/tests/acceptance-test/src/test/java/com/quorum/tessera/test/vault/aws/AwsStepDefs.java b/tests/acceptance-test/src/test/java/com/quorum/tessera/test/vault/aws/AwsStepDefs.java index 0a14b6a2f6..26fd229aa6 100644 --- a/tests/acceptance-test/src/test/java/com/quorum/tessera/test/vault/aws/AwsStepDefs.java +++ b/tests/acceptance-test/src/test/java/com/quorum/tessera/test/vault/aws/AwsStepDefs.java @@ -54,194 +54,190 @@ public class AwsStepDefs implements En { public AwsStepDefs() { -// Before( -// () -> { -// // only needed when running outside of maven build process -// System.setProperty( -// "application.jar", -// "path/to/tessera-app-VERSION.jar"); -// }); + Before( + () -> { + // // only needed when running outside of maven build process + // System.setProperty( + // "application.jar", + // "path/to/tessera-app-VERSION.jar"); + }); After( - () -> { - if (wireMockServer.get() != null && wireMockServer.get().isRunning()) { - wireMockServer.get().stop(); - System.out.println("Stopped WireMockServer..."); - } - - if (tesseraProcess.get() != null && tesseraProcess.get().isAlive()) { - tesseraProcess.get().destroy(); - System.out.println("Stopped Tessera node..."); - } - }); + () -> { + if (wireMockServer.get() != null && wireMockServer.get().isRunning()) { + wireMockServer.get().stop(); + System.out.println("Stopped WireMockServer..."); + } + + if (tesseraProcess.get() != null && tesseraProcess.get().isAlive()) { + tesseraProcess.get().destroy(); + System.out.println("Stopped Tessera node..."); + } + }); Given( - "^the mock AWS Secrets Manager server has been started$", - () -> { - final URL keystore = getClass().getResource("/certificates/localhost-with-san-keystore.jks"); - - // wiremock configures an HTTP server by default. Even though we'll only use the HTTPS server we - // dynamically assign the HTTP port to ensure the default of 8080 is not used - wireMockServer.set( - new WireMockServer( - options() - .dynamicPort() - .dynamicHttpsPort() - .keystoreType("JKS") - .keystorePath(keystore.getFile()) - .keystorePassword("testtest") - .extensions(new ResponseTemplateTransformer(false)) - // .notifier(new ConsoleNotifier(true)) //enable to turn - // on verbose debug msgs - )); - - wireMockServer.get().start(); - }); + "^the mock AWS Secrets Manager server has been started$", + () -> { + final URL keystore = getClass().getResource("/certificates/localhost-with-san-keystore.jks"); + + // wiremock configures an HTTP server by default. Even though we'll only use the HTTPS server we + // dynamically assign the HTTP port to ensure the default of 8080 is not used + wireMockServer.set( + new WireMockServer( + options() + .dynamicPort() + .dynamicHttpsPort() + .keystoreType("JKS") + .keystorePath(keystore.getFile()) + .keystorePassword("testtest") + .extensions(new ResponseTemplateTransformer(false)) + // .notifier(new ConsoleNotifier(true)) //enable to turn + // on verbose debug msgs + )); + + wireMockServer.get().start(); + }); Given( - "^the mock AWS Secrets Manager server has stubs for the endpoints used to get secrets$", - () -> { - - wireMockServer - .get() - .stubFor( - post(urlPathEqualTo(AWS_SECRETS_MANAGER_URL)) - .willReturn( - okJson(String.format("{\"ARN\": \"arn\",\n" + - " \"CreatedDate\": 121211444,\n" + - " \"Name\": \"publicKey\",\n" + - " \"SecretBinary\": null,\n" + - " \"SecretString\": \"%s\",\n" + - " \"VersionId\": \"123\",\n" + - " \"VersionStages\": [ \"stage1\" ]\n" + - "}", publicKey)) - )); - - }); + "^the mock AWS Secrets Manager server has stubs for the endpoints used to get secrets$", + () -> { + wireMockServer + .get() + .stubFor( + post(urlPathEqualTo(AWS_SECRETS_MANAGER_URL)) + .willReturn( + okJson( + String.format( + "{\"ARN\": \"arn\",\n" + + " \"CreatedDate\": 121211444,\n" + + " \"Name\": \"publicKey\",\n" + + " \"SecretBinary\": null,\n" + + " \"SecretString\": \"%s\",\n" + + " \"VersionId\": \"123\",\n" + + " \"VersionStages\": [ \"stage1\" ]\n" + + "}", + publicKey)))); + }); When( - "^Tessera is started with the correct AWS Secrets Manager environment variables$", - () -> { - Map params = new HashMap<>(); - params.put("awsSecretsManagerEndpoint", wireMockServer.get().baseUrl()); - - Path tempTesseraConfig = - ElUtil.createTempFileFromTemplate( - getClass().getResource("/vault/tessera-aws-config.json"), params); - tempTesseraConfig.toFile().deleteOnExit(); - - final String jarfile = System.getProperty("application.jar"); - - final URL logbackConfigFile = NodeExecManager.class.getResource("/logback-node.xml"); - Path pid = Paths.get(System.getProperty("java.io.tmpdir"), "pidA.pid"); - - final URL truststore = getClass().getResource("/certificates/truststore.jks"); - - List args = - new ArrayList<>( - Arrays.asList( - "java", - // we set the truststore so that Tessera can trust the wiremock server - "-Djavax.net.ssl.trustStore=" + truststore.getFile(), - "-Djavax.net.ssl.trustStorePassword=testtest", - "-Dspring.profiles.active=disable-unixsocket", - "-Dlogback.configurationFile=" + logbackConfigFile.getFile(), - "-Ddebug=true", - "-jar", - jarfile, - "-configfile", - tempTesseraConfig.toString(), - "-pidfile", - pid.toAbsolutePath().toString(), - "-jdbc.autoCreateTables", - "true")); - - startTessera(args, tempTesseraConfig); - }); + "^Tessera is started with the correct AWS Secrets Manager environment variables$", + () -> { + Map params = new HashMap<>(); + params.put("awsSecretsManagerEndpoint", wireMockServer.get().baseUrl()); + + Path tempTesseraConfig = + ElUtil.createTempFileFromTemplate( + getClass().getResource("/vault/tessera-aws-config.json"), params); + tempTesseraConfig.toFile().deleteOnExit(); + + final String jarfile = System.getProperty("application.jar"); + + final URL logbackConfigFile = NodeExecManager.class.getResource("/logback-node.xml"); + Path pid = Paths.get(System.getProperty("java.io.tmpdir"), "pidA.pid"); + + final URL truststore = getClass().getResource("/certificates/truststore.jks"); + + List args = + new ArrayList<>( + Arrays.asList( + "java", + // we set the truststore so that Tessera can trust the wiremock server + "-Djavax.net.ssl.trustStore=" + truststore.getFile(), + "-Djavax.net.ssl.trustStorePassword=testtest", + "-Dspring.profiles.active=disable-unixsocket", + "-Dlogback.configurationFile=" + logbackConfigFile.getFile(), + "-Daws.region=a-region", + "-Daws.accessKeyId=an-id", + "-Daws.secretAccessKey=a-key", + "-Ddebug=true", + "-jar", + jarfile, + "-configfile", + tempTesseraConfig.toString(), + "-pidfile", + pid.toAbsolutePath().toString(), + "-jdbc.autoCreateTables", + "true")); + + startTessera(args, tempTesseraConfig); + }); Then( - "^Tessera will retrieve the key pair from AWS Secrets Manager$", - () -> { - wireMockServer.get().verify(2, postRequestedFor(urlEqualTo(AWS_SECRETS_MANAGER_URL))); + "^Tessera will retrieve the key pair from AWS Secrets Manager$", + () -> { + wireMockServer.get().verify(2, postRequestedFor(urlEqualTo(AWS_SECRETS_MANAGER_URL))); - final URL partyInfoUrl = - UriBuilder.fromUri("http://localhost").port(8080).path("partyinfo").build().toURL(); + final URL partyInfoUrl = + UriBuilder.fromUri("http://localhost").port(8080).path("partyinfo").build().toURL(); - HttpURLConnection partyInfoUrlConnection = (HttpURLConnection) partyInfoUrl.openConnection(); - partyInfoUrlConnection.connect(); + HttpURLConnection partyInfoUrlConnection = (HttpURLConnection) partyInfoUrl.openConnection(); + partyInfoUrlConnection.connect(); - int partyInfoResponseCode = partyInfoUrlConnection.getResponseCode(); - assertThat(partyInfoResponseCode).isEqualTo(HttpURLConnection.HTTP_OK); + int partyInfoResponseCode = partyInfoUrlConnection.getResponseCode(); + assertThat(partyInfoResponseCode).isEqualTo(HttpURLConnection.HTTP_OK); - JsonReader jsonReader = Json.createReader(partyInfoUrlConnection.getInputStream()); + JsonReader jsonReader = Json.createReader(partyInfoUrlConnection.getInputStream()); - JsonObject partyInfoObject = jsonReader.readObject(); + JsonObject partyInfoObject = jsonReader.readObject(); - assertThat(partyInfoObject).isNotNull(); - assertThat(partyInfoObject.getJsonArray("keys")).hasSize(1); - assertThat(partyInfoObject.getJsonArray("keys").getJsonObject(0).getString("key")) - .isEqualTo(publicKey); - }); + assertThat(partyInfoObject).isNotNull(); + assertThat(partyInfoObject.getJsonArray("keys")).hasSize(1); + assertThat(partyInfoObject.getJsonArray("keys").getJsonObject(0).getString("key")) + .isEqualTo(publicKey); + }); Given( - "^the mock AWS Secrets Manager server has stubs for the endpoints used to store secrets$", - () -> { - wireMockServer - .get() - .stubFor( - post(urlPathEqualTo(AWS_SECRETS_MANAGER_URL)) - .willReturn( - okJson(("{\n" + - " \"ARN\": \"string\",\n" + - " \"Name\": \"string\",\n" + - " \"VersionId\": \"string\"\n" + - "}") - ))); - }); + "^the mock AWS Secrets Manager server has stubs for the endpoints used to store secrets$", + () -> { + wireMockServer + .get() + .stubFor( + post(urlPathEqualTo(AWS_SECRETS_MANAGER_URL)) + .willReturn( + okJson( + ("{\n" + + " \"ARN\": \"string\",\n" + + " \"Name\": \"string\",\n" + + " \"VersionId\": \"string\"\n" + + "}")))); + }); When( - "^Tessera keygen is run with the following CLI args and AWS Secrets Manager environment variables$", - (String cliArgs) -> { - Map params = new HashMap<>(); - params.put("awsSecretsManagerEndpoint", wireMockServer.get().baseUrl()); - - Path tempTesseraConfig = - ElUtil.createTempFileFromTemplate( - getClass().getResource("/vault/tessera-aws-config.json"), params); - tempTesseraConfig.toFile().deleteOnExit(); - - final String jarfile = System.getProperty("application.jar"); - - final URL logbackConfigFile = NodeExecManager.class.getResource("/logback-test.xml"); - - final URL truststore = getClass().getResource("/certificates/truststore.jks"); - - String formattedArgs = String.format(cliArgs, wireMockServer.get().baseUrl()); - - List args = new ArrayList<>(); - args.addAll( - Arrays.asList( - "java", - // we set the truststore so that Tessera can trust the wiremock server - "-Djavax.net.ssl.trustStore=" + truststore.getFile(), - "-Djavax.net.ssl.trustStorePassword=testtest", - "-Dspring.profiles.active=disable-unixsocket", - "-Dlogback.configurationFile=" + logbackConfigFile.getFile(), - "-Ddebug=true", - "-jar", - jarfile, - "-configfile", - tempTesseraConfig.toString())); - args.addAll(Arrays.asList(formattedArgs.split(" "))); - - startTessera(args, null); // node is not started during keygen so do not want to verify - }); + "^Tessera keygen is run with the following CLI args and AWS Secrets Manager environment variables$", + (String cliArgs) -> { + final String jarfile = System.getProperty("application.jar"); + + final URL logbackConfigFile = NodeExecManager.class.getResource("/logback-test.xml"); + + final URL truststore = getClass().getResource("/certificates/truststore.jks"); + + String formattedArgs = String.format(cliArgs, wireMockServer.get().baseUrl()); + + List args = new ArrayList<>(); + args.addAll( + Arrays.asList( + "java", + // we set the truststore so that Tessera can trust the wiremock server + "-Djavax.net.ssl.trustStore=" + truststore.getFile(), + "-Djavax.net.ssl.trustStorePassword=testtest", + "-Dspring.profiles.active=disable-unixsocket", + "-Dlogback.configurationFile=" + logbackConfigFile.getFile(), + "-Ddebug=true", + "-Daws.region=a-region", + "-Daws.accessKeyId=an-id", + "-Daws.secretAccessKey=a-key", + "-jar", + jarfile)); + args.addAll(Arrays.asList(formattedArgs.split(" "))); + + startTessera(args, null); // node is not started during keygen so do not want to verify + }); Then( - "^key pairs nodeA and nodeB will have been added to the AWS Secrets Manager$", - () -> { - wireMockServer.get().verify(2, postRequestedFor(urlEqualTo(AWS_SECRETS_MANAGER_URL))); - }); + "^key pairs nodeA and nodeB will have been added to the AWS Secrets Manager$", + () -> { + wireMockServer.get().verify(4, postRequestedFor(urlEqualTo(AWS_SECRETS_MANAGER_URL))); + }); } private void startTessera(List args, Path verifyConfig) throws Exception { @@ -259,23 +255,23 @@ private void startTessera(List args, Path verifyConfig) throws Exception } executorService.submit( - () -> { - try (BufferedReader reader = - Stream.of(tesseraProcess.get().getInputStream()) - .map(InputStreamReader::new) - .map(BufferedReader::new) - .findAny() - .get()) { - - String line; - while ((line = reader.readLine()) != null) { - System.out.println(line); - } - - } catch (IOException ex) { - throw new UncheckedIOException(ex); - } - }); + () -> { + try (BufferedReader reader = + Stream.of(tesseraProcess.get().getInputStream()) + .map(InputStreamReader::new) + .map(BufferedReader::new) + .findAny() + .get()) { + + String line; + while ((line = reader.readLine()) != null) { + System.out.println(line); + } + + } catch (IOException ex) { + throw new UncheckedIOException(ex); + } + }); CountDownLatch startUpLatch = new CountDownLatch(1); @@ -283,27 +279,27 @@ private void startTessera(List args, Path verifyConfig) throws Exception final Config config = JaxbUtil.unmarshal(Files.newInputStream(verifyConfig), Config.class); final URL bindingUrl = - UriBuilder.fromUri(config.getP2PServerConfig().getBindingUri()).path("upcheck").build().toURL(); + UriBuilder.fromUri(config.getP2PServerConfig().getBindingUri()).path("upcheck").build().toURL(); executorService.submit( - () -> { - while (true) { - try { - HttpURLConnection conn = (HttpURLConnection) bindingUrl.openConnection(); - conn.connect(); - - System.out.println(bindingUrl + " started." + conn.getResponseCode()); - - startUpLatch.countDown(); - return; - } catch (IOException ex) { + () -> { + while (true) { try { - TimeUnit.MILLISECONDS.sleep(200L); - } catch (InterruptedException ex1) { + HttpURLConnection conn = (HttpURLConnection) bindingUrl.openConnection(); + conn.connect(); + + System.out.println(bindingUrl + " started." + conn.getResponseCode()); + + startUpLatch.countDown(); + return; + } catch (IOException ex) { + try { + TimeUnit.MILLISECONDS.sleep(200L); + } catch (InterruptedException ex1) { + } } } - } - }); + }); boolean started = startUpLatch.await(30, TimeUnit.SECONDS); @@ -313,17 +309,17 @@ private void startTessera(List args, Path verifyConfig) throws Exception } executorService.submit( - () -> { - try { - int exitCode = tesseraProcess.get().waitFor(); - startUpLatch.countDown(); - if (0 != exitCode) { - System.err.println("Tessera node exited with code " + exitCode); + () -> { + try { + int exitCode = tesseraProcess.get().waitFor(); + startUpLatch.countDown(); + if (0 != exitCode) { + System.err.println("Tessera node exited with code " + exitCode); + } + } catch (InterruptedException ex) { + ex.printStackTrace(); } - } catch (InterruptedException ex) { - ex.printStackTrace(); - } - }); + }); startUpLatch.await(30, TimeUnit.SECONDS); } diff --git a/tests/acceptance-test/src/test/java/exec/ExecArgsBuilder.java b/tests/acceptance-test/src/test/java/exec/ExecArgsBuilder.java index 727e9370b5..df36b4e7b8 100644 --- a/tests/acceptance-test/src/test/java/exec/ExecArgsBuilder.java +++ b/tests/acceptance-test/src/test/java/exec/ExecArgsBuilder.java @@ -1,6 +1,7 @@ package exec; import com.quorum.tessera.config.Config; + import java.io.File; import java.nio.file.Path; import java.nio.file.Paths; @@ -13,6 +14,8 @@ public class ExecArgsBuilder { private Path configFile; + private List subcommands; + private Path pidFile; private Class mainClass; @@ -78,6 +81,15 @@ private ExecArgsBuilder withStartScript(Path startScript) { return this; } + public ExecArgsBuilder withSubcommands(String subcommand, String... s) { + List subcommands = new ArrayList<>(); + subcommands.add(subcommand); + subcommands.addAll(Arrays.asList(s)); + + this.subcommands = subcommands; + return this; + } + public ExecArgsBuilder withArg(String name) { argList.put(name, null); return this; @@ -122,6 +134,10 @@ public List build() { tokens.add(startScript.toAbsolutePath().toString()); } + if (Objects.nonNull(subcommands)) { + tokens.addAll(subcommands); + } + tokens.add("-configfile"); tokens.add(configFile.toAbsolutePath().toString()); diff --git a/tests/acceptance-test/src/test/resources/vault/tessera-aws-config.json b/tests/acceptance-test/src/test/resources/vault/tessera-aws-config.json index e87f264b4d..a8a8302ab5 100644 --- a/tests/acceptance-test/src/test/resources/vault/tessera-aws-config.json +++ b/tests/acceptance-test/src/test/resources/vault/tessera-aws-config.json @@ -26,8 +26,11 @@ ], "keys": { "passwords": [], - "awsKeyVaultConfig":{ - "endpoint": "${awsSecretsManagerEndpoint}" + "keyVaultConfig": { + "keyVaultType": "AWS", + "properties": { + "endpoint": "${awsSecretsManagerEndpoint}" + } }, "keyData": [ {