From 658dcd4587a731244ba7db874845ea5122177412 Mon Sep 17 00:00:00 2001 From: Andrea Morabito <78792023+and-mora@users.noreply.github.com> Date: Mon, 7 Nov 2022 12:02:02 +0100 Subject: [PATCH 1/4] fix: [RTD-859] fix pom version alignment with release version (#290) --- api/batch/pom.xml | 4 ++-- api/pom.xml | 4 ++-- app/pom.xml | 4 ++-- app/src/main/resources/config/application.yml | 2 +- core/pom.xml | 4 ++-- integration/jpa/pom.xml | 4 ++-- integration/pom.xml | 4 ++-- integration/rest/pom.xml | 4 ++-- .../transaction_filter/logger/MaskingPatternLayoutTest.java | 2 +- ops_resources/example_config/application.yml | 2 +- ops_resources/example_config/application_hbsql.yml | 2 +- pom.xml | 4 ++-- 12 files changed, 20 insertions(+), 20 deletions(-) diff --git a/api/batch/pom.xml b/api/batch/pom.xml index be9896a7..4b7cfccc 100644 --- a/api/batch/pom.xml +++ b/api/batch/pom.xml @@ -4,11 +4,11 @@ rtd-ms-transaction-filter-api it.gov.pagopa.rtd.ms.transaction_filter.api - 1.3.0 + 1.3.2 rtd-ms-transaction-filter-api-batch - 1.3.0 + 1.3.2 diff --git a/api/pom.xml b/api/pom.xml index 099252dd..bbae8d53 100644 --- a/api/pom.xml +++ b/api/pom.xml @@ -4,12 +4,12 @@ rtd-ms-transaction-filter it.gov.pagopa.rtd.ms - 1.3.0 + 1.3.2 it.gov.pagopa.rtd.ms.transaction_filter.api rtd-ms-transaction-filter-api - 1.3.0 + 1.3.2 pom diff --git a/app/pom.xml b/app/pom.xml index 086720b5..de81c68b 100644 --- a/app/pom.xml +++ b/app/pom.xml @@ -4,12 +4,12 @@ rtd-ms-transaction-filter it.gov.pagopa.rtd.ms - 1.3.0 + 1.3.2 it.gov.pagopa.rtd.ms.transaction_filter transaction-filter-app - 1.3.0 + 1.3.2 diff --git a/app/src/main/resources/config/application.yml b/app/src/main/resources/config/application.yml index 279aa23e..c93f8201 100644 --- a/app/src/main/resources/config/application.yml +++ b/app/src/main/resources/config/application.yml @@ -110,7 +110,7 @@ batchConfiguration: rest-client: user-agent: prefix: BatchService - version: 1.3.0 + version: 1.3.2 hpan: serviceCode: hpan-service base-url: ${HPAN_SERVICE_URL:https://bpd-dev.azure-api.net:${HPAN_SERVICE_PORT:443}} diff --git a/core/pom.xml b/core/pom.xml index 0460ccf7..82bcadc4 100644 --- a/core/pom.xml +++ b/core/pom.xml @@ -4,12 +4,12 @@ rtd-ms-transaction-filter it.gov.pagopa.rtd.ms - 1.3.0 + 1.3.2 it.gov.pagopa.rtd.ms.transaction_filter rtd-ms-transaction-filter-core - 1.3.0 + 1.3.2 diff --git a/integration/jpa/pom.xml b/integration/jpa/pom.xml index aa2f85fa..5a4dcb5d 100644 --- a/integration/jpa/pom.xml +++ b/integration/jpa/pom.xml @@ -4,12 +4,12 @@ rtd-ms-transaction-filter-integration it.gov.pagopa.rtd.ms.transaction_filter - 1.3.0 + 1.3.2 it.gov.pagopa.rtd.ms.transaction_filter.integration rtd-ms-transaction-filter-integration-jpa - 1.3.0 + 1.3.2 diff --git a/integration/pom.xml b/integration/pom.xml index caf7efc6..41523aa6 100644 --- a/integration/pom.xml +++ b/integration/pom.xml @@ -4,12 +4,12 @@ rtd-ms-transaction-filter it.gov.pagopa.rtd.ms - 1.3.0 + 1.3.2 it.gov.pagopa.rtd.ms.transaction_filter rtd-ms-transaction-filter-integration - 1.3.0 + 1.3.2 pom diff --git a/integration/rest/pom.xml b/integration/rest/pom.xml index 1d3203a3..201e1793 100644 --- a/integration/rest/pom.xml +++ b/integration/rest/pom.xml @@ -4,12 +4,12 @@ it.gov.pagopa.rtd.ms.transaction_filter rtd-ms-transaction-filter-integration - 1.3.0 + 1.3.2 it.gov.pagopa.rtd.ms.transaction_filter.integration rtd-ms-transaction-filter-integration-rest - 1.3.0 + 1.3.2 diff --git a/integration/rest/src/test/java/it/gov/pagopa/rtd/transaction_filter/logger/MaskingPatternLayoutTest.java b/integration/rest/src/test/java/it/gov/pagopa/rtd/transaction_filter/logger/MaskingPatternLayoutTest.java index 4298ec5f..33412e42 100644 --- a/integration/rest/src/test/java/it/gov/pagopa/rtd/transaction_filter/logger/MaskingPatternLayoutTest.java +++ b/integration/rest/src/test/java/it/gov/pagopa/rtd/transaction_filter/logger/MaskingPatternLayoutTest.java @@ -38,7 +38,7 @@ void whenLogContainsSaltThenAnonymizeIt(CapturedOutput output) { String stringWithSalt = "[HpanRestConnector#getSalt] ---> GET https://api.dev.cstar.pagopa.it/rtd/payment-instrument-manager/v2/salt HTTP/1.1\n" + "[HpanRestConnector#getSalt] Ocp-Apim-Subscription-Key: ciao\n" - + "[HpanRestConnector#getSalt] User-Agent: BatchService/1.3.0\n" + + "[HpanRestConnector#getSalt] User-Agent: BatchService/1.3.2\n" + "[HpanRestConnector#getSalt] ---> END HTTP (0-byte body)\n" + "[HpanRestConnector#getSalt] <--- HTTP/1.1 200 OK (57ms)\n" + "[HpanRestConnector#getSalt] connection: keep-alive\n" diff --git a/ops_resources/example_config/application.yml b/ops_resources/example_config/application.yml index 602ebc5f..e84671ae 100644 --- a/ops_resources/example_config/application.yml +++ b/ops_resources/example_config/application.yml @@ -109,7 +109,7 @@ batchConfiguration: rest-client: user-agent: prefix: BatchService - version: 1.3.0 + version: 1.3.2 hpan: serviceCode: hpan-service base-url: ${HPAN_SERVICE_URL:https://bpd-dev.azure-api.net:${HPAN_SERVICE_PORT:443}} diff --git a/ops_resources/example_config/application_hbsql.yml b/ops_resources/example_config/application_hbsql.yml index 0e09718c..986e4ada 100644 --- a/ops_resources/example_config/application_hbsql.yml +++ b/ops_resources/example_config/application_hbsql.yml @@ -87,7 +87,7 @@ batchConfiguration: rest-client: user-agent: prefix: BatchService - version: 1.3.0 + version: 1.3.2 hpan: serviceCode: hpan-service base-url: ${HPAN_SERVICE_URL:https://bpd-dev.azure-api.net:${HPAN_SERVICE_PORT:443}} diff --git a/pom.xml b/pom.xml index cf91a454..0d28d6cb 100644 --- a/pom.xml +++ b/pom.xml @@ -10,7 +10,7 @@ it.gov.pagopa.rtd.ms rtd-ms-transaction-filter - 1.3.0 + 1.3.2 pom @@ -27,7 +27,7 @@ UTF-8 **/enums/**,**/model/**,**/Constants*.java,**/*Config.java,**/*Application.java - 1.3.0 + 1.3.2 From 234d77709ba776710fa68cfdb3a7b1c35a76a402 Mon Sep 17 00:00:00 2001 From: Andrea Morabito <78792023+and-mora@users.noreply.github.com> Date: Tue, 8 Nov 2022 10:27:05 +0100 Subject: [PATCH 2/4] fix: [RTD-849] mitigation on sender ade ack file already exists exception (#291) * [RTD-849] mitigation on sender ade ack file already exists exception --- .../tasklet/SenderAdeAckFilesRecoveryTasklet.java | 7 ++++++- .../SenderAdeAckFilesRecoveryTaskletTest.java | 14 ++++++++++++++ 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/api/batch/src/main/java/it/gov/pagopa/rtd/transaction_filter/batch/step/tasklet/SenderAdeAckFilesRecoveryTasklet.java b/api/batch/src/main/java/it/gov/pagopa/rtd/transaction_filter/batch/step/tasklet/SenderAdeAckFilesRecoveryTasklet.java index 61afff1e..ab40c26b 100644 --- a/api/batch/src/main/java/it/gov/pagopa/rtd/transaction_filter/batch/step/tasklet/SenderAdeAckFilesRecoveryTasklet.java +++ b/api/batch/src/main/java/it/gov/pagopa/rtd/transaction_filter/batch/step/tasklet/SenderAdeAckFilesRecoveryTasklet.java @@ -10,6 +10,7 @@ import lombok.Data; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.io.FileExistsException; import org.apache.commons.io.FileUtils; import org.springframework.batch.core.StepContribution; import org.springframework.batch.core.scope.context.ChunkContext; @@ -70,7 +71,11 @@ private Optional getParentTemporaryDirectory(List senderAdeAckFiles) private void saveFilesToOutputDirectory(List senderAdeAckFiles) throws IOException { for (File sourceFile : senderAdeAckFiles) { File outputFile = createOutputFile(sourceFile.getName()); - FileUtils.moveFile(sourceFile, outputFile); + try { + FileUtils.moveFile(sourceFile, outputFile); + } catch(FileExistsException exception) { + log.debug("File {} already exists and will not be overwritten.", outputFile.getName()); + } } } diff --git a/api/batch/src/test/java/it/gov/pagopa/rtd/transaction_filter/batch/step/tasklet/SenderAdeAckFilesRecoveryTaskletTest.java b/api/batch/src/test/java/it/gov/pagopa/rtd/transaction_filter/batch/step/tasklet/SenderAdeAckFilesRecoveryTaskletTest.java index a6af4b00..9d005adc 100644 --- a/api/batch/src/test/java/it/gov/pagopa/rtd/transaction_filter/batch/step/tasklet/SenderAdeAckFilesRecoveryTaskletTest.java +++ b/api/batch/src/test/java/it/gov/pagopa/rtd/transaction_filter/batch/step/tasklet/SenderAdeAckFilesRecoveryTaskletTest.java @@ -1,6 +1,7 @@ package it.gov.pagopa.rtd.transaction_filter.batch.step.tasklet; import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatCode; import static org.assertj.core.api.Assertions.assertThatThrownBy; import static org.mockito.Mockito.verify; @@ -169,6 +170,19 @@ void whenDirectoryIsNotSetThenThrowException() { .isInstanceOf(IllegalArgumentException.class); } + @SneakyThrows + @Test + void givenAFileAlreadySavedWhenGetAdeAckFilesThenDoNotThrowException() { + Files.createFile(temporaryOutputPath.resolve("senderAdeAck1.txt")); + BDDMockito.doReturn(Collections.singletonList(defaultResponse.get(0))).when(restClient) + .getSenderAdeAckFiles(); + + // assert that FileExistsException is not thrown + StepContribution stepContribution = new StepContribution(execution); + assertThatCode(() -> tasklet.execute(stepContribution, chunkContext)) + .doesNotThrowAnyException(); + } + SenderAdeAckFilesRecoveryTasklet createDefaultTasklet() { SenderAdeAckFilesRecoveryTasklet tasklet = new SenderAdeAckFilesRecoveryTasklet(restClient); tasklet.setSenderAdeAckDirectory(temporaryOutputPath.toString()); From a784bf57a4ceb9f0cadc6292460e0e81c01fc24d Mon Sep 17 00:00:00 2001 From: Andrea Morabito <78792023+and-mora@users.noreply.github.com> Date: Tue, 8 Nov 2022 10:28:04 +0100 Subject: [PATCH 3/4] fix: [RTD-845] fix property path level (#292) --- app/src/main/resources/config/application.yml | 14 +++++++------- ops_resources/example_config/application.yml | 14 +++++++------- ops_resources/example_config/application_hbsql.yml | 14 +++++++------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/app/src/main/resources/config/application.yml b/app/src/main/resources/config/application.yml index c93f8201..19db438b 100644 --- a/app/src/main/resources/config/application.yml +++ b/app/src/main/resources/config/application.yml @@ -139,13 +139,6 @@ rest-client: url: /rtd/csv-transaction/publickey abi-to-fiscalcode-map: url: /rtd/abi-to-fiscalcode/conversion-map - sender-ade-ack: - list: - url: /rtd/file-register/sender-ade-ack - download-file: - url: /ade/{id} - received: - url: /rtd/file-register/ack-received/{id} mtls: enabled: ${HPAN_SERVICE_MTLS_ENABLED:true} key-store: @@ -161,6 +154,13 @@ rest-client: header: blobType: BlockBlob version: "2021-08-06" + sender-ade-ack: + list: + url: /rtd/file-register/sender-ade-ack + download-file: + url: /ade/{id} + received: + url: /rtd/file-register/ack-received/{id} feign: client: diff --git a/ops_resources/example_config/application.yml b/ops_resources/example_config/application.yml index e84671ae..c9563b77 100644 --- a/ops_resources/example_config/application.yml +++ b/ops_resources/example_config/application.yml @@ -138,13 +138,6 @@ rest-client: url: /rtd/csv-transaction/publickey abi-to-fiscalcode-map: url: /rtd/abi-to-fiscalcode/conversion-map - sender-ade-ack: - list: - url: /rtd/file-register/sender-ade-ack - download-file: - url: /ade/{id} - received: - url: /rtd/file-register/ack-received/{id} mtls: enabled: ${HPAN_SERVICE_MTLS_ENABLED:true} key-store: @@ -160,6 +153,13 @@ rest-client: header: blobType: BlockBlob version: "2021-08-06" + sender-ade-ack: + list: + url: /rtd/file-register/sender-ade-ack + download-file: + url: /ade/{id} + received: + url: /rtd/file-register/ack-received/{id} feign: client: diff --git a/ops_resources/example_config/application_hbsql.yml b/ops_resources/example_config/application_hbsql.yml index 986e4ada..7fc04c75 100644 --- a/ops_resources/example_config/application_hbsql.yml +++ b/ops_resources/example_config/application_hbsql.yml @@ -116,13 +116,6 @@ rest-client: url: /rtd/csv-transaction/publickey abi-to-fiscalcode-map: url: /rtd/abi-to-fiscalcode/conversion-map - sender-ade-ack: - list: - url: /rtd/file-register/sender-ade-ack - download-file: - url: /ade/{id} - received: - url: /rtd/file-register/ack-received/{id} mtls: enabled: ${HPAN_SERVICE_MTLS_ENABLED:true} key-store: @@ -138,6 +131,13 @@ rest-client: header: blobType: BlockBlob version: "2021-08-06" + sender-ade-ack: + list: + url: /rtd/file-register/sender-ade-ack + download-file: + url: /ade/{id} + received: + url: /rtd/file-register/ack-received/{id} feign: client: From 7c4e4073fb66ddac06182ab32f04fb5e9e61b68a Mon Sep 17 00:00:00 2001 From: Andrea Morabito <78792023+and-mora@users.noreply.github.com> Date: Wed, 9 Nov 2022 12:40:51 +0100 Subject: [PATCH 4/4] fix: [RTD-876] fix cve jackson with bump version from 2.13.4 to 2.14.0 (#294) --- pom.xml | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/pom.xml b/pom.xml index 0d28d6cb..4587589c 100644 --- a/pom.xml +++ b/pom.xml @@ -17,6 +17,12 @@ 1.8 2.7.4 + 42.5.0 + 3.1.4 + 1.33 + 2.11.0 + 1.70 + 2.14.0 3.1.2 3.0.0-M1 3.8.0 @@ -35,34 +41,41 @@ org.postgresql postgresql - 42.5.0 + ${postgresql.version} runtime org.springframework.cloud spring-cloud-contract-wiremock - 3.1.4 + ${springframework-cloud.version} test org.springframework.cloud spring-cloud-starter-openfeign - 3.1.4 + ${springframework-cloud.version} org.yaml snakeyaml - 1.33 + ${snakeyaml.version} commons-io commons-io - 2.11.0 + ${common-io.version} org.bouncycastle bcpg-jdk15on - 1.70 + ${bouncycastle.version} + + + com.fasterxml.jackson.core + jackson-databind + ${jackson-core.version} + pom + import it.gov.pagopa.rtd.ms.transaction_filter.integration