From bbcf724b0387f8378cb1e428721384a364b5a465 Mon Sep 17 00:00:00 2001 From: Jan Dusil <134381434+jandusil@users.noreply.github.com> Date: Thu, 21 Dec 2023 16:51:11 +0100 Subject: [PATCH] Fix #1225: Add activationId to OperationDetailResponse (#1229) * Fix #1225: Add activationId to OperationDetailResponse - Update docs --- docs/WebServices-Methods.md | 178 +++++++++--------- .../response/OperationDetailResponse.java | 1 + .../tasks/OperationServiceBehavior.java | 1 + 3 files changed, 93 insertions(+), 87 deletions(-) diff --git a/docs/WebServices-Methods.md b/docs/WebServices-Methods.md index f6ab55730..7a93e69a5 100644 --- a/docs/WebServices-Methods.md +++ b/docs/WebServices-Methods.md @@ -2031,23 +2031,24 @@ REST endpoint: `POST /rest/v3/operation/create` `OperationDetailResponse` -| Type | Name | Description | -|-----------------------|------|-------------| -| `String` | `id` | The operation ID | -| `String` | `userId` | The identifier of the user | -| `String` | `applicationId` | The identifier of the application | -| `String` | `externalId` | External identifier of the operation, i.e., ID from transaction system | -| `String` | `operationType` | Type of the operation created based on the template | -| `String` | `data` | Operation data | -| `Map` | `parameters` | Parameters of the operation, will be filled to the operation data | -| `OperationStatus` | `status` | Status of the operation | -| `List` | `signatureType` | Allowed types of signature | -| `Long` | `failureCount` | The current number of the failed approval attempts | -| `Long` | `maxFailureCount` | The maximum allowed number of the failed approval attempts | -| `Date` | `timestampCreated` | Timestamp of when the operation was created | -| `Date` | `timestampExpires` | Timestamp of when the operation will expires / expired | -| `Date` | `timestampFinalized` | Timestamp of when the operation was switched to a terminating status | -| `String` | `riskFlags` | Risk flags for offline QR code. Uppercase letters without separator, e.g. `XFC`. | +| Type | Name | Description | +|-----------------------|----------------------|----------------------------------------------------------------------------------| +| `String` | `id` | The operation ID | +| `String` | `userId` | The identifier of the user | +| `String` | `applicationId` | The identifier of the application | +| `String` | `externalId` | External identifier of the operation, i.e., ID from transaction system | +| `String` | `operationType` | Type of the operation created based on the template | +| `String` | `data` | Operation data | +| `Map` | `parameters` | Parameters of the operation, will be filled to the operation data | +| `OperationStatus` | `status` | Status of the operation | +| `List` | `signatureType` | Allowed types of signature | +| `Long` | `failureCount` | The current number of the failed approval attempts | +| `Long` | `maxFailureCount` | The maximum allowed number of the failed approval attempts | +| `Date` | `timestampCreated` | Timestamp of when the operation was created | +| `Date` | `timestampExpires` | Timestamp of when the operation will expires / expired | +| `Date` | `timestampFinalized` | Timestamp of when the operation was switched to a terminating status | +| `String` | `riskFlags` | Risk flags for offline QR code. Uppercase letters without separator, e.g. `XFC`. | +| `String` | `activationId` | Activation Id of the activation scoped for the operation | ### Method 'operationDetail' @@ -2086,6 +2087,7 @@ REST endpoint: `POST /rest/v3/operation/detail` | `Date` | `timestampFinalized` | Timestamp of when the operation was switched to a terminating status | | `String` | `riskFlags` | Risk flags for offline QR code. Uppercase letters without separator, e.g. `XFC`. | | `String` | `proximityOtp` | TOTP for proximity check (if enabled) valid for the current time step. | +| `String` | `activationId` | Activation Id of the activation scoped for the operation | ### Method 'findPendingOperationsForUser' @@ -2232,23 +2234,24 @@ REST endpoint: `POST /rest/v3/operation/cancel` `OperationDetailResponse` -| Type | Name | Description | -|-----------------------|------|-------------| -| `String` | `id` | The operation ID | -| `String` | `userId` | The identifier of the user | -| `String` | `applicationId` | The identifier of the application | -| `String` | `externalId` | External identifier of the operation, i.e., ID from transaction system | -| `String` | `operationType` | Type of the operation created based on the template | -| `String` | `data` | Operation data | -| `Map` | `parameters` | Parameters of the operation, will be filled to the operation data | -| `OperationStatus` | `status` | Status of the operation | -| `List` | `signatureType` | Allowed types of signature | -| `Long` | `failureCount` | The current number of the failed approval attempts | -| `Long` | `maxFailureCount` | The maximum allowed number of the failed approval attempts | -| `Date` | `timestampCreated` | Timestamp of when the operation was created | -| `Date` | `timestampExpires` | Timestamp of when the operation will expires / expired | -| `Date` | `timestampFinalized` | Timestamp of when the operation was switched to a terminating status | -| `String` | `riskFlags` | Risk flags for offline QR code. Uppercase letters without separator, e.g. `XFC`. | +| Type | Name | Description | +|-----------------------|----------------------|----------------------------------------------------------------------------------| +| `String` | `id` | The operation ID | +| `String` | `userId` | The identifier of the user | +| `String` | `applicationId` | The identifier of the application | +| `String` | `externalId` | External identifier of the operation, i.e., ID from transaction system | +| `String` | `operationType` | Type of the operation created based on the template | +| `String` | `data` | Operation data | +| `Map` | `parameters` | Parameters of the operation, will be filled to the operation data | +| `OperationStatus` | `status` | Status of the operation | +| `List` | `signatureType` | Allowed types of signature | +| `Long` | `failureCount` | The current number of the failed approval attempts | +| `Long` | `maxFailureCount` | The maximum allowed number of the failed approval attempts | +| `Date` | `timestampCreated` | Timestamp of when the operation was created | +| `Date` | `timestampExpires` | Timestamp of when the operation will expires / expired | +| `Date` | `timestampFinalized` | Timestamp of when the operation was switched to a terminating status | +| `String` | `riskFlags` | Risk flags for offline QR code. Uppercase letters without separator, e.g. `XFC`. | +| `String` | `activationId` | Activation Id of the activation scoped for the operation | ### Method 'approveOperation' @@ -2281,23 +2284,24 @@ REST endpoint: `POST /rest/v3/operation/approve` `OperationDetailResponse` -| Type | Name | Description | -|-----------------------|------|-------------| -| `String` | `id` | The operation ID | -| `String` | `userId` | The identifier of the user | -| `String` | `applicationId` | The identifier of the application | -| `String` | `externalId` | External identifier of the operation, i.e., ID from transaction system | -| `String` | `operationType` | Type of the operation created based on the template | -| `String` | `data` | Operation data | -| `Map` | `parameters` | Parameters of the operation, will be filled to the operation data | -| `OperationStatus` | `status` | Status of the operation | -| `List` | `signatureType` | Allowed types of signature | -| `Long` | `failureCount` | The current number of the failed approval attempts | -| `Long` | `maxFailureCount` | The maximum allowed number of the failed approval attempts | -| `Date` | `timestampCreated` | Timestamp of when the operation was created | -| `Date` | `timestampExpires` | Timestamp of when the operation will expires / expired | -| `Date` | `timestampFinalized` | Timestamp of when the operation was switched to a terminating status | -| `String` | `riskFlags` | Risk flags for offline QR code. Uppercase letters without separator, e.g. `XFC`. | +| Type | Name | Description | +|-----------------------|----------------------|----------------------------------------------------------------------------------| +| `String` | `id` | The operation ID | +| `String` | `userId` | The identifier of the user | +| `String` | `applicationId` | The identifier of the application | +| `String` | `externalId` | External identifier of the operation, i.e., ID from transaction system | +| `String` | `operationType` | Type of the operation created based on the template | +| `String` | `data` | Operation data | +| `Map` | `parameters` | Parameters of the operation, will be filled to the operation data | +| `OperationStatus` | `status` | Status of the operation | +| `List` | `signatureType` | Allowed types of signature | +| `Long` | `failureCount` | The current number of the failed approval attempts | +| `Long` | `maxFailureCount` | The maximum allowed number of the failed approval attempts | +| `Date` | `timestampCreated` | Timestamp of when the operation was created | +| `Date` | `timestampExpires` | Timestamp of when the operation will expires / expired | +| `Date` | `timestampFinalized` | Timestamp of when the operation was switched to a terminating status | +| `String` | `riskFlags` | Risk flags for offline QR code. Uppercase letters without separator, e.g. `XFC`. | +| `String` | `activationId` | Activation Id of the activation scoped for the operation | ### Method 'failApproveOperation' @@ -2325,24 +2329,24 @@ REST endpoint: `POST /rest/v3/operation/approve/fail` `OperationDetailResponse` -| Type | Name | Description | -|-----------------------|------|-------------| -| `String` | `id` | The operation ID | -| `String` | `userId` | The identifier of the user | -| `String` | `applicationId` | The identifier of the application | -| `String` | `externalId` | External identifier of the operation, i.e., ID from transaction system | -| `String` | `operationType` | Type of the operation created based on the template | -| `String` | `data` | Operation data | -| `Map` | `parameters` | Parameters of the operation, will be filled to the operation data | -| `OperationStatus` | `status` | Status of the operation | -| `List` | `signatureType` | Allowed types of signature | -| `Long` | `failureCount` | The current number of the failed approval attempts | -| `Long` | `maxFailureCount` | The maximum allowed number of the failed approval attempts | -| `Date` | `timestampCreated` | Timestamp of when the operation was created | -| `Date` | `timestampExpires` | Timestamp of when the operation will expires / expired | -| `Date` | `timestampFinalized` | Timestamp of when the operation was switched to a terminating status | -| `String` | `riskFlags` | Risk flags for offline QR code. Uppercase letters without separator, e.g. `XFC`. | - +| Type | Name | Description | +|-----------------------|----------------------|----------------------------------------------------------------------------------| +| `String` | `id` | The operation ID | +| `String` | `userId` | The identifier of the user | +| `String` | `applicationId` | The identifier of the application | +| `String` | `externalId` | External identifier of the operation, i.e., ID from transaction system | +| `String` | `operationType` | Type of the operation created based on the template | +| `String` | `data` | Operation data | +| `Map` | `parameters` | Parameters of the operation, will be filled to the operation data | +| `OperationStatus` | `status` | Status of the operation | +| `List` | `signatureType` | Allowed types of signature | +| `Long` | `failureCount` | The current number of the failed approval attempts | +| `Long` | `maxFailureCount` | The maximum allowed number of the failed approval attempts | +| `Date` | `timestampCreated` | Timestamp of when the operation was created | +| `Date` | `timestampExpires` | Timestamp of when the operation will expires / expired | +| `Date` | `timestampFinalized` | Timestamp of when the operation was switched to a terminating status | +| `String` | `riskFlags` | Risk flags for offline QR code. Uppercase letters without separator, e.g. `XFC`. | +| `String` | `activationId` | Activation Id of the activation scoped for the operation | ### Method 'rejectOperation' Reject an operation. @@ -2371,24 +2375,24 @@ REST endpoint: `POST /rest/v3/operation/reject` `OperationDetailResponse` -| Type | Name | Description | -|------|------|-------------| -| `String` | `id` | The operation ID | -| `String` | `userId` | The identifier of the user | -| `String` | `applicationId` | The identifier of the application | -| `String` | `externalId` | External identifier of the operation, i.e., ID from transaction system | -| `String` | `operationType` | Type of the operation created based on the template | -| `String` | `data` | Operation data | -| `Map` | `parameters` | Parameters of the operation, will be filled to the operation data | -| `OperationStatus` | `status` | Status of the operation | -| `List` | `signatureType` | Allowed types of signature | -| `Long` | `failureCount` | The current number of the failed approval attempts | -| `Long` | `maxFailureCount` | The maximum allowed number of the failed approval attempts | -| `Date` | `timestampCreated` | Timestamp of when the operation was created | -| `Date` | `timestampExpires` | Timestamp of when the operation will expires / expired | -| `Date` | `timestampFinalized` | Timestamp of when the operation was switched to a terminating status | -| `String` | `riskFlags` | Risk flags for offline QR code. Uppercase letters without separator, e.g. `XFC`. | - +| Type | Name | Description | +|-----------------------|----------------------|----------------------------------------------------------------------------------| +| `String` | `id` | The operation ID | +| `String` | `userId` | The identifier of the user | +| `String` | `applicationId` | The identifier of the application | +| `String` | `externalId` | External identifier of the operation, i.e., ID from transaction system | +| `String` | `operationType` | Type of the operation created based on the template | +| `String` | `data` | Operation data | +| `Map` | `parameters` | Parameters of the operation, will be filled to the operation data | +| `OperationStatus` | `status` | Status of the operation | +| `List` | `signatureType` | Allowed types of signature | +| `Long` | `failureCount` | The current number of the failed approval attempts | +| `Long` | `maxFailureCount` | The maximum allowed number of the failed approval attempts | +| `Date` | `timestampCreated` | Timestamp of when the operation was created | +| `Date` | `timestampExpires` | Timestamp of when the operation will expires / expired | +| `Date` | `timestampFinalized` | Timestamp of when the operation was switched to a terminating status | +| `String` | `riskFlags` | Risk flags for offline QR code. Uppercase letters without separator, e.g. `XFC`. | +| `String` | `activationId` | Activation Id of the activation scoped for the operation | ## Operation Templates ### Method 'createOperationTemplate' diff --git a/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/response/OperationDetailResponse.java b/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/response/OperationDetailResponse.java index d80cf14d3..da108caed 100644 --- a/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/response/OperationDetailResponse.java +++ b/powerauth-client-model/src/main/java/com/wultra/security/powerauth/client/model/response/OperationDetailResponse.java @@ -59,5 +59,6 @@ public class OperationDetailResponse { */ @ToString.Exclude private String proximityOtp; + private String activationId; } diff --git a/powerauth-java-server/src/main/java/io/getlime/security/powerauth/app/server/service/behavior/tasks/OperationServiceBehavior.java b/powerauth-java-server/src/main/java/io/getlime/security/powerauth/app/server/service/behavior/tasks/OperationServiceBehavior.java index c8a1da8df..14d142dca 100644 --- a/powerauth-java-server/src/main/java/io/getlime/security/powerauth/app/server/service/behavior/tasks/OperationServiceBehavior.java +++ b/powerauth-java-server/src/main/java/io/getlime/security/powerauth/app/server/service/behavior/tasks/OperationServiceBehavior.java @@ -696,6 +696,7 @@ private OperationDetailResponse convertFromEntity(OperationEntity source) { destination.setTimestampExpires(source.getTimestampExpires()); destination.setTimestampFinalized(source.getTimestampFinalized()); destination.setRiskFlags(source.getRiskFlags()); + destination.setActivationId(source.getActivationId()); switch (source.getStatus()) { case PENDING -> destination.setStatus(OperationStatus.PENDING);