Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/develop' into issues/merge-ups…
Browse files Browse the repository at this point in the history
…tream
  • Loading branch information
banterCZ committed Jun 21, 2024
2 parents 01059b9 + 6025666 commit 17733f7
Show file tree
Hide file tree
Showing 56 changed files with 3,149 additions and 582 deletions.
4 changes: 4 additions & 0 deletions deploy/enrollment-server.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,15 @@

<!-- PowerAuth Service Configuration -->
<Parameter name="powerauth.service.url" value="${ENROLLMENT_SERVER_POWERAUTH_SERVICE_URL:http://localhost:8080/powerauth-java-server/rest}"/>
<Parameter name="powerauth.service.restClientConfig.responseTimeout" value="${ENROLLMENT_SERVER_POWERAUTH_SERVICE_RESPONSE_TIMEOUT:60s}"/>
<Parameter name="powerauth.service.restClientConfig.maxIdleTime" value="${ENROLLMENT_SERVER_POWERAUTH_SERVICE_MAX_IDLE_TIME:200s}"/>
<Parameter name="powerauth.service.security.clientToken" value="${ENROLLMENT_SERVER_SECURITY_CLIENT_TOKEN:}"/>
<Parameter name="powerauth.service.security.clientSecret" value="${ENROLLMENT_SERVER_SECURITY_CLIENT_SECRET:}"/>

<!-- PowerAuth Push Service Configuration -->
<Parameter name="powerauth.push.service.url" value="${ENROLLMENT_SERVER_PUSH_SERVER_URL:}"/>
<Parameter name="powerauth.push.service.restClientConfig.responseTimeout" value="${ENROLLMENT_SERVER_PUSH_SERVER_RESPONSE_TIMEOUT:60s}"/>
<Parameter name="powerauth.push.service.restClientConfig.maxIdleTime" value="${ENROLLMENT_SERVER_PUSH_SERVER__MAX_IDLE_TIME:200s}"/>

<!-- Enrollment Server Configuration -->
<Parameter name="enrollment-server.mtoken.enabled" value="${ENROLLMENT_SERVER_MTOKEN_ENABLED:true}"/>
Expand Down
2 changes: 2 additions & 0 deletions deploy/env.list.tmp
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
ENROLLMENT_SERVER_POWERAUTH_SERVICE_URL=http://localhost:8080/powerauth-java-server/rest
ENROLLMENT_SERVER_POWERAUTH_SERVICE_RESPONSE_TIMEOUT=60s
ENROLLMENT_SERVER_POWERAUTH_SERVICE_MAX_IDLE_TIME=200s
ENROLLMENT_SERVER_SECURITY_CLIENT_TOKEN=
ENROLLMENT_SERVER_SECURITY_CLIENT_SECRET=
ENROLLMENT_SERVER_PUSH_SERVER_URL=
Expand Down
23 changes: 23 additions & 0 deletions docs-private/Developer-How-To-Start.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,29 @@ Others (like URL, username, password) depend on your environment.
liquibase --changelog-file=./docs/db/changelog/changesets/enrollment-server/db.changelog-module.xml --url=jdbc:postgresql://localhost:5432/powerauth --username=powerauth status
```

To generate SQL script run this command.


#### Oracle

```shell
liquibase --changeLogFile=./docs/db/changelog/changesets/enrollment-server/db.changelog-module.xml --output-file=./docs/sql/oracle/generated-oracle-script.sql updateSQL --url=offline:oracle
```


#### MS SQL

```shell
liquibase --changeLogFile=./docs/db/changelog/changesets/enrollment-server/db.changelog-module.xml --output-file=./docs/sql/mssql/generated-mssql-script.sql updateSQL --url=offline:mssql
```


#### PostgreSQL

```shell
liquibase --changeLogFile=./docs/db/changelog/changesets/enrollment-server/db.changelog-module.xml --output-file=./docs/sql/postgresql/generated-postgresql-script.sql updateSQL --url=offline:postgresql
```


### Docker

Expand Down
20 changes: 12 additions & 8 deletions docs/Configuration-Properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,21 @@ The Enrollment Server uses the following public configuration properties:

## PowerAuth Service Configuration

| Property | Default | Note |
|---|---|---|
| `powerauth.service.url` | `http://localhost:8080/powerauth-java-server/rest` | PowerAuth service REST API base URL. |
| `powerauth.service.security.clientToken` | `_empty_` | PowerAuth REST API authentication token. |
| `powerauth.service.security.clientSecret` | `_empty_` | PowerAuth REST API authentication secret / password. |
| Property | Default | Note |
|------------------------------------------------------|----------------------------------------------------|------------------------------------------------------|
| `powerauth.service.url` | `http://localhost:8080/powerauth-java-server/rest` | PowerAuth service REST API base URL. |
| `powerauth.service.restClientConfig.responseTimeout` | `60s` | PowerAuth REST API response timeout. |
| `powerauth.service.restClientConfig.maxIdleTime` | `200s` | PowerAuth REST API max idle time. |
| `powerauth.service.security.clientToken` | `_empty_` | PowerAuth REST API authentication token. |
| `powerauth.service.security.clientSecret` | `_empty_` | PowerAuth REST API authentication secret / password. |

