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

[ES-869] #1215

Merged
merged 3 commits into from
Mar 12, 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
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,9 @@ private void sendEvents(BaseRequestDTO baserequestdto, String headerSignature, O
eventData.put(REQUESTDATETIME, DateUtils.formatToISOString(DateUtils.getUTCCurrentDateTime()));
eventData.put(INDIVIDUAL_ID,
encryptIndividualId(baserequestdto.getIndividualId(), partnerDataCert.get().getCertificateData()));
eventData.put(AUTH_PARTNER_ID, partner.get().getPartnerId());
eventData.put(AUTH_PARTNER_ID, partner.map(PartnerDTO::getPartnerId).orElse(null));
eventData.put(INDIVIDUAL_ID_TYPE, baserequestdto.getIndividualIdType());
eventData.put(ENTITY_NAME, partner.get().getPartnerName());
eventData.put(ENTITY_NAME, partner.map(PartnerDTO::getPartnerName).orElse(null));
eventData.put(REQUEST_SIGNATURE, headerSignature);
EventModel eventModel = createEventModel(onDemadTemplateExtractionTopic, eventData);
publishEvent(eventModel);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ protected SendOtpResult sendOTP(String partnerId, String clientId, IdaSendOtpReq
ResponseEntity<IdaSendOtpResponse> responseEntity = restTemplate.exchange(requestEntity, IdaSendOtpResponse.class);
if(responseEntity.getStatusCode().is2xxSuccessful() && responseEntity.getBody() != null) {
IdaSendOtpResponse idaSendOtpResponse = responseEntity.getBody();
if(idaSendOtpRequest.getTransactionID().equals(idaSendOtpResponse.getTransactionID()) && idaSendOtpResponse.getResponse() != null){
if (idaSendOtpResponse != null && idaSendOtpRequest.getTransactionID().equals(idaSendOtpResponse.getTransactionID()) &&
idaSendOtpResponse.getResponse() != null) {
return new SendOtpResult(idaSendOtpResponse.getTransactionID(),
idaSendOtpResponse.getResponse().getMaskedEmail(),
idaSendOtpResponse.getResponse().getMaskedMobile());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ private void audit(String username, Action action, ActionStatus status, AuditDTO

if (responseEntity.getStatusCode().is2xxSuccessful() && responseEntity.getBody() != null) {
ResponseWrapper<AuditResponse> responseWrapper = responseEntity.getBody();
if (responseWrapper.getErrors() != null && !responseWrapper.getErrors().isEmpty()) {
if (responseWrapper != null && responseWrapper.getErrors() != null && !responseWrapper.getErrors().isEmpty()) {
log.error("Error response received from audit service with errors: {}",
responseWrapper.getErrors());
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ 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) {
if(responseWrapper != null && responseWrapper.getResponse() != null && responseWrapper.getResponse().isKycStatus() && responseWrapper.getResponse().getKycToken() != null) {
return new KycAuthResult(responseEntity.getBody().getResponse().getKycToken(),
responseEntity.getBody().getResponse().getAuthToken());
}
Expand Down Expand Up @@ -188,7 +188,7 @@ public KycExchangeResult doKycExchange(String relyingPartyId, String clientId, K

if(responseEntity.getStatusCode().is2xxSuccessful() && responseEntity.getBody() != null) {
IdaResponseWrapper<IdaKycExchangeResponse> responseWrapper = responseEntity.getBody();
if(responseWrapper.getResponse() != null && responseWrapper.getResponse().getEncryptedKyc() != null) {
if(responseWrapper != null && responseWrapper.getResponse() != null && responseWrapper.getResponse().getEncryptedKyc() != null) {
return new KycExchangeResult(responseWrapper.getResponse().getEncryptedKyc());
}
log.error("Errors in response received from IDA Kyc Exchange: {}", responseWrapper.getErrors());
Expand Down Expand Up @@ -241,7 +241,7 @@ public List<KycSigningCertificateData> getAllKycSigningCertificates() throws Kyc

if(responseEntity.getStatusCode().is2xxSuccessful() && responseEntity.getBody() != null) {
ResponseWrapper<GetAllCertificatesResponse> responseWrapper = responseEntity.getBody();
if(responseWrapper.getResponse() != null && responseWrapper.getResponse().getAllCertificates() != null) {
if(responseWrapper != null && responseWrapper.getResponse() != null && responseWrapper.getResponse().getAllCertificates() != null) {
return responseWrapper.getResponse().getAllCertificates();
}
log.error("Error response received from getAllSigningCertificates with errors: {}",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ public KeyBindingResult doKeyBinding(String individualId, List<AuthChallenge> ch

if(responseEntity.getStatusCode().is2xxSuccessful() && responseEntity.getBody() != null) {
IdaResponseWrapper<KeyBindingResponse> responseWrapper = responseEntity.getBody();
if(responseWrapper.getResponse() == null) {
if(responseWrapper == null || responseWrapper.getResponse() == null) {
log.error("Error response received from IDA (Key-binding) Errors: {}", responseWrapper.getErrors());
throw new KeyBindingException(CollectionUtils.isEmpty(responseWrapper.getErrors()) ?
ErrorConstants.KEY_BINDING_FAILED : responseWrapper.getErrors().get(0).getErrorCode());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public VCResult<JsonLDObject> getVerifiableCredentialWithLinkedDataProof(VCReque
requestEntity, new ParameterizedTypeReference<IdaResponseWrapper<IdaVcExchangeResponse<JsonLDObject>>>() {});
if (responseEntity.getStatusCode().is2xxSuccessful() && responseEntity.getBody() != null) {
IdaResponseWrapper<IdaVcExchangeResponse<JsonLDObject>> responseWrapper = responseEntity.getBody();
if (responseWrapper.getResponse() != null) {
if (responseWrapper != null || responseWrapper.getResponse() != null) {
VCResult vCResult = new VCResult();
vCResult.setCredential(responseWrapper.getResponse().getVerifiableCredentials());
vCResult.setFormat(vcRequestDto.getFormat());
Expand Down
Loading