Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
ivoMattus committed Jun 29, 2023
2 parents ce758a2 + be772b8 commit c239226
Show file tree
Hide file tree
Showing 3 changed files with 90 additions and 22 deletions.
62 changes: 52 additions & 10 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

# Signature Gateway demo application

Demo application is provided to study the flows and integration of Signature Gateway. **NB! This is not meant to be used in production!**
Demo application is provided to study the flows and integration of Signature Gateway. **NB! This is not meant to be used
in production!**

Functionality:

Expand All @@ -15,10 +16,13 @@ Functionality:

## How to set up

SiGa demo application is not a standalone system, it requires either the [SiGa application](https://github.com/open-eid/SiGa) to already be running on your machine or pointing the demo app towards sample APIs.
SiGa demo application is not a standalone system, it requires either
the [SiGa application](https://github.com/open-eid/SiGa) to already be running on your machine or pointing the demo app
towards sample APIs.

**Preconditions**:
- Java 17

- Java 17

### Option 1: Running with SiGa locally

Expand All @@ -28,27 +32,65 @@ To build the docker image run the following command:
./mvnw spring-boot:build-image
```

Then, follow the Docker instructions at [SiGa webapp](https://github.com/open-eid/SiGa) to run both apps at the same time.
Then, follow the Docker instructions at [SiGa webapp](https://github.com/open-eid/SiGa) to run both apps at the same
time.

If everything was successful, open up the browser at `https://siga-demo.localhost:9443/`.

### Option 2: Running with external APIs

To run the application with external APIs, open up the [application.properties](https://github.com/open-eid/SiGa-demo-application/blob/master/src/main/resources/application.properties) file and change the following properties accordingly:
1. Open up the
[application.properties](https://github.com/open-eid/SiGa-demo-application/blob/master/src/main/resources/application.properties)
file and change the following properties accordingly:

```
siga.api.uri=https://siga.localhost:8443/siga
siga.api.trustStore=classpath:siga_server_truststore.p12
siga.api.trustStore=file:/path/to/siga_server_truststore.p12
siga.api.trustStorePassword=changeit
siga.client.hmac.algorithm=HmacSHA256
siga.client.hmac.service-uuid=a7fd7728-a3ea-4975-bfab-f240a67e894f
siga.client.hmac.shared-signing-key=746573745365637265744b6579303031
```

| Parameter | Description | Example |
|---------------------|-------------|---------|
| siga.api.uri | SIGA server URL (without slash symbol in the end) | `https://siga.localhost:8443/siga` |
| siga.api.trustStore | Location of the trustore containing servers certificate or CA (path without quotes symbol) | `file:/path/to/siga_server_truststore.p12` |

2. Build this project

```bash
./mvnw clean install
```

3. Run compiled JAR (found in target folder)

```bash
java -jar siga-demo-application-X.X.X.jar
```

Now application is accessible at https://siga-demo.localhost:9443/.

### SiGa demo configuration

Example `application.properties` file can be seen [here](src/main/resources/application.properties).
Common Spring Boot properties are
described [here](https://docs.spring.io/spring-boot/docs/2.7.8/reference/html/application-properties.html).

| Parameter | Mandatory | Description | Example |
|-------------------------------------------|-----------|-------------------|---------|
| spring.servlet.multipart.max-file-size | N | Max file size. | `20MB` |
| spring.servlet.multipart.max-request-size | N | Max request size. | `35MB` |

## How to use

With Docker setup, Signature Gateway is in TEST mode. Meaning it is possible to sign only with TEST ID-card, TEST Mobile-ID or TEST Smart-ID.
Before every signing the webapage needs to be reloaded and files uploaded.

With Docker setup, Signature Gateway is in TEST mode. Meaning it is possible to sign only with TEST ID-card, TEST
Mobile-ID or TEST Smart-ID.

* TEST ID-cards can be ordered [here](https://www.skidsolutions.eu/teenused/testkaardid/).
* TEST Mobile-ID numbers can be found [here](https://github.com/SK-EID/MID/wiki/Test-number-for-automated-testing-in-DEMO).
* TEST Smart-ID numbers can be found [here](https://github.com/SK-EID/smart-id-documentation/wiki/Environment-technical-parameters#test-accounts-for-automated-testing).
* TEST ID-cards can be ordered [here](https://www.skidsolutions.eu/teenused/testkaardid/).
* TEST Mobile-ID numbers can be
found [here](https://github.com/SK-EID/MID/wiki/Test-number-for-automated-testing-in-DEMO).
* TEST Smart-ID numbers can be
found [here](https://github.com/SK-EID/smart-id-documentation/wiki/Environment-technical-parameters#test-accounts-for-automated-testing).
43 changes: 31 additions & 12 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.7.8</version>
<version>2.7.13</version>
</parent>

<groupId>ee.openeid.siga.client</groupId>
<artifactId>siga-demo-application</artifactId>
<version>3.0.0</version>
<version>3.1.0</version>
<description>Contains SiGa demo client application</description>
<packaging>jar</packaging>

Expand All @@ -25,17 +25,17 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.24</version>
<version>1.18.28</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-classic</artifactId>
<version>1.2.11</version>
<version>1.2.12</version>
</dependency>
<dependency>
<groupId>ch.qos.logback</groupId>
<artifactId>logback-core</artifactId>
<version>1.2.11</version>
<version>1.2.12</version>
</dependency>
<dependency>
<groupId>co.elastic.logging</groupId>
Expand All @@ -45,6 +45,12 @@
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
<exclusions>
<exclusion>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
Expand All @@ -70,7 +76,7 @@
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>31.1-jre</version>
<version>32.0.1-jre</version>
</dependency>
<dependency>
<groupId>javax.ws.rs</groupId>
Expand All @@ -80,20 +86,29 @@
<dependency>
<groupId>org.glassfish.jaxb</groupId>
<artifactId>jaxb-runtime</artifactId>
<version>4.0.1</version>
<version>4.0.3</version>
</dependency>

<dependency>
<groupId>org.digidoc4j</groupId>
<artifactId>digidoc4j</artifactId>
<version>5.0.0</version>
<version>5.1.0</version>
<exclusions>
<exclusion>
<groupId>org.bouncycastle</groupId>
<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.yaml</groupId>
<artifactId>snakeyaml</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.apache.httpcomponents</groupId>
<artifactId>httpclient</artifactId>
<version>4.5.14</version>
</dependency>
<dependency>
<groupId>org.bouncycastle</groupId>
<artifactId>bcpkix-jdk15on</artifactId>
Expand All @@ -102,7 +117,7 @@
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.22</version>
<version>1.23.0</version>
</dependency>

<dependency>
Expand All @@ -118,12 +133,12 @@
<dependency>
<groupId>org.webjars</groupId>
<artifactId>webjars-locator</artifactId>
<version>0.46</version>
<version>0.47</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
<artifactId>jquery</artifactId>
<version>3.6.3</version>
<version>3.6.4</version>
</dependency>
<dependency>
<groupId>org.webjars</groupId>
Expand All @@ -149,12 +164,16 @@
<groupId>org.webjars.npm</groupId>
<artifactId>bootstrap</artifactId>
</exclusion>
<exclusion>
<groupId>org.webjars.npm</groupId>
<artifactId>nuxt__opencollective</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.webjars.npm</groupId>
<artifactId>axios</artifactId>
<version>1.2.2</version>
<version>1.2.6</version>
</dependency>
<dependency>
<groupId>org.webjars.bower</groupId>
Expand Down
7 changes: 7 additions & 0 deletions src/main/resources/static/siga.xsd
Original file line number Diff line number Diff line change
Expand Up @@ -480,6 +480,7 @@
<xs:element name="signatureFormat" type="xs:string"/>
<xs:element name="signatureLevel" minOccurs="0" type="xs:string"/>
<xs:element name="signedBy" type="xs:string"/>
<xs:element name="subjectDistinguishedName" minOccurs="0" type="tns:subjectDistinguishedName"/>
<xs:element name="indication" type="xs:string"/>
<xs:element name="subIndication" minOccurs="0" type="xs:string"/>
<xs:element name="errors" minOccurs="0" maxOccurs="unbounded" type="tns:error"/>
Expand Down Expand Up @@ -526,4 +527,10 @@
<xs:element name="fileContent" type="xs:string"/>
</xs:sequence>
</xs:complexType>
<xs:complexType name="subjectDistinguishedName">
<xs:sequence>
<xs:element name="serialNumber" type="xs:string"/>
<xs:element name="commonName" type="xs:string"/>
</xs:sequence>
</xs:complexType>
</xs:schema>

0 comments on commit c239226

Please sign in to comment.