From 32b5ad4a1b81a017168ae79cd6a481b006cf6edb Mon Sep 17 00:00:00 2001 From: dhanendra06 <60607841+dhanendra06@users.noreply.github.com> Date: Wed, 4 Sep 2024 15:38:32 +0530 Subject: [PATCH 1/3] resolved the merge conflict Signed-off-by: dhanendra06 --- pom.xml | 17 +++++++++++------ .../io/mosip/print/PrintPDFApplication.java | 5 ----- .../print/service/impl/PrintServiceImpl.java | 13 ++++--------- 3 files changed, 15 insertions(+), 20 deletions(-) diff --git a/pom.xml b/pom.xml index 67329f73..d2a456b0 100644 --- a/pom.xml +++ b/pom.xml @@ -49,13 +49,13 @@ 1.4.2 2.8.4 1.3.0-SNAPSHOT - 7.2.4 + 7.1.0 2.0.0 - 5.5.13 + 5.5.13.3 3.6.1 2.6 1.11 - 1.78 + 1.66 3.8.1 3.4.1 @@ -155,7 +155,12 @@ org.bouncycastle - bcprov-jdk15to18 + bcprov-jdk15on + ${bouncycastle.version} + + + org.bouncycastle + bcpkix-jdk15on ${bouncycastle.version} @@ -248,10 +253,10 @@ slf4j-api 2.0.13 - diff --git a/src/main/java/io/mosip/print/PrintPDFApplication.java b/src/main/java/io/mosip/print/PrintPDFApplication.java index 778ba87e..3517949b 100644 --- a/src/main/java/io/mosip/print/PrintPDFApplication.java +++ b/src/main/java/io/mosip/print/PrintPDFApplication.java @@ -32,11 +32,6 @@ public CbeffUtil getCbeffUtil() { return new CbeffImpl(); } - @Bean - public CredentialsVerifier credentialsVerifier() { - return new CredentialsVerifier(); - } - @Bean public ThreadPoolTaskScheduler taskScheduler() { ThreadPoolTaskScheduler threadPoolTaskScheduler = new ThreadPoolTaskScheduler(); diff --git a/src/main/java/io/mosip/print/service/impl/PrintServiceImpl.java b/src/main/java/io/mosip/print/service/impl/PrintServiceImpl.java index c141c848..b480f03d 100644 --- a/src/main/java/io/mosip/print/service/impl/PrintServiceImpl.java +++ b/src/main/java/io/mosip/print/service/impl/PrintServiceImpl.java @@ -32,10 +32,9 @@ import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import io.mosip.print.exception.*; import io.mosip.vercred.CredentialsVerifier; import io.mosip.vercred.exception.ProofDocumentNotFoundException; -import io.mosip.vercred.exception.ProofTypeNotFoundException; +import io.mosip.vercred.exception.ProofTypeNotSupportedException; import io.mosip.vercred.exception.PubicKeyNotFoundException; import io.mosip.vercred.exception.UnknownException; import org.apache.commons.codec.binary.Base64; @@ -49,7 +48,6 @@ import org.springframework.beans.factory.annotation.Value; import org.springframework.core.env.Environment; import org.springframework.stereotype.Service; -import org.springframework.util.StringUtils; import io.mosip.print.constant.CredentialStatusConstant; import io.mosip.print.constant.EventId; @@ -177,8 +175,7 @@ public class PrintServiceImpl implements PrintService { @Autowired private Environment env; - @Autowired - private CredentialsVerifier credentialsVerifier; + private CredentialsVerifier credentialsVerifier= new CredentialsVerifier(); @Value("${mosip.datashare.partner.id}") private String partnerId; @@ -241,13 +238,13 @@ private boolean hasPrintCredentialVerified(EventModel eventModel, String decoded if (verifyCredentialsFlag) { printLogger.info("Configured received credentials to be verified. Flag {}", verifyCredentialsFlag); try { - boolean verified = credentialsVerifier.verifyPrintCredentials(decodedCredential); + boolean verified = credentialsVerifier.verifyCredentials(decodedCredential); if (!verified) { printLogger.error("Received Credentials failed in verifiable credential verify method. So, the credentials will not be printed." + " Id: {}, Transaction Id: {}", eventModel.getEvent().getId(), eventModel.getEvent().getTransactionId()); return false; } - } catch (ProofDocumentNotFoundException | ProofTypeNotFoundException e) { + } catch (ProofDocumentNotFoundException | ProofTypeNotSupportedException e) { printLogger.error("Proof document is not available in the received credentials." + " Id: {}, Transaction Id: {}", eventModel.getEvent().getId(), eventModel.getEvent().getTransactionId()); return false; @@ -394,8 +391,6 @@ private Map getDocuments(String credential, String credentialTyp description.setMessage(PlatformErrorMessages.PRT_PRT_PDF_GENERATION_FAILED.getMessage()); description.setCode(PlatformErrorMessages.PRT_PRT_PDF_GENERATION_FAILED.getCode()); printLogger.error(ex.getMessage() ,ex); - throw new PDFGeneratorException(PDFGeneratorExceptionCodeConstant.PDF_EXCEPTION.getErrorCode(), - ex.getMessage() ,ex); } finally { String eventId = ""; From b092bb4106ac50d3af7188035443010c81a28f6a Mon Sep 17 00:00:00 2001 From: dhanendra06 Date: Fri, 13 Sep 2024 12:39:05 +0530 Subject: [PATCH 2/3] resolved the merge conflict Signed-off-by: dhanendra06 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index d2a456b0..7f0849ff 100644 --- a/pom.xml +++ b/pom.xml @@ -245,7 +245,7 @@ io.mosip.vercred vcverifier - 1.0-SNAPSHOT + 1.1.0-SNAPSHOT From d31d2fc7c25c328e088c41f0d28164560b96e13c Mon Sep 17 00:00:00 2001 From: dhanendra06 Date: Fri, 13 Sep 2024 12:52:06 +0530 Subject: [PATCH 3/3] resolved the merge conflict Signed-off-by: dhanendra06 --- .../java/io/mosip/print/service/impl/PrintServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/java/io/mosip/print/service/impl/PrintServiceImpl.java b/src/main/java/io/mosip/print/service/impl/PrintServiceImpl.java index b480f03d..76c35c72 100644 --- a/src/main/java/io/mosip/print/service/impl/PrintServiceImpl.java +++ b/src/main/java/io/mosip/print/service/impl/PrintServiceImpl.java @@ -35,7 +35,7 @@ import io.mosip.vercred.CredentialsVerifier; import io.mosip.vercred.exception.ProofDocumentNotFoundException; import io.mosip.vercred.exception.ProofTypeNotSupportedException; -import io.mosip.vercred.exception.PubicKeyNotFoundException; +import io.mosip.vercred.exception.PublicKeyNotFoundException; import io.mosip.vercred.exception.UnknownException; import org.apache.commons.codec.binary.Base64; import org.joda.time.DateTime; @@ -248,7 +248,7 @@ private boolean hasPrintCredentialVerified(EventModel eventModel, String decoded printLogger.error("Proof document is not available in the received credentials." + " Id: {}, Transaction Id: {}", eventModel.getEvent().getId(), eventModel.getEvent().getTransactionId()); return false; - } catch (UnknownException | PubicKeyNotFoundException e) { + } catch (UnknownException | PublicKeyNotFoundException e) { printLogger.error("Received Credentials failed in verifiable credential verify method. So, the credentials will not be printed." + " Id: {}, Transaction Id: {}", eventModel.getEvent().getId(), eventModel.getEvent().getTransactionId()); return false;