Skip to content
This repository has been archived by the owner on Jan 14, 2025. It is now read-only.

Commit

Permalink
Merge pull request #10 from difi/bugfix-stringentity
Browse files Browse the repository at this point in the history
Fix innsending med æ,ø,å
  • Loading branch information
johnksv authored Sep 2, 2021
2 parents 00cbd28 + 1b2c8dc commit b772f4c
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 50 deletions.
49 changes: 39 additions & 10 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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' ]
Expand All @@ -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/[email protected]
- uses: digipost/[email protected]
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/[email protected]
with:
sonatype_secrets: ${{ secrets.sonatype_secrets }}
release_version: ${{ needs.makeversion.outputs.version }}
perform_release: true
21 changes: 0 additions & 21 deletions .github/workflows/release.yml

This file was deleted.

7 changes: 4 additions & 3 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
32 changes: 17 additions & 15 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<jackson.version>2.12.5</jackson.version>
</properties>

<groupId>no.difi.sdp</groupId>
Expand All @@ -27,27 +28,27 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>2.10.2</version>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.10.2</version>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>2.10.2</version>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>2.10.2</version>
<version>${jackson.version}</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.9</version>
<version>3.12.0</version>
</dependency>
<dependency>
<groupId>no.digipost</groupId>
Expand All @@ -57,22 +58,22 @@
<dependency>
<groupId>jakarta.xml.bind</groupId>
<artifactId>jakarta.xml.bind-api</artifactId>
<version>2.3.2</version>
<version>2.3.3</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
<version>2.11.0</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpcore</artifactId>
<version>4.4.13</version>
<version>4.4.14</version>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.10</version>
<version>4.5.13</version>
<exclusions>
<exclusion>
<artifactId>commons-logging</artifactId>
Expand All @@ -83,7 +84,7 @@
<dependency>
<groupId>no.digipost</groupId>
<artifactId>certificate-validator</artifactId>
<version>2.0</version>
<version>2.3</version>
</dependency>

<dependency>
Expand All @@ -99,30 +100,30 @@
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest</artifactId>
<version>2.1</version>
<version>2.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>2.28.2</version>
<version>3.12.4</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>no.digipost</groupId>
<artifactId>digg</artifactId>
<scope>test</scope>
<version>0.19</version>
<version>0.30</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.26</version>
<version>1.7.32</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.3</version>
<version>1.2.5</version>
<scope>test</scope>
</dependency>
<dependency>
Expand Down Expand Up @@ -261,6 +262,7 @@
<include>commons-io</include>
<include>org.bouncycastle:bcpkix-jdk15on</include>
<include>org.bouncycastle:bcprov-jdk15on</include>
<include>org.bouncycastle:bcutil-jdk15on</include>
<include>org.slf4j</include>
<include>org.apache.commons</include>
<include>org.apache.httpcomponents</include>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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());
Expand Down

0 comments on commit b772f4c

Please sign in to comment.