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

Commit b772f4c

Browse files
authored
Merge pull request #10 from difi/bugfix-stringentity
Fix innsending med æ,ø,å
2 parents 00cbd28 + 1b2c8dc commit b772f4c

5 files changed

Lines changed: 63 additions & 50 deletions

File tree

.github/workflows/build.yml

Lines changed: 39 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
1-
name: Build snapshot
1+
name: Build and deploy
22

33
on: [push]
44

55
jobs:
66
build:
7-
87
runs-on: ubuntu-latest
9-
108
strategy:
119
matrix:
1210
java: [ '1.8', '11' ]
@@ -21,17 +19,48 @@ jobs:
2119
- name: Build with Maven
2220
run: mvn -B package --no-transfer-progress --file pom.xml
2321

24-
deploy:
22+
makeversion:
23+
needs: build
24+
runs-on: ubuntu-latest
25+
name: Create version
26+
outputs:
27+
version: ${{ steps.version.outputs.version }}
28+
steps:
29+
- name: Decide on build version
30+
id: version
31+
run: |
32+
if [[ $GITHUB_REF == *"tags"* ]]; then
33+
TAG=${GITHUB_REF#refs/tags/}
34+
else
35+
TAG=${GITHUB_REF#refs/heads/}-SNAPSHOT
36+
fi
37+
echo ::set-output name=version::${TAG//\//-}
38+
39+
deploy_snapshot:
40+
if: startsWith(github.ref, 'refs/heads/')
41+
needs: makeversion
2542
runs-on: ubuntu-latest
2643

27-
name: deploy snapshot
44+
name: Deploy snapshot
2845
steps:
2946
- uses: actions/checkout@v1
30-
- name: Set release version
31-
run: echo ::set-env name=RELEASE_VERSION::$(echo ${GITHUB_REF:11}"-SNAPSHOT")
32-
- name: Build and deploy to Sonatype snapshot
33-
uses: digipost/action-maven-publish@1.1.0
47+
- uses: digipost/action-maven-publish@1.1.0
3448
with:
3549
sonatype_secrets: ${{ secrets.sonatype_secrets }}
36-
release_version: ${{ env.RELEASE_VERSION }}
50+
release_version: ${{ needs.makeversion.outputs.version }}
3751
perform_release: false
52+
53+
release:
54+
if: startsWith(github.ref, 'refs/tags/')
55+
runs-on: ubuntu-latest
56+
needs: makeversion
57+
name: Release to Sonatype
58+
steps:
59+
- name: Check out Git repository
60+
uses: actions/checkout@v1
61+
- name: Release to Central Repository
62+
uses: digipost/action-maven-publish@1.1.0
63+
with:
64+
sonatype_secrets: ${{ secrets.sonatype_secrets }}
65+
release_version: ${{ needs.makeversion.outputs.version }}
66+
perform_release: true

.github/workflows/release.yml

Lines changed: 0 additions & 21 deletions
This file was deleted.

NOTICE

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ This software includes third party software subject to the following licenses:
1313
Apache Commons Lang under Apache License, Version 2.0
1414
Apache HttpClient under Apache License, Version 2.0
1515
Apache HttpCore under Apache License, Version 2.0
16+
Bouncy Castle ASN.1 Extension and Utility APIs under Bouncy Castle Licence
1617
Bouncy Castle PKIX, CMS, EAC, TSP, PKCS, OCSP, CMP, and CRMF APIs under Bouncy Castle Licence
1718
Bouncy Castle Provider under Bouncy Castle Licence
1819
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:
2324
Jackson-annotations under The Apache Software License, Version 2.0
2425
Jackson-core under The Apache Software License, Version 2.0
2526
jackson-databind under The Apache Software License, Version 2.0
26-
jakarta.xml.bind-api under Eclipse Distribution License - v 1.0
27-
JavaBeans Activation Framework API jar under EDL 1.0
27+
Jakarta Activation API jar under EDL 1.0
28+
Jakarta XML Binding API under Eclipse Distribution License - v 1.0
2829
JAXB Runtime under Eclipse Distribution License - v 1.0
2930
JAXB2 Basics - Runtime under BSD-Style License
30-
JCL 1.2 implemented over SLF4J under MIT License
31+
JCL 1.2 implemented over SLF4J under Apache License, Version 2.0
3132
SDP Shared - XSD & JAXB under The Apache Software License, Version 2.0
3233
Sikker digital post proxy-klient under The Apache Software License, Version 2.0
3334
SLF4J API Module under MIT License

pom.xml

Lines changed: 17 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
<properties>
66
<maven.compiler.source>1.8</maven.compiler.source>
77
<maven.compiler.target>1.8</maven.compiler.target>
8+
<jackson.version>2.12.5</jackson.version>
89
</properties>
910

1011
<groupId>no.difi.sdp</groupId>
@@ -27,27 +28,27 @@
2728
<dependency>
2829
<groupId>com.fasterxml.jackson.core</groupId>
2930
<artifactId>jackson-core</artifactId>
30-
<version>2.10.2</version>
31+
<version>${jackson.version}</version>
3132
</dependency>
3233
<dependency>
3334
<groupId>com.fasterxml.jackson.core</groupId>
3435
<artifactId>jackson-databind</artifactId>
35-
<version>2.10.2</version>
36+
<version>${jackson.version}</version>
3637
</dependency>
3738
<dependency>
3839
<groupId>com.fasterxml.jackson.core</groupId>
3940
<artifactId>jackson-annotations</artifactId>
40-
<version>2.10.2</version>
41+
<version>${jackson.version}</version>
4142
</dependency>
4243
<dependency>
4344
<groupId>com.fasterxml.jackson.datatype</groupId>
4445
<artifactId>jackson-datatype-jsr310</artifactId>
45-
<version>2.10.2</version>
46+
<version>${jackson.version}</version>
4647
</dependency>
4748
<dependency>
4849
<groupId>org.apache.commons</groupId>
4950
<artifactId>commons-lang3</artifactId>
50-
<version>3.9</version>
51+
<version>3.12.0</version>
5152
</dependency>
5253
<dependency>
5354
<groupId>no.digipost</groupId>
@@ -57,22 +58,22 @@
5758
<dependency>
5859
<groupId>jakarta.xml.bind</groupId>
5960
<artifactId>jakarta.xml.bind-api</artifactId>
60-
<version>2.3.2</version>
61+
<version>2.3.3</version>
6162
</dependency>
6263
<dependency>
6364
<groupId>commons-io</groupId>
6465
<artifactId>commons-io</artifactId>
65-
<version>2.6</version>
66+
<version>2.11.0</version>
6667
</dependency>
6768
<dependency>
6869
<groupId>org.apache.httpcomponents</groupId>
6970
<artifactId>httpcore</artifactId>
70-
<version>4.4.13</version>
71+
<version>4.4.14</version>
7172
</dependency>
7273
<dependency>
7374
<groupId>org.apache.httpcomponents</groupId>
7475
<artifactId>httpclient</artifactId>
75-
<version>4.5.10</version>
76+
<version>4.5.13</version>
7677
<exclusions>
7778
<exclusion>
7879
<artifactId>commons-logging</artifactId>
@@ -83,7 +84,7 @@
8384
<dependency>
8485
<groupId>no.digipost</groupId>
8586
<artifactId>certificate-validator</artifactId>
86-
<version>2.0</version>
87+
<version>2.3</version>
8788
</dependency>
8889

8990
<dependency>
@@ -99,30 +100,30 @@
99100
<dependency>
100101
<groupId>org.hamcrest</groupId>
101102
<artifactId>hamcrest</artifactId>
102-
<version>2.1</version>
103+
<version>2.2</version>
103104
<scope>test</scope>
104105
</dependency>
105106
<dependency>
106107
<groupId>org.mockito</groupId>
107108
<artifactId>mockito-core</artifactId>
108-
<version>2.28.2</version>
109+
<version>3.12.4</version>
109110
<scope>test</scope>
110111
</dependency>
111112
<dependency>
112113
<groupId>no.digipost</groupId>
113114
<artifactId>digg</artifactId>
114115
<scope>test</scope>
115-
<version>0.19</version>
116+
<version>0.30</version>
116117
</dependency>
117118
<dependency>
118119
<groupId>org.slf4j</groupId>
119120
<artifactId>slf4j-api</artifactId>
120-
<version>1.7.26</version>
121+
<version>1.7.32</version>
121122
</dependency>
122123
<dependency>
123124
<groupId>ch.qos.logback</groupId>
124125
<artifactId>logback-classic</artifactId>
125-
<version>1.2.3</version>
126+
<version>1.2.5</version>
126127
<scope>test</scope>
127128
</dependency>
128129
<dependency>
@@ -261,6 +262,7 @@
261262
<include>commons-io</include>
262263
<include>org.bouncycastle:bcpkix-jdk15on</include>
263264
<include>org.bouncycastle:bcprov-jdk15on</include>
265+
<include>org.bouncycastle:bcutil-jdk15on</include>
264266
<include>org.slf4j</include>
265267
<include>org.apache.commons</include>
266268
<include>org.apache.httpcomponents</include>

src/main/java/no/difi/sdp/client2/internal/http/MessageSenderImpl.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,10 @@
4343

4444
import java.io.IOException;
4545
import java.net.URI;
46+
import java.nio.charset.StandardCharsets;
4647
import java.util.Optional;
4748

49+
import static java.nio.charset.StandardCharsets.UTF_8;
4850
import static java.util.stream.Collectors.toList;
4951
import static no.difi.sdp.client2.domain.exceptions.SendException.AntattSkyldig.fraHttpStatusCode;
5052

@@ -104,7 +106,7 @@ private void createMessage(StandardBusinessDocument sbd) throws IOException {
104106
LOG.debug("Generert følgende json, vil nå sende til integrasjonspunkt: {} ", json);
105107

106108
HttpPost httpPost = new HttpPost(endpointUri + CREATE_ENDPOINT_PATH);
107-
httpPost.setEntity(new StringEntity(json));
109+
httpPost.setEntity(new StringEntity(json, UTF_8));
108110
httpPost.setHeader("content-type", "application/json");
109111
CloseableHttpResponse response = httpClient.execute(httpPost);
110112
String responseEntity = EntityUtils.toString(response.getEntity());

0 commit comments

Comments
 (0)