Skip to content

Commit

Permalink
Fix #1528: Add STATUS_REASON to operations for Cancel of the operation (
Browse files Browse the repository at this point in the history
#1531)

* Fix #1528: Add STATUS_REASON to operations for Cancel of the operation
  • Loading branch information
banterCZ authored May 31, 2024
1 parent 3cdaea7 commit 1ddcdfc
Show file tree
Hide file tree
Showing 14 changed files with 268 additions and 171 deletions.
17 changes: 17 additions & 0 deletions docs-private/Developer-How-To-Start.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,28 @@ liquibase --changelog-file=./docs/db/changelog/changesets/powerauth-java-server/

To generate SQL script run this command.


#### Oracle

```shell
liquibase --changeLogFile=./docs/db/changelog/changesets/powerauth-java-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/powerauth-java-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/powerauth-java-server/db.changelog-module.xml --output-file=./docs/sql/postgresql/generated-postgresql-script.sql updateSQL --url=offline:postgres
```


## PowerAuth Admin Server


Expand Down
38 changes: 20 additions & 18 deletions docs/Database-Structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@ CREATE TABLE pa_operation (
parameters TEXT,
additional_data TEXT,
status INTEGER NOT NULL,
status_reason VARCHAR(32),
signature_type VARCHAR(255) NOT NULL,
failure_count BIGINT DEFAULT 0 NOT NULL,
max_failure_count BIGINT NOT NULL,
Expand All @@ -532,24 +533,25 @@ CREATE TABLE pa_operation (

#### Columns

| Name | Type | Info | Note |
|---------------------|--------------|-------------|-------------------------------------------------------------------------------------------------|
| id | varchar(37) | primary key | Unique operation ID. |
| user_id | varchar(255) | - | Related user ID. |
| template_id | bigint | - | Template ID used for creating the operation. |
| external_id | varchar(255) | - | Identifier in external system. |
| operation_type | varchar(255) | - | Name of the type of operation. |
| data | text | - | Data of the operation that enter the final signature. |
| parameters | text | - | JSON-encoded parameters that were used while creating the operation. |
| status | integer | - | Status of the operation. |
| signature_type | varchar(255) | - | Comma-separated list of allowed signature types. |
| failure_count | bigint | - | Number of already failed attempts to approve the operation. |
| max_failure_count | bigint | - | Maximum allowed number of failed attempts when approving the operation. |
| timestamp_created | timestamp | - | Timestamp of when the operation was created. |
| timestamp_expires | timestamp | - | Timestamp of when the operation will expire. |
| timestamp_finalized | timestamp | - | Timestamp of when the operation reached the terminal state (approved, rejected, expired, etc.). |
| risk_flages | varchar(255) | - | Risk flags for offline QR code. Uppercase letters without separator, e.g. `XFC`. |
| totp_seed | varchar(24) | - | Optional TOTP seed used for proximity check, base64 encoded. |
| Name | Type | Info | Note |
|---------------------|--------------|-------------|----------------------------------------------------------------------------------------------------------------------------------|
| id | varchar(37) | primary key | Unique operation ID. |
| user_id | varchar(255) | - | Related user ID. |
| template_id | bigint | - | Template ID used for creating the operation. |
| external_id | varchar(255) | - | Identifier in external system. |
| operation_type | varchar(255) | - | Name of the type of operation. |
| data | text | - | Data of the operation that enter the final signature. |
| parameters | text | - | JSON-encoded parameters that were used while creating the operation. |
| status | integer | - | Status of the operation. |
| status_reason | varchar(32) | - | Optional details why the status changed. The value should be sent in the form of a computer-readable code, not a free-form text. |
| signature_type | varchar(255) | - | Comma-separated list of allowed signature types. |
| failure_count | bigint | - | Number of already failed attempts to approve the operation. |
| max_failure_count | bigint | - | Maximum allowed number of failed attempts when approving the operation. |
| timestamp_created | timestamp | - | Timestamp of when the operation was created. |
| timestamp_expires | timestamp | - | Timestamp of when the operation will expire. |
| timestamp_finalized | timestamp | - | Timestamp of when the operation reached the terminal state (approved, rejected, expired, etc.). |
| risk_flages | varchar(255) | - | Risk flags for offline QR code. Uppercase letters without separator, e.g. `XFC`. |
| totp_seed | varchar(24) | - | Optional TOTP seed used for proximity check, base64 encoded. |
<!-- end -->

<!-- begin database table pa_operation_template -->
Expand Down
7 changes: 7 additions & 0 deletions docs/PowerAuth-Server-1.8.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,10 @@ transport hints to a FIDO2 Authenticator registered in the table. These transpor
credential list or exclude credential list during WebAuthn ceremonies, serving as a fallback if the client fails to
provide transport hints when registering a new credential. The format of the column is a list of authenticator transport
values supported by the WebAuthn protocol, serialized as a JSON array.


### Add status_reason Column

A new column `status_reason` has been added to the `pa_operation` table.
It provides optional details why the status changed.
The value should be sent in the form of a computer-readable code, not a free-form text.
Loading

0 comments on commit 1ddcdfc

Please sign in to comment.