From e500d97c4dccf91ed94a39dab5e2d160347f2b90 Mon Sep 17 00:00:00 2001 From: chris-j-h Date: Fri, 10 May 2024 09:54:02 +0100 Subject: [PATCH 1/2] Bump jna --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 02730349e..9c34f3864 100644 --- a/build.gradle +++ b/build.gradle @@ -158,7 +158,7 @@ allprojects { implementation "org.hibernate.validator:hibernate-validator:7.0.1.Final" implementation "com.fasterxml:classmate:1.5.1" - implementation "net.java.dev.jna:jna:5.10.0" + implementation "net.java.dev.jna:jna:5.13.0" testImplementation "org.apache.tuweni:tuweni-rlp:2.0.0" testImplementation "org.apache.tuweni:tuweni-bytes:2.0.0" From 1b0f9e9fac80bc0313ba894fe619d61aee3fba76 Mon Sep 17 00:00:00 2001 From: chris-j-h Date: Fri, 10 May 2024 09:32:14 +0100 Subject: [PATCH 2/2] Fix Azure test that verifies node can start and run in CI --- .github/workflows/gradle.yml | 7 +++++-- tests/acceptance-test/build.gradle | 2 ++ .../test/vault/azure/AzureKeyVaultHttpHandler.java | 13 ++++++++++++- 3 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/gradle.yml b/.github/workflows/gradle.yml index 365d36819..b74ce4eff 100644 --- a/.github/workflows/gradle.yml +++ b/.github/workflows/gradle.yml @@ -134,7 +134,7 @@ jobs: path: /home/runner/work/tessera/tessera/encryption/encryption-kalium/build/distributions/ - name: Execute gradle integration tests run: | - ./gradlew :tests:acceptance-test:clean :tests:acceptance-test:test --fail-fast -PexcludeTests="RunHashicorpIT,AwsKeyVaultIT,RecoverIT,RunAzureIT,RestSuiteHttpH2RemoteEnclaveEncTypeEC,CucumberTestSuite" --info + ./gradlew :tests:acceptance-test:clean :tests:acceptance-test:test --fail-fast -PexcludeTests="RunHashicorpIT,AwsKeyVaultIT,RecoverIT,RunAzureIT,AzureKeyVaultIT,RestSuiteHttpH2RemoteEnclaveEncTypeEC,CucumberTestSuite" --info - name: Upload Junit reports uses: actions/upload-artifact@v2 if: always() @@ -311,7 +311,10 @@ jobs: - name: Run AWS tests run: | ./gradlew :tests:acceptance-test:test --tests AwsKeyVaultIT --info -# - name: Run azure tests + - name: Run azure tests (node starts) + run: | + ./gradlew :tests:acceptance-test:test --tests AzureKeyVaultIT --info +# - name: Run azure tests (cucumber) # run: | # ./gradlew :tests:acceptance-test:test --tests RunAzureIT --info - name: Run hashicorp tests diff --git a/tests/acceptance-test/build.gradle b/tests/acceptance-test/build.gradle index 9dca85e7b..d1e5b7665 100644 --- a/tests/acceptance-test/build.gradle +++ b/tests/acceptance-test/build.gradle @@ -108,6 +108,8 @@ test { "**/P2pTestSuite.class", "**/AwsKeyVaultIT.class", "**/RunHashicorpIT.class", + //"**/RunAzureIT.class", + "**/AzureKeyVaultIT.class", "**/ThirdPartyIT.class", "**/CucumberTestSuite.class", ) diff --git a/tests/acceptance-test/src/test/java/com/quorum/tessera/test/vault/azure/AzureKeyVaultHttpHandler.java b/tests/acceptance-test/src/test/java/com/quorum/tessera/test/vault/azure/AzureKeyVaultHttpHandler.java index c14a55815..ad96bb960 100644 --- a/tests/acceptance-test/src/test/java/com/quorum/tessera/test/vault/azure/AzureKeyVaultHttpHandler.java +++ b/tests/acceptance-test/src/test/java/com/quorum/tessera/test/vault/azure/AzureKeyVaultHttpHandler.java @@ -16,6 +16,7 @@ public class AzureKeyVaultHttpHandler implements HttpHandler { private AtomicInteger counter = new AtomicInteger(0); private final String publicKey = "BULeR8JyUWhiuuCMU/HLA0Q5pzkYT+cHII3ZKBey3Bo="; + private final String privateKey = "Wl+xSyXVuuqzpvznOS7dOobhcn4C5auxkFRi7yLtgtA="; private final String keyVaultUrl; @@ -52,8 +53,18 @@ public void handle(HttpExchange exchange) throws IOException { LOGGER.info("response send {}", new String(response)); exchange.close(); - } else { + } else if (exchange.getRequestURI().toString().startsWith("/secrets/Key/")) { + JsonObject jsonObject = Json.createObjectBuilder().add("value", privateKey).build(); + + byte[] response = jsonObject.toString().getBytes(); + exchange.sendResponseHeaders(200, response.length); + exchange.getResponseBody().write(response); + LOGGER.info("response send {}", new String(response)); + + exchange.close(); + } else { + LOGGER.info("response send empty"); exchange.sendResponseHeaders(200, 0); exchange.close(); }