Skip to content

Commit

Permalink
[ES-2156] Four bugs are reported in the mosip-identity plugin (#80)
Browse files Browse the repository at this point in the history
* sonar fixes

Signed-off-by: Md-Humair-KK <mdhumair.kankudti@gmail.com>

* sonar review fixes

Signed-off-by: Md-Humair-KK <mdhumair.kankudti@gmail.com>

* sonar review fixes

Signed-off-by: Md-Humair-KK <mdhumair.kankudti@gmail.com>

---------

Signed-off-by: Md-Humair-KK <mdhumair.kankudti@gmail.com>
  • Loading branch information
Md-Humair-KK authored Jan 21, 2025
1 parent 9e8a98f commit 3db4132
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,9 @@ public KycAuthResult doKycAuth(String relyingPartyId, String clientId, KycAuthDt

if(responseEntity.getStatusCode().is2xxSuccessful() && responseEntity.getBody() != null) {
IdaResponseWrapper<IdaKycAuthResponse> responseWrapper = responseEntity.getBody();
if(responseWrapper.getResponse() != null && responseWrapper.getResponse().isKycStatus() && responseWrapper.getResponse().getKycToken() != null) {
return new KycAuthResult(responseEntity.getBody().getResponse().getKycToken(),
responseEntity.getBody().getResponse().getAuthToken());
if(responseWrapper!=null && responseWrapper.getResponse() != null && responseWrapper.getResponse().isKycStatus() && responseWrapper.getResponse().getKycToken() != null) {
return new KycAuthResult(responseWrapper.getResponse().getKycToken(),
responseWrapper.getResponse().getAuthToken());
}
log.error("Error response received from IDA KycStatus : {} && Errors: {}",
responseWrapper.getResponse().isKycStatus(), responseWrapper.getErrors());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -247,11 +247,13 @@ public ProfileDto getProfile(String individualId) throws ProfileException {
new ParameterizedTypeReference<ResponseWrapper<IdentityResponse>>() {});
break;
}

if(responseWrapper==null || responseWrapper.getResponse() == null || responseWrapper.getResponse().getIdentity() == null){
throw new ProfileException(REQUEST_FAILED);
}
ProfileDto profileDto = new ProfileDto();
profileDto.setIndividualId(responseWrapper.getResponse().getIdentity().get(UIN).textValue());
profileDto.setIdentity(responseWrapper.getResponse().getIdentity());
profileDto.setActive(responseWrapper.getResponse().getStatus().equals("ACTIVATED"));
profileDto.setActive("ACTIVATED".equals(responseWrapper.getResponse().getStatus()));
return profileDto;
} catch (ProfileException e) {
if (e.getErrorCode().equals("IDR-IDC-007")) {
Expand Down

0 comments on commit 3db4132

Please sign in to comment.