## PowerAuth Push Service Configuration

| Property | Default | Note |
|---|---|---|
| `powerauth.push.service.url` | `http://localhost:8080/powerauth-push-server` | PowerAuth Push service REST API base URL. |
| Property | Default | Note |
|-----------------------------------------------------------|-----------------------------------------------|---------------------------------------------------|
| `powerauth.push.service.url` | `http://localhost:8080/powerauth-push-server` | PowerAuth Push service REST API base URL. |
| `powerauth.push.service.restClientConfig.responseTimeout` | `60s` | PowerAuth Push service REST API response timeout. |
| `powerauth.push.service.restClientConfig.maxIdleTime` | `200s` | PowerAuth Push service REST API max idle time. |

## Enrollment Server Configuration

Expand Down
19 changes: 10 additions & 9 deletions docs/Database-Structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,15 @@ For more information, see [Operation Extensions](Operation-Extensions.md) and [C

#### Schema

| Name | Type | Info | Note |
|---------------|----------------|------------------------|------------------------------------------------------------------------------------------|
| `id` | `BIGINT` | `NOT NULL PRIMARY KEY` | Autogenerated record identifier. |
| `placeholder` | `VARCHAR(255)` | `NOT NULL` | Operation type at PowerAuth server. |
| `language` | `VARCHAR(8)` | `NOT NULL` | Language of the template. |
| `title` | `VARCHAR(255)` | `NOT NULL` | Title of the operation. |
| `message` | `TEXT` | `NOT NULL` | Message for the user related to the operation. |
| `attributes` | `TEXT` | | Structured custom form data attributes as JSON. |
| `ui` | `TEXT` | | JSON configuration which may affect behavior or visual aspect of the mobile application. |
| Name | Type | Info | Note |
|----------------|----------------|------------------------|------------------------------------------------------------------------------------------|
| `id` | `BIGINT` | `NOT NULL PRIMARY KEY` | Autogenerated record identifier. |
| `placeholder` | `VARCHAR(255)` | `NOT NULL` | Operation type at PowerAuth server. |
| `language` | `VARCHAR(8)` | `NOT NULL` | Language of the template. |
| `title` | `VARCHAR(255)` | `NOT NULL` | Title of the operation. |
| `message` | `TEXT` | `NOT NULL` | Message for the user related to the operation. |
| `result_texts` | `TEXT` | | Customized texts to display for `success`, `failure`, or `reject` operations as JSON. |
| `attributes` | `TEXT` | | Structured custom form data attributes as JSON. |
| `ui` | `TEXT` | | JSON configuration which may affect behavior or visual aspect of the mobile application. |

<!-- end -->
1 change: 1 addition & 0 deletions docs/Migration-Instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

This page contains PowerAuth Enrollment Server migration instructions.

- [PowerAuth Enrollment Server 1.8.0](./PowerAuth-Enrollment-Server-1.8.0.md)
- [PowerAuth Enrollment Server 1.7.0](./PowerAuth-Enrollment-Server-1.7.0.md)
- [PowerAuth Enrollment Server 1.6.0](./PowerAuth-Enrollment-Server-1.6.0.md)
- [PowerAuth Enrollment Server 1.5.0](./PowerAuth-Enrollment-Server-1.5.0.md)
Expand Down
8 changes: 7 additions & 1 deletion docs/Operation-Form-Data.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@ When creating an operation, you can customize the operation form data. This cust

## Standard Operation Form Data Attributes

Following attributes are required to be specified for each operation:
Following attributes are **required** to be specified for each operation:

- `title` - title of the operation
- `message` - message for the user related to the operation

Following attributes are **optional** to be specified for each operation:

- `resultTexts.success` - Customized text to display for _success_ operation. If not provided, the default message will be used.
- `resultTexts.failure` - Customized text to display for _failure_ operation. If not provided, the default message will be used.
- `resultTexts.reject` - Customized text to display for _reject_ operation. If not provided, the default message will be used.

## Custom Operation Form Data Attributes

Following structured custom form data attributes are available:
Expand Down
19 changes: 19 additions & 0 deletions docs/PowerAuth-Enrollment-Server-1.8.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Migration from 1.7.x to 1.8.x

This guide contains instructions for migration from PowerAuth Enrollment Server version `1.7.x` to version `1.8.0`.


## Database Changes

For convenience, you can use liquibase for your database migration.

For manual changes use SQL scripts:

- [PostgreSQL script](./sql/postgresql/enrollment/migration_1.7.0_1.8.0.sql)
- [Oracle script](./sql/oracle/enrollment/migration_1.7.0_1.8.0.sql)


### Add Column result_texts

A column `result_texts` has been added to the table `es_operation_template`.
It is an optional JSON representing customized texts to display for `success`, `failure`, or `reject` operations.
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.9.xsd">

<changeSet id="1" logicalFilePath="enrollment-server/1.8.x/20240620-add-resultTexts.xml" author="Lubos Racansky">
<preConditions onFail="MARK_RAN">
<not>
<columnExists tableName="es_operation_template" columnName="result_texts"/>
</not>
</preConditions>
<comment>Add result_texts column</comment>
<addColumn tableName="es_operation_template">
<column name="result_texts" type="text" />
</addColumn>
</changeSet>

</databaseChangeLog>
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?xml version="1.0" encoding="UTF-8"?>
<databaseChangeLog xmlns="http://www.liquibase.org/xml/ns/dbchangelog"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.liquibase.org/xml/ns/dbchangelog http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-4.9.xsd">

<include file="20240620-add-resultTexts.xml" relativeToChangelogFile="true" />

</databaseChangeLog>
Original file line number Diff line number Diff line change
Expand Up @@ -10,5 +10,6 @@

<include file="1.4.x/db.changelog-version.xml" relativeToChangelogFile="true" />
<include file="1.5.x/db.changelog-version.xml" relativeToChangelogFile="true" />
<include file="1.8.x/db.changelog-version.xml" relativeToChangelogFile="true" />

</databaseChangeLog>
12 changes: 7 additions & 5 deletions docs/onboarding/Configuration-Properties.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,13 @@ The Onboarding Server uses the following public configuration properties:

## PowerAuth Service Configuration

| Property | Default | Note |
|---|---|---|
| `powerauth.service.url` | `http://localhost:8080/powerauth-java-server/rest` | PowerAuth service REST API base URL. |
| `powerauth.service.security.clientToken` | `_empty_` | PowerAuth REST API authentication token. |
| `powerauth.service.security.clientSecret` | `_empty_` | PowerAuth REST API authentication secret / password. |
| Property | Default | Note |
|------------------------------------------------------|----------------------------------------------------|------------------------------------------------------|
| `powerauth.service.url` | `http://localhost:8080/powerauth-java-server/rest` | PowerAuth service REST API base URL. |
| `powerauth.service.restClientConfig.responseTimeout` | `60s` | PowerAuth REST API response timeout. |
| `powerauth.service.restClientConfig.maxIdleTime` | `200s` | PowerAuth REST API max idle time. |
| `powerauth.service.security.clientToken` | `_empty_` | PowerAuth REST API authentication token. |
| `powerauth.service.security.clientSecret` | `_empty_` | PowerAuth REST API authentication secret / password. |

## Onboarding Process Configuration

Expand Down
2 changes: 2 additions & 0 deletions docs/onboarding/Migration-Instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,7 @@

This page contains PowerAuth Enrollment Onboarding Server migration instructions.

- [PowerAuth Enrollment Onboarding Server 1.8.0](./PowerAuth-Enrollment-Onboarding-Server-1.8.0.md)
- [PowerAuth Enrollment Onboarding Server 1.7.0](./PowerAuth-Enrollment-Onboarding-Server-1.7.0.md)
- [PowerAuth Enrollment Onboarding Server 1.6.0](./PowerAuth-Enrollment-Onboarding-Server-1.6.0.md)
- [PowerAuth Enrollment Onboarding Server 1.5.0](./PowerAuth-Enrollment-Onboarding-Server-1.5.0.md)
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Migration from 1.6.x to 1.7.x

This guide contains instructions for migration from PowerAuth Enrollment Onboarding Server version `1.6.x` to version `1.7.0`.

No migration steps nor database changes are required.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Migration from 1.7.x to 1.8.x

This guide contains instructions for migration from PowerAuth Enrollment Onboarding Server version `1.7.x` to version `1.8.0`.

No migration steps nor database changes are required.
3 changes: 3 additions & 0 deletions docs/sql/oracle/enrollment/migration_1.7.0_1.8.0.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- Changeset enrollment-server/1.8.x/20240620-add-resultTexts.xml::1::Lubos Racansky
-- Add result_texts column
ALTER TABLE es_operation_template ADD result_texts CLOB;
3 changes: 3 additions & 0 deletions docs/sql/postgresql/enrollment/migration_1.7.0_1.8.0.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- Changeset enrollment-server/1.8.x/20240620-add-resultTexts.xml::1::Lubos Racansky
-- Add result_texts column
ALTER TABLE es_operation_template ADD result_texts TEXT;
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
import java.io.Serial;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
* Template list response.
Expand All @@ -36,6 +37,6 @@ public class TemplateListResponse extends ArrayList<TemplateListResponse.Templat
private static final long serialVersionUID = -5446919236567435144L;

@Builder
public record TemplateDetail(String name, String title, String message, List<Object> attributes, String language) {
public record TemplateDetail(String name, String title, String message, List<Object> attributes, String language, Map<String, String> resultTexts) {
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
spring.datasource.url=jdbc:h2:mem:testdb
spring.jpa.hibernate.ddl-auto=create
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
insert into public.es_operation_template (id, placeholder, language, title, message, attributes, ui, result_texts)
values
(1, 'authorize_payment', 'en', 'Payment Approval', 'Please confirm the payment', '[
{
"id": "operation.amount",
"type": "AMOUNT",
"text": "Amount",
"params": {
"amount": "amount",
"currency": "currency"
}
},
{
"id": "operation.account",
"type": "KEY_VALUE",
"text": "To Account",
"params": {
"value": "iban"
}
}
]', null,
'{
"success": "Payment of ${amount} ${currency} was confirmed",
"reject": "Payment was rejected",
"failure": "Payment approval failed"
}');
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@
@ActiveProfiles("test")
class InnovatricsRestApiServiceTest {

static final int PORT = 52936;
// TODO (racansky, 2024-06-17) find the way how to set the same random port for mock server and property
static final int PORT = 52937;

@Autowired
private InnovatricsApiService tested;
Expand Down
1 change: 1 addition & 0 deletions enrollment-server-onboarding-provider-zenid/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@
<generateModels>true</generateModels>
<generateModelTests>false</generateModelTests>
<generateSupportingFiles>false</generateSupportingFiles>
<skipValidateSpec>true</skipValidateSpec>
<configOptions>
<library>native</library>
<hideGenerationTimestamp>true</hideGenerationTimestamp>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -570,7 +570,7 @@ private String toExtractedData(OwnerId id, ZenidSharedMineAllResult minedData) t

private DocumentVerificationStatus toStatus(ZenidWebInvestigateResponse.StateEnum stateEnum) {
return switch (stateEnum) {
case DONE -> DocumentVerificationStatus.ACCEPTED;
case DONE, ARCHIVED -> DocumentVerificationStatus.ACCEPTED;
case ERROR -> DocumentVerificationStatus.FAILED;
case NOTDONE, OPERATOR -> DocumentVerificationStatus.IN_PROGRESS;
case REJECTED -> DocumentVerificationStatus.REJECTED;
Expand Down
Loading

0 comments on commit 17733f7

Please sign in to comment.