From 847dd90baa51d6b8ddc96571d6118372404e0acf Mon Sep 17 00:00:00 2001 From: John Kasper Svergja Date: Wed, 1 Sep 2021 11:13:03 +0200 Subject: [PATCH 1/9] =?UTF-8?q?Oppdatert=20github=20action=20workflow=20ti?= =?UTF-8?q?l=20=C3=A5=20f=C3=B8lge=20ny=20anbefaling?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit set-env skal ikke lengre brukes, ref: https://github.blog/changelog/2020-10-01-github-actions-deprecating-set-env-and-add-path-commands/ Den nye workflowen samler både bygg og deploy i samme fil --- .github/workflows/build.yml | 49 ++++++++++++++++++++++++++++------- .github/workflows/release.yml | 21 --------------- 2 files changed, 39 insertions(+), 31 deletions(-) delete mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5e7b4c3..75120be 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,12 +1,10 @@ -name: Build snapshot +name: Build and deploy on: [push] jobs: build: - runs-on: ubuntu-latest - strategy: matrix: java: [ '1.8', '11' ] @@ -21,17 +19,48 @@ jobs: - name: Build with Maven run: mvn -B package --no-transfer-progress --file pom.xml - deploy: + makeversion: + needs: build + runs-on: ubuntu-latest + name: Create version + outputs: + version: ${{ steps.version.outputs.version }} + steps: + - name: Decide on build version + id: version + run: | + if [[ $GITHUB_REF == *"tags"* ]]; then + TAG=${GITHUB_REF#refs/tags/} + else + TAG=${GITHUB_REF#refs/heads/}-SNAPSHOT + fi + echo ::set-output name=version::${TAG//\//-} + + deploy_snapshot: + if: startsWith(github.ref, 'refs/heads/') + needs: makeversion runs-on: ubuntu-latest - name: deploy snapshot + name: Deploy snapshot steps: - uses: actions/checkout@v1 - - name: Set release version - run: echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF:11}"-SNAPSHOT") - - name: Build and deploy to Sonatype snapshot - uses: digipost/action-maven-publish@1.1.0 + - uses: digipost/action-maven-publish@1.1.0 with: sonatype_secrets: ${{ secrets.sonatype_secrets }} - release_version: ${{ env.RELEASE_VERSION }} + release_version: ${{ needs.makeversion.outputs.version }} perform_release: false + + release: + if: startsWith(github.ref, 'refs/tags/') + runs-on: ubuntu-latest + needs: makeversion + name: Release to Sonatype + steps: + - name: Check out Git repository + uses: actions/checkout@v1 + - name: Release to Central Repository + uses: digipost/action-maven-publish@1.1.0 + with: + sonatype_secrets: ${{ secrets.sonatype_secrets }} + release_version: ${{ needs.makeversion.outputs.version }} + perform_release: true diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml deleted file mode 100644 index 29e9284..0000000 --- a/.github/workflows/release.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Release - -on: - push: - tags: - - '*' -jobs: - release: - runs-on: ubuntu-latest - name: Release - steps: - - name: Check out Git repository - uses: actions/checkout@v1 - - name: Set release version - run: echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF:10}) - - name: Release to Central Repository - uses: digipost/action-maven-publish@1.1.0 - with: - sonatype_secrets: ${{ secrets.sonatype_secrets }} - release_version: ${{ env.RELEASE_VERSION }} - perform_release: true From ad6066a1bd0cd01aa80cad5693d585a7a859cc3c Mon Sep 17 00:00:00 2001 From: John Kasper Svergja Date: Wed, 1 Sep 2021 11:18:41 +0200 Subject: [PATCH 2/9] Spesifiser encoding for StringEntity, da den er ISO_8859_1 hvis ikke annet spesifiseres --- .../no/difi/sdp/client2/internal/http/MessageSenderImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/no/difi/sdp/client2/internal/http/MessageSenderImpl.java b/src/main/java/no/difi/sdp/client2/internal/http/MessageSenderImpl.java index fb673a8..5431bd9 100644 --- a/src/main/java/no/difi/sdp/client2/internal/http/MessageSenderImpl.java +++ b/src/main/java/no/difi/sdp/client2/internal/http/MessageSenderImpl.java @@ -43,8 +43,10 @@ import java.io.IOException; import java.net.URI; +import java.nio.charset.StandardCharsets; import java.util.Optional; +import static java.nio.charset.StandardCharsets.UTF_8; import static java.util.stream.Collectors.toList; import static no.difi.sdp.client2.domain.exceptions.SendException.AntattSkyldig.fraHttpStatusCode; @@ -104,7 +106,7 @@ private void createMessage(StandardBusinessDocument sbd) throws IOException { LOG.debug("Generert følgende json, vil nå sende til integrasjonspunkt: {} ", json); HttpPost httpPost = new HttpPost(endpointUri + CREATE_ENDPOINT_PATH); - httpPost.setEntity(new StringEntity(json)); + httpPost.setEntity(new StringEntity(json, UTF_8)); httpPost.setHeader("content-type", "application/json"); CloseableHttpResponse response = httpClient.execute(httpPost); String responseEntity = EntityUtils.toString(response.getEntity()); From fe9cab1a4af35406fec4894c5bcb2b7052f69e2c Mon Sep 17 00:00:00 2001 From: John Kasper Svergja Date: Wed, 1 Sep 2021 11:47:16 +0200 Subject: [PATCH 3/9] bump jackson-version --- pom.xml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/pom.xml b/pom.xml index 0635061..7317505 100644 --- a/pom.xml +++ b/pom.xml @@ -5,6 +5,7 @@ 1.8 1.8 + 2.12.5 no.difi.sdp @@ -27,22 +28,22 @@ com.fasterxml.jackson.core jackson-core - 2.10.2 + ${jackson.version} com.fasterxml.jackson.core jackson-databind - 2.10.2 + ${jackson.version} com.fasterxml.jackson.core jackson-annotations - 2.10.2 + ${jackson.version} com.fasterxml.jackson.datatype jackson-datatype-jsr310 - 2.10.2 + ${jackson.version} org.apache.commons From 6571736d10f1bbd718a590e19655ae9a21b4edb1 Mon Sep 17 00:00:00 2001 From: John Kasper Svergja Date: Wed, 1 Sep 2021 11:48:06 +0200 Subject: [PATCH 4/9] Bump commons-io, commons-lang3 og jakarta.bind.xml-api --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 7317505..a6a9bea 100644 --- a/pom.xml +++ b/pom.xml @@ -48,7 +48,7 @@ org.apache.commons commons-lang3 - 3.9 + 3.12.0 no.digipost @@ -58,12 +58,12 @@ jakarta.xml.bind jakarta.xml.bind-api - 2.3.2 + 2.3.3 commons-io commons-io - 2.6 + 2.11.0 org.apache.httpcomponents From c2957dbb1a4ba5eb80e160674b103113d199f9d1 Mon Sep 17 00:00:00 2001 From: John Kasper Svergja Date: Wed, 1 Sep 2021 11:48:32 +0200 Subject: [PATCH 5/9] Bump httpclient og httpcore --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index a6a9bea..eba1b73 100644 --- a/pom.xml +++ b/pom.xml @@ -68,12 +68,12 @@ org.apache.httpcomponents httpcore - 4.4.13 + 4.4.14 org.apache.httpcomponents httpclient - 4.5.10 + 4.5.13 commons-logging From f29e6eea39afaed88cea779bc9f6d1d4431bf24f Mon Sep 17 00:00:00 2001 From: John Kasper Svergja Date: Wed, 1 Sep 2021 11:50:07 +0200 Subject: [PATCH 6/9] Bump certificate validator --- pom.xml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index eba1b73..64157cc 100644 --- a/pom.xml +++ b/pom.xml @@ -84,7 +84,7 @@ no.digipost certificate-validator - 2.0 + 2.3 @@ -262,6 +262,7 @@ commons-io org.bouncycastle:bcpkix-jdk15on org.bouncycastle:bcprov-jdk15on + org.bouncycastle:bcutil-jdk15on org.slf4j org.apache.commons org.apache.httpcomponents From f9607ad17727720f52d2040c9addb43bce57c519 Mon Sep 17 00:00:00 2001 From: John Kasper Svergja Date: Wed, 1 Sep 2021 11:50:28 +0200 Subject: [PATCH 7/9] Bump testavhengigheter --- pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pom.xml b/pom.xml index 64157cc..d5d1a75 100644 --- a/pom.xml +++ b/pom.xml @@ -100,20 +100,20 @@ org.hamcrest hamcrest - 2.1 + 2.2 test org.mockito mockito-core - 2.28.2 + 3.12.4 test no.digipost digg test - 0.19 + 0.30 org.slf4j From 1159124657c0b80d457ca39eca8522edf2768ad1 Mon Sep 17 00:00:00 2001 From: John Kasper Svergja Date: Wed, 1 Sep 2021 11:50:52 +0200 Subject: [PATCH 8/9] Bump slf4j og logback --- pom.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pom.xml b/pom.xml index d5d1a75..c03046b 100644 --- a/pom.xml +++ b/pom.xml @@ -118,12 +118,12 @@ org.slf4j slf4j-api - 1.7.26 + 1.7.32 ch.qos.logback logback-classic - 1.2.3 + 1.2.5 test From 1b2c8dc5ddc809b54ffda45c09ee2aa146ff6f4f Mon Sep 17 00:00:00 2001 From: John Kasper Svergja Date: Wed, 1 Sep 2021 11:57:11 +0200 Subject: [PATCH 9/9] Update NOTICE --- NOTICE | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/NOTICE b/NOTICE index 3258e94..c0beba8 100644 --- a/NOTICE +++ b/NOTICE @@ -13,6 +13,7 @@ This software includes third party software subject to the following licenses: Apache Commons Lang under Apache License, Version 2.0 Apache HttpClient under Apache License, Version 2.0 Apache HttpCore under Apache License, Version 2.0 + Bouncy Castle ASN.1 Extension and Utility APIs under Bouncy Castle Licence Bouncy Castle PKIX, CMS, EAC, TSP, PKCS, OCSP, CMP, and CRMF APIs under Bouncy Castle Licence Bouncy Castle Provider under Bouncy Castle Licence Digipost Certificate Validator under The Apache Software License, Version 2.0 @@ -23,11 +24,11 @@ This software includes third party software subject to the following licenses: Jackson-annotations under The Apache Software License, Version 2.0 Jackson-core under The Apache Software License, Version 2.0 jackson-databind under The Apache Software License, Version 2.0 - jakarta.xml.bind-api under Eclipse Distribution License - v 1.0 - JavaBeans Activation Framework API jar under EDL 1.0 + Jakarta Activation API jar under EDL 1.0 + Jakarta XML Binding API under Eclipse Distribution License - v 1.0 JAXB Runtime under Eclipse Distribution License - v 1.0 JAXB2 Basics - Runtime under BSD-Style License - JCL 1.2 implemented over SLF4J under MIT License + JCL 1.2 implemented over SLF4J under Apache License, Version 2.0 SDP Shared - XSD & JAXB under The Apache Software License, Version 2.0 Sikker digital post proxy-klient under The Apache Software License, Version 2.0 SLF4J API Module under MIT License