Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
6929b88
Support multiple documents
Oct 14, 2020
4e160cb
Do not restrict number of documents
Nov 4, 2020
babee93
Remove unused imports
runeflobakk Nov 9, 2020
69fb9a7
Change schema-URL to https
runeflobakk Nov 11, 2020
97b26fd
Collate bindings for each schema file
runeflobakk Nov 11, 2020
95bf095
Introduce type for href in ASiCE bundles
runeflobakk Nov 12, 2020
84e35b9
Safe URL-decoding of hrefs
runeflobakk Nov 18, 2020
4c4a15a
Try fix snapshot deploy
runeflobakk Nov 18, 2020
8aa02b0
Fix release deployment
runeflobakk Nov 18, 2020
14fe85b
Adds title and description to job
Jan 5, 2021
c63480d
Readd description for xml doc
Jan 5, 2021
6b7d797
Separate model for single and multiple documents
runeflobakk Jan 11, 2021
44c883d
Merge pull request #191 from digipost/multiple-documents-with-legacy-…
Jan 13, 2021
e7f4e36
Test marshalling of legacy portal manifest format
runeflobakk Jan 13, 2021
0e5f1a2
Fix duplicate InputStream acquiring
runeflobakk Jan 13, 2021
84873d0
Clean up marshalling tests
runeflobakk Jan 13, 2021
73124bf
Update Maven plugins and test dependencies
runeflobakk Jan 13, 2021
7067dcd
Show version/env info in Maven build
runeflobakk Jan 13, 2021
824b79a
Truncate timestamp to millis
runeflobakk Jan 13, 2021
080612f
Merge pull request #190 from digipost/oppdragstittel
Jan 14, 2021
aa39584
Merge branch 'main' into multiple-documents
Jan 20, 2021
b8bd73d
Add config for japicmp
runeflobakk Jan 22, 2021
1041648
Document deprecation of document element
runeflobakk Jan 22, 2021
7c67c6d
Upgrade equalsverifier
runeflobakk Jan 22, 2021
1e7b70d
Rename previous version property for japicmp
runeflobakk Jan 22, 2021
f8985ad
Support multiple documents for direct jobs
sarawe Feb 2, 2021
9a5ecfe
Update schema/xsd/direct.xsd
sarawe Feb 2, 2021
09ca531
Update schema/xsd/direct.xsd
sarawe Feb 2, 2021
73f560a
Remove type from documents-element
sarawe Feb 2, 2021
b6821cc
Adapt JAXB to multiple documents for direct-job
runeflobakk Feb 3, 2021
d5d6b19
Move getDocument() to MultipleDocumentsManifestWithLegacySingleDocume…
sarawe Feb 4, 2021
3c9bca4
Merge pull request #194 from digipost/multiple-docs-direct-job
sarawe Feb 4, 2021
559463b
Fix deprecate warnings
runeflobakk Feb 9, 2021
503343e
change example to new preferred structure
May 5, 2021
b937f3c
set maximum number of documents to 20
May 5, 2021
b91e8b6
Upgrade dependencies
runeflobakk Jun 18, 2021
26579c9
Upgrade notice and license Maven plugins
runeflobakk Jun 18, 2021
694a4ad
Replace with newer forked java-8-matchers
runeflobakk Jun 18, 2021
5d7dcb7
Bind "mime" as "mediaType"
runeflobakk Jun 21, 2021
f78fdbb
Some last-minute updates before release
runeflobakk Jun 22, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ jobs:
TAG=${GITHUB_REF#refs/heads/}-SNAPSHOT
fi
echo ::set-output name=version::${TAG//\//-}

deploy_snapshot:
if: startsWith(github.ref, 'refs/heads/')
needs: makeversion
Expand Down
4 changes: 2 additions & 2 deletions NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Licensed under Apache 2 - http://www.apache.org/licenses/LICENSE-2.0.html

This software includes third party software subject to the following licenses:

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
JAXB2 Basics - Runtime under BSD-Style License
Posten signering - API JAXB Classes under The Apache Software License, Version 2.0
Posten signering - API Schema under The Apache Software License, Version 2.0
Expand Down
4 changes: 2 additions & 2 deletions jaxb/NOTICE
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ Licensed under Apache 2 - http://www.apache.org/licenses/LICENSE-2.0.html

This software includes third party software subject to the following licenses:

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
JAXB2 Basics - Runtime under BSD-Style License
Posten signering - API JAXB Classes under The Apache Software License, Version 2.0

Expand Down
70 changes: 57 additions & 13 deletions jaxb/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,22 @@

<properties>
<xsd.directory>${project.basedir}/target/generated-resources/xsd</xsd.directory>
<project.previousVersion>set_with_-Dproject.previousVersion=X.Y</project.previousVersion>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.junit</groupId>
<artifactId>junit-bom</artifactId>
<version>5.5.2</version>
<version>5.8.0-M1</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>5.3.8</version>
<type>pom</type>
<scope>import</scope>
</dependency>
Expand All @@ -32,12 +40,12 @@
<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.4</version>
<scope>test</scope>
</dependency>
<dependency>
Expand All @@ -55,13 +63,11 @@
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>5.1.9.RELEASE</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-oxm</artifactId>
<version>5.2.9.RELEASE</version>
<optional>true</optional>
</dependency>
<dependency>
Expand All @@ -81,9 +87,9 @@
<scope>test</scope>
</dependency>
<dependency>
<groupId>co.unruly</groupId>
<groupId>uk.co.probablyfine</groupId>
<artifactId>java-8-matchers</artifactId>
<version>1.6</version>
<version>1.9</version>
<scope>test</scope>
<exclusions>
<exclusion>
Expand All @@ -95,25 +101,37 @@
<dependency>
<groupId>nl.jqno.equalsverifier</groupId>
<artifactId>equalsverifier</artifactId>
<version>3.4.3</version>
<version>3.6.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.javers</groupId>
<artifactId>javers-core</artifactId>
<version>6.2.2</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>no.digipost</groupId>
<artifactId>digg</artifactId>
<version>0.24</version>
<version>0.30</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>jcl-over-slf4j</artifactId>
<version>1.7.30</version>
<version>1.7.31</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
<version>1.7.30</version>
<version>1.7.31</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-xml</artifactId>
<version>3.1.1</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -128,7 +146,7 @@
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>3.1.1</version>
<version>3.3.0</version>
<configuration>
<excludePackageNames>no.digipost.signature.api.xml.*</excludePackageNames>
<detectOfflineLinks>false</detectOfflineLinks>
Expand All @@ -142,6 +160,32 @@
<noticeTemplate>${project.basedir}/../src/notice/NOTICE.template</noticeTemplate>
</configuration>
</plugin>
<plugin>
<groupId>com.github.siom79.japicmp</groupId>
<artifactId>japicmp-maven-plugin</artifactId>
<version>0.15.3</version>
<configuration>
<oldVersion>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>${project.artifactId}</artifactId>
<version>${project.previousVersion}</version>
</dependency>
</oldVersion>
<newVersion>
<file>
<path>${project.build.directory}/${project.build.finalName}.${project.packaging}</path>
</file>
</newVersion>
<parameter>
<onlyModified>true</onlyModified>
<onlyBinaryIncompatible>true</onlyBinaryIncompatible>
<includes>
<include>no.digipost.signature</include>
</includes>
</parameter>
</configuration>
</plugin>
</plugins>
</pluginManagement>
<plugins>
Expand Down Expand Up @@ -228,7 +272,7 @@
<plugin>
<groupId>org.apache.cxf.xjcplugins</groupId>
<artifactId>cxf-xjc-javadoc</artifactId>
<version>3.3.0</version>
<version>3.3.1</version>
</plugin>
<plugin>
<groupId>com.github.jaxb-xew-plugin</groupId>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* Copyright (C) Posten Norge AS
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package no.digipost.signature.api.xml;

import java.util.Optional;

import static java.util.Objects.requireNonNull;

public final class JobInformation {

private final String title;
private final Optional<String> nonSensitiveTitle;
private final Optional<String> description;

public JobInformation(String title, String nonSensitiveTitle, String description) {
this.title = requireNonNull(title, "title");
this.nonSensitiveTitle = Optional.ofNullable(nonSensitiveTitle);
this.description = Optional.ofNullable(description);
}

public String getTitle() {
return title;
}

public Optional<String> getNonSensitiveTitle() {
return nonSensitiveTitle;
}

public Optional<String> getDescription() {
return description;
}

}
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
/*
* Copyright (C) Posten Norge AS
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package no.digipost.signature.api.xml;

import java.util.List;

import static java.util.Arrays.asList;

interface MultipleDocumentsManifestWithLegacySingleDocumentSupport extends XMLManifest {

@Override
@SuppressWarnings("deprecation")
default JobInformation getJobInformation() {
no.digipost.signature.api.xml.legacy.XMLLegacyDocument singleDocument = getDocument();
if (singleDocument != null) {
return new JobInformation(singleDocument.getTitle(), singleDocument.getNonsensitiveTitle(), singleDocument.getDescription());
} else {
return new JobInformation(getTitle(), getNonsensitiveTitle(), getDescription());
}
}

@Override
default List<? extends XMLDocument> getDocumentsToSign() {
XMLDocument singleDocument = getDocument();
return singleDocument != null ? asList(singleDocument) : getDocuments();
}

@SuppressWarnings("deprecation")
no.digipost.signature.api.xml.legacy.XMLLegacyDocument getDocument();

List<? extends XMLDocument> getDocuments();

String getTitle();

String getDescription();

default String getNonsensitiveTitle() {
return null;
}

}
44 changes: 44 additions & 0 deletions jaxb/src/main/java/no/digipost/signature/api/xml/UrlEncoding.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright (C) Posten Norge AS
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
package no.digipost.signature.api.xml;

import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import java.net.URLEncoder;

final class UrlEncoding {

public static String decodeIfEncoded(String s) {
try {
return URLDecoder.decode(s, "UTF-8");
} catch (IllegalArgumentException notUrlEncoded) {
// illegal characters encountered while decoding, thus treating it as a
// non-encoded string, as an encoded string would not contain illegal characters.
return s;
} catch (UnsupportedEncodingException utf8NotSupported) {
throw new RuntimeException(utf8NotSupported.getMessage(), utf8NotSupported);
}
}

public static String encode(String s) {
try {
return URLEncoder.encode(s, "UTF-8");
} catch (UnsupportedEncodingException utf8NotSupported) {
throw new RuntimeException(utf8NotSupported.getMessage(), utf8NotSupported);
}
}

}
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* Copyright (C) Posten Norge AS
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/**
/*
* Copyright (C) Posten Norge AS
*
* Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -18,8 +18,7 @@
public interface XMLDocument {

String getTitle();
String getDescription();
String getHref();
String getMime();
XMLHref getHref();
String getMediaType();

}
Loading