Skip to content

Commit

Permalink
Merge pull request #388 from /issues/387-missing-parameters
Browse files Browse the repository at this point in the history
Fix #387: Missing parameters in consent approval request
  • Loading branch information
romanstrobl authored Sep 23, 2022
2 parents 2f07e4e + a5ad729 commit 18777cc
Show file tree
Hide file tree
Showing 8 changed files with 12 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.UUID;

/**
* Request class used when asking for consent for onboarding.
*
Expand All @@ -31,7 +29,7 @@
public class OnboardingConsentApprovalRequest {

@Schema(required = true)
private UUID processId;
private String processId;

@Schema(required = true, example = "GDPR")
private String consentType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.util.UUID;

/**
* Request class used when asking for consent for onboarding.
*
Expand All @@ -31,7 +29,7 @@
public class OnboardingConsentTextRequest {

@Schema(required = true)
private UUID processId;
private String processId;

@Schema(required = true, example = "GDPR")
private String consentType;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ public ObjectResponse<OnboardingConsentTextResponse> fetchConsentText(
logger.debug("Returning consent for {}", requestObject);
OnboardingConsentTextRequestValidator.validate(requestObject);

final String processId = requestObject.getProcessId().toString();
final String processId = requestObject.getProcessId();
final OnboardingProcessEntity process = onboardingService.findProcess(processId);
final String userId = process.getUserId();

Expand Down Expand Up @@ -557,7 +557,7 @@ public Response approveConsent(
OnboardingConsentApprovalRequestValidator.validate(requestObject);

final OwnerId ownerId = PowerAuthUtil.getOwnerId(apiAuthentication);
final String processId = requestObject.getProcessId().toString();
final String processId = requestObject.getProcessId();
onboardingService.verifyProcessId(ownerId, processId);

onboardingService.approveConsent(requestObject, ownerId.getUserId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ public void processClientEvaluation(final IdentityVerificationEntity identityVer
logger.debug("Evaluating client for {}", identityVerification);

final EvaluateClientRequest request = EvaluateClientRequest.builder()
.processId(UUID.fromString(identityVerification.getProcessId()))
.processId(identityVerification.getProcessId())
.userId(identityVerification.getUserId())
.identityVerificationId(identityVerification.getId())
.verificationId(getVerificationId(identityVerification))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
import lombok.NonNull;
import lombok.ToString;

import java.util.UUID;

/**
* Request object for {@link OnboardingProvider#approveConsent(ApproveConsentRequest)}.
*
Expand All @@ -39,7 +37,7 @@
public final class ApproveConsentRequest {

@NonNull
private UUID processId;
private String processId;

@NonNull
private String userId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import lombok.ToString;

import java.util.Locale;
import java.util.UUID;

/**
* Request object for {@link OnboardingProvider#fetchConsent(ConsentTextRequest)}.
Expand All @@ -40,7 +39,7 @@
public final class ConsentTextRequest {

@NonNull
private UUID processId;
private String processId;

@NonNull
private String userId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,6 @@
import lombok.NonNull;
import lombok.ToString;

import java.util.UUID;

/**
* Request object for {@link OnboardingProvider#evaluateClient(EvaluateClientRequest)}.
*
Expand All @@ -39,7 +37,7 @@
public final class EvaluateClientRequest {

@NonNull
private UUID processId;
private String processId;

@NonNull
private String userId;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ private static OtpSendRequestDto.OtpTypeEnum convert(SendOtpCodeRequest.OtpType

private static ConsentTextRequestDto convert(final ConsentTextRequest source) {
final ConsentTextRequestDto target = new ConsentTextRequestDto();
target.setProcessId(source.getProcessId().toString());
target.setProcessId(source.getProcessId());
target.setUserId(source.getUserId());
target.setLanguage(source.getLocale().getLanguage());
target.setConsentType(source.getConsentType());
Expand All @@ -214,16 +214,16 @@ private static ConsentTextRequestDto convert(final ConsentTextRequest source) {

private static ConsentStorageRequestDto convert(final ApproveConsentRequest source) {
final ConsentStorageRequestDto target = new ConsentStorageRequestDto();
target.setProcessId(target.getProcessId());
target.setUserId(target.getUserId());
target.setProcessId(source.getProcessId());
target.setUserId(source.getUserId());
target.setConsentType(source.getConsentType());
target.setApproved(source.isApproved());
return target;
}

private static ClientEvaluateRequestDto convert(final EvaluateClientRequest source) {
final ClientEvaluateRequestDto target = new ClientEvaluateRequestDto();
target.setProcessId(source.getProcessId().toString());
target.setProcessId(source.getProcessId());
target.setIdentityVerificationId(source.getIdentityVerificationId());
target.setUserId(source.getUserId());
target.setVerificationId(source.getVerificationId());
Expand Down

0 comments on commit 18777cc

Please sign in to comment.