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 #107 from difi/bump-dependencies
Browse files Browse the repository at this point in the history
Bump dependencies
  • Loading branch information
johnksv authored Sep 3, 2021
2 parents 5a8f6fd + 2db3e05 commit 1a4c12d
Show file tree
Hide file tree
Showing 10 changed files with 105 additions and 77 deletions.
54 changes: 44 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,53 @@ jobs:
- name: Build with Maven
run: mvn -B package --no-transfer-progress --file pom.xml

deploy:
makeversion:
if: github.ref != 'refs/heads/main'
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//\//-}
name: deploy snapshot
deploy_snapshot:
if: startsWith(github.ref, 'refs/heads/')
needs: makeversion
runs-on: ubuntu-latest

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]
with:
submodules: true
- 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
with:
submodules: true
- 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.

53 changes: 31 additions & 22 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<sdp-shared.version>2.13</sdp-shared.version>
<sdp-shared.version>3.0</sdp-shared.version>

<spring.ws.version>3.0.7.RELEASE</spring.ws.version>
<spring.ws.version>3.1.1</spring.ws.version>
</properties>

<groupId>no.difi.sdp</groupId>
<artifactId>sikker-digital-post-klient-java</artifactId>
<version>5.10-SNAPSHOT</version>
<version>LOCAL-SNAPSHOT</version>
<name>Sikker digital post-klient</name>

<description>
Expand All @@ -30,63 +30,63 @@
<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>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>2.3.2</version>
<version>2.3.5</version>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>com.sun.activation</groupId>
<artifactId>jakarta.activation</artifactId>
<version>1.2.1</version>
<version>1.2.2</version>
<scope>runtime</scope>
</dependency>

<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.12</version>
<version>1.15</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.19</version>
<version>1.21</version>
</dependency>

<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-lang3</artifactId>
<version>3.9</version>
<version>3.12.0</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.11</version>
<version>4.4.14</version>
</dependency>

<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
<version>1.62</version>
<version>1.69</version>
</dependency>

<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcprov-jdk15on</artifactId>
<version>1.62</version>
<version>1.69</version>
</dependency>

<dependency>
Expand Down Expand Up @@ -153,41 +153,41 @@
<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.apache.santuario</groupId>
<artifactId>xmlsec</artifactId>
<version>2.1.4</version>
<version>2.2.2</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
<version>1.7.26</version>
<version>1.7.32</version>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.26</version>
<version>1.7.32</version>
<scope>runtime</scope>
</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>
</dependencies>
Expand All @@ -196,14 +196,14 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>5.1.8.RELEASE</version>
<version>5.3.9</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.5.0</version>
<version>5.8.0-RC1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand Down Expand Up @@ -321,6 +321,7 @@
<includes>
<include>commons-codec</include>
<include>commons-io</include>
<include>org.bouncycastle:bcutil-jdk15on</include>
<include>org.bouncycastle:bcpkix-jdk15on</include>
<include>org.bouncycastle:bcprov-jdk15on</include>
<include>org.codehaus.woodstox:stax2-api</include>
Expand All @@ -340,16 +341,24 @@
<include>org.springframework.ws</include>
<include>org.springframework.security</include>
<include>no.digipost:certificate-validator</include>
<include>javax.xml.stream:stax-api</include>
<include>jakarta.xml.bind</include>
<include>org.glassfish.jaxb</include>
<include>jakarta.xml.soap:jakarta.xml.soap-api</include>
<include>com.sun.istack</include>
<include>jakarta.activation</include>
<include>com.sun.activation:jakarta.activation</include>
<include>javax.activation:activation</include>
<include>com.sun.xml.fastinfoset</include>
<include>com.sun.xml.messaging.saaj</include>
<include>org.jvnet.mimepull:mimepull</include>
<include>org.jvnet.staxex:stax-ex</include>
<include>org.cryptacular:cryptacular</include>
<include>com.google.guava:guava</include>
<include>com.google.guava:failureaccess</include>
<include>joda-time:joda-time</include>
<include>jakarta.jws:jakarta.jws-api</include>
<include>jakarta.xml.ws:jakarta.xml.ws-api</include>
</includes>
<searchTransitive>true</searchTransitive>
<message>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import org.etsi.uri._01903.v1_3.SignedProperties;
import org.etsi.uri._01903.v1_3.SignedSignatureProperties;
import org.etsi.uri._01903.v1_3.SigningCertificate;
import org.w3.xmldsig.X509IssuerSerialType;
import no.digipost.org.w3.xmldsig.X509IssuerSerialType;

import javax.xml.crypto.dsig.DigestMethod;

Expand All @@ -26,7 +26,7 @@

class CreateXAdESArtifacts {

private static final org.w3.xmldsig.DigestMethod sha1DigestMethod = new org.w3.xmldsig.DigestMethod(emptyList(), DigestMethod.SHA1);
private static final no.digipost.org.w3.xmldsig.DigestMethod sha1DigestMethod = new no.digipost.org.w3.xmldsig.DigestMethod(emptyList(), DigestMethod.SHA1);
private final Clock clock;


Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import no.digipost.api.representations.EbmsForsendelse;
import no.digipost.api.representations.Organisasjonsnummer;
import no.digipost.api.representations.StandardBusinessDocumentFactory;
import org.unece.cefact.namespaces.standardbusinessdocumentheader.StandardBusinessDocument;
import no.digipost.org.unece.cefact.namespaces.standardbusinessdocumentheader.StandardBusinessDocument;

import java.time.ZonedDateTime;
import java.util.UUID;
Expand Down
11 changes: 8 additions & 3 deletions src/main/java/no/difi/sdp/client2/internal/SDPBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@
import no.difi.sdp.client2.domain.fysisk_post.KonvoluttAdresse;
import no.difi.sdp.client2.domain.fysisk_post.KonvoluttAdresse.Type;
import no.difi.sdp.client2.domain.fysisk_post.Printinstruksjon;
import org.w3.xmldsig.Reference;
import org.w3.xmldsig.Signature;
import no.digipost.org.w3.xmldsig.Reference;
import no.digipost.org.w3.xmldsig.Signature;

import java.time.ZonedDateTime;
import java.util.ArrayList;
Expand Down Expand Up @@ -127,7 +127,12 @@ private SDPDigitalPostInfo sdpDigitalPostinfo(final Forsendelse forsendelse) {
SDPTittel tittel = new SDPTittel(digitalPost.getIkkeSensitivTittel(), forsendelse.getSpraakkode());
SDPVarsler varsler = sdpVarsler(forsendelse);

return new SDPDigitalPostInfo(virkningstidspunkt, null, aapningskvittering, sikkerhetsnivaa, tittel, varsler);
return new SDPDigitalPostInfo()
.withVirkningstidspunkt(virkningstidspunkt)
.withAapningskvittering(aapningskvittering)
.withSikkerhetsnivaa(sikkerhetsnivaa)
.withIkkeSensitivTittel(tittel)
.withVarsler(varsler);
}

private SDPFysiskPostInfo sdpFysiskPostInfo(FysiskPost fysiskPost) {
Expand Down
22 changes: 11 additions & 11 deletions src/test/java/no/difi/sdp/client2/ObjectMother.java
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,17 @@
import no.digipost.api.representations.StandardBusinessDocumentFactory;
import no.digipost.security.DigipostSecurity;
import org.springframework.core.io.ClassPathResource;
import org.unece.cefact.namespaces.standardbusinessdocumentheader.BusinessScope;
import org.unece.cefact.namespaces.standardbusinessdocumentheader.DocumentIdentification;
import org.unece.cefact.namespaces.standardbusinessdocumentheader.Partner;
import org.unece.cefact.namespaces.standardbusinessdocumentheader.PartnerIdentification;
import org.unece.cefact.namespaces.standardbusinessdocumentheader.Scope;
import org.unece.cefact.namespaces.standardbusinessdocumentheader.StandardBusinessDocument;
import org.unece.cefact.namespaces.standardbusinessdocumentheader.StandardBusinessDocumentHeader;
import org.w3.xmldsig.DigestMethod;
import org.w3.xmldsig.Reference;
import org.w3.xmldsig.Transform;
import org.w3.xmldsig.Transforms;
import no.digipost.org.unece.cefact.namespaces.standardbusinessdocumentheader.BusinessScope;
import no.digipost.org.unece.cefact.namespaces.standardbusinessdocumentheader.DocumentIdentification;
import no.digipost.org.unece.cefact.namespaces.standardbusinessdocumentheader.Partner;
import no.digipost.org.unece.cefact.namespaces.standardbusinessdocumentheader.PartnerIdentification;
import no.digipost.org.unece.cefact.namespaces.standardbusinessdocumentheader.Scope;
import no.digipost.org.unece.cefact.namespaces.standardbusinessdocumentheader.StandardBusinessDocument;
import no.digipost.org.unece.cefact.namespaces.standardbusinessdocumentheader.StandardBusinessDocumentHeader;
import no.digipost.org.w3.xmldsig.DigestMethod;
import no.digipost.org.w3.xmldsig.Reference;
import no.digipost.org.w3.xmldsig.Transform;
import no.digipost.org.w3.xmldsig.Transforms;

import java.io.ByteArrayInputStream;
import java.io.FileInputStream;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
import org.junit.jupiter.api.BeforeEach;
import org.junit.jupiter.api.Test;
import org.springframework.oxm.jaxb.Jaxb2Marshaller;
import org.w3.xmldsig.Reference;
import org.w3.xmldsig.SignedInfo;
import org.w3.xmldsig.X509IssuerSerialType;
import no.digipost.org.w3.xmldsig.Reference;
import no.digipost.org.w3.xmldsig.SignedInfo;
import no.digipost.org.w3.xmldsig.X509IssuerSerialType;
import org.w3c.dom.Document;
import org.w3c.dom.Node;
import org.w3c.dom.NodeList;
Expand Down Expand Up @@ -101,7 +101,7 @@ public void test_generated_signatures() {
XAdESSignatures xAdESSignatures = (XAdESSignatures) marshaller.unmarshal(new StreamSource(new ByteArrayInputStream(signature.getBytes())));

assertThat(xAdESSignatures.getSignatures(), hasSize(1));
org.w3.xmldsig.Signature dSignature = xAdESSignatures.getSignatures().get(0);
no.digipost.org.w3.xmldsig.Signature dSignature = xAdESSignatures.getSignatures().get(0);
verify_signed_info(dSignature.getSignedInfo());
assertThat(dSignature.getSignatureValue(), notNullValue());
assertThat(dSignature.getKeyInfo(), notNullValue());
Expand Down Expand Up @@ -142,7 +142,7 @@ public void test_xades_signed_properties() {
Signature signature = sut.createSignature(noekkelpar, files);

XAdESSignatures xAdESSignatures = (XAdESSignatures) marshaller.unmarshal(new StreamSource(new ByteArrayInputStream(signature.getBytes())));
org.w3.xmldsig.Object object = xAdESSignatures.getSignatures().get(0).getObjects().get(0);
no.digipost.org.w3.xmldsig.Object object = xAdESSignatures.getSignatures().get(0).getObjects().get(0);

QualifyingProperties xadesProperties = (QualifyingProperties) object.getContent().get(0);
SigningCertificate signingCertificate = xadesProperties.getSignedProperties().getSignedSignatureProperties().getSigningCertificate();
Expand Down
Loading

0 comments on commit 1a4c12d

Please sign in to comment.