Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1141: Use operation claim endpoint instead of operation detail #1142

Merged
merged 2 commits into from
Nov 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 4 additions & 0 deletions docs/PowerAuth-Enrollment-Server-1.10.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,7 @@ The allowed values of the `environment` parameter are:
- `production` - production APNs host is used for sending push messages

For platforms other than APNs the parameter is not used, `null` value is allowed.

## Internal Changes

Operation claim now uses the new `POST /rest/v3/operation/claim` for claiming operations instead of `POST /rest/v3/operation/detail` to separate operation claim action from obtaining operation detail.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
import com.wultra.security.powerauth.client.model.enumeration.SignatureType;
import com.wultra.security.powerauth.client.model.enumeration.UserActionResult;
import com.wultra.security.powerauth.client.model.error.PowerAuthClientException;
import com.wultra.security.powerauth.client.model.request.OperationClaimRequest;
import com.wultra.security.powerauth.client.model.request.OperationDetailRequest;
import com.wultra.security.powerauth.client.model.request.OperationFailApprovalRequest;
import com.wultra.security.powerauth.client.model.request.OperationListForUserRequest;
Expand Down Expand Up @@ -334,11 +335,11 @@ private OperationDetailResponse fetchOperationDetailInternal(@NotNull String ope
* @throws MobileTokenException When the operation is in incorrect state.
*/
private OperationDetailResponse claimOperationInternal(@NotNull String operationId, @NotNull String userId) throws PowerAuthClientException, MobileTokenException {
final OperationDetailRequest operationDetailRequest = new OperationDetailRequest();
operationDetailRequest.setOperationId(operationId);
operationDetailRequest.setUserId(userId);
final OperationDetailResponse operationDetail = powerAuthClient.operationDetail(
operationDetailRequest,
final OperationClaimRequest operationClaimRequest = new OperationClaimRequest();
operationClaimRequest.setOperationId(operationId);
operationClaimRequest.setUserId(userId);
final OperationDetailResponse operationDetail = powerAuthClient.operationClaim(
operationClaimRequest,
httpCustomizationService.getQueryParams(),
httpCustomizationService.getHttpHeaders()
);
Expand Down