Skip to content

Fix #1545: The OnboardingProviderException encapsulate the whole request object#1546

Merged
banterCZ merged 1 commit intodevelopfrom
issues/1545-OnboardingProviderException
Feb 17, 2026
Merged

Fix #1545: The OnboardingProviderException encapsulate the whole request object#1546
banterCZ merged 1 commit intodevelopfrom
issues/1545-OnboardingProviderException

Conversation

@banterCZ
Copy link
Member

No description provided.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request addresses issue #1545 by preventing sensitive data leakage through exception messages. Previously, OnboardingProviderException messages included the entire request object via string concatenation, which could expose sensitive information such as OTP codes, biometric images, and personally identifiable information (PII). The fix extracts only the processId field from request objects to include in exception messages.

Changes:

  • Updated all OnboardingProviderException constructor calls to use formatted strings with only processId instead of concatenating the full request object
  • Correctly handles both Lombok-based classes (using getProcessId()) and Java record classes (using processId())
  • Maintains consistent error message format: "action description, processId=%s" across all exception scenarios

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

response = restClient.post("/user/lookup", requestDto, null, createHeaders(), responseType).getBody();
} catch (RestClientException e) {
throw new OnboardingProviderException("Unable to lookup user for " + request, e);
throw new OnboardingProviderException("Unable to lookup user, processId=%s".formatted(request.getProcessId()), e);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was thinking about creating separate method for creating exception instance, but I am not sure it will bring any benefit. Current approach is good

Copy link
Member

@zcgandcomp zcgandcomp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good from a content point of view. I have small concerns regarding the null safety..

@banterCZ banterCZ merged commit cadc66a into develop Feb 17, 2026
11 checks passed
@banterCZ banterCZ deleted the issues/1545-OnboardingProviderException branch February 17, 2026 10:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants