From 7eb6d6d07fd387575e3d82ed00ffed6fc08856cf Mon Sep 17 00:00:00 2001 From: Keshav Mishra Date: Fri, 3 Mar 2023 18:20:14 +0530 Subject: [PATCH 1/7] [DSD-2180] updating pom for release --- MockMDS/pom.xml | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/MockMDS/pom.xml b/MockMDS/pom.xml index 447d9bdd..5a477454 100644 --- a/MockMDS/pom.xml +++ b/MockMDS/pom.xml @@ -12,7 +12,7 @@ io.mosip.mock.mds mock-mds - 1.2.1-SNAPSHOT + 1.2.0.1-B1-SNAPSHOT mock-mds A mock project for biometric provider @@ -47,7 +47,7 @@ io.mosip.biometric.util biometrics-util - 0.0.1-SNAPSHOT + 1.2.0.1-B1-SNAPSHOT org.springframework.boot @@ -129,8 +129,7 @@ io.mosip.kernel kernel-core - - 1.2.1-SNAPSHOT + 1.2.0.1-B1 From 968282f3de3f5f08b38e4c814d1a5cfface83d17 Mon Sep 17 00:00:00 2001 From: Keshav Mishra Date: Fri, 3 Mar 2023 18:23:24 +0530 Subject: [PATCH 2/7] [DSD-2180] updating pom for release --- mock-abis/pom.xml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mock-abis/pom.xml b/mock-abis/pom.xml index 865973e4..c2629800 100644 --- a/mock-abis/pom.xml +++ b/mock-abis/pom.xml @@ -3,7 +3,7 @@ 4.0.0 io.mosip.mock.abis mock-abis - 1.2.1-SNAPSHOT + 1.2.0.1.B1-SNAPSHOT jar MockAbis @@ -85,8 +85,8 @@ 2.9.2 - 1.2.1-SNAPSHOT - 1.2.1-SNAPSHOT + 1.2.0.1-B1 + 1.2.0.1-B1 42.2.16 From 77aad01427f9c8d459829c64a4e9551301480918 Mon Sep 17 00:00:00 2001 From: Keshav Mishra Date: Fri, 3 Mar 2023 18:24:40 +0530 Subject: [PATCH 3/7] Update pom.xml --- mock-mv/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mock-mv/pom.xml b/mock-mv/pom.xml index 44d61308..65d458d0 100644 --- a/mock-mv/pom.xml +++ b/mock-mv/pom.xml @@ -5,7 +5,7 @@ 4.0.0 io.mosip.mock.mv mock-mv - 1.2.1-SNAPSHOT + 1.2.0.1-B1-SNAPSHOT jar mock-mv From f4b8c5acff9ee409389e4caa673e22ccf7423197 Mon Sep 17 00:00:00 2001 From: Keshav Mishra Date: Fri, 3 Mar 2023 18:27:00 +0530 Subject: [PATCH 4/7] Update pom.xml --- mock-sdk-jpeg-extractor/pom.xml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mock-sdk-jpeg-extractor/pom.xml b/mock-sdk-jpeg-extractor/pom.xml index c89f4aad..bc2627ed 100644 --- a/mock-sdk-jpeg-extractor/pom.xml +++ b/mock-sdk-jpeg-extractor/pom.xml @@ -5,7 +5,7 @@ mock-sdk-jpeg-extractor io.mosip.mock.sdk - 1.2.1-SNAPSHOT + 1.2.0.1-B1-SNAPSHOT mock-sdk-jpeg-extractor Sample implementation of biometrics SDK-containing jpeg extraction jar @@ -75,14 +75,14 @@ 3.3.0 2.3 - 1.2.1-SNAPSHOT - 1.2.1-SNAPSHOT - 1.2.1-SNAPSHOT + 1.2.0.1-B1 + 1.2.0.1-B1-SNAPSHOT + 1.2.0.1-B1-SNAPSHOT 3.0.2 2.0.2.RELEASE - 1.18.8 + 1.18.8 0.8.5 - 1.7.25 + 1.7.25 From d702c0a14ded050a699be0b97872f1947523b90f Mon Sep 17 00:00:00 2001 From: Keshav Mishra Date: Sun, 16 Apr 2023 12:04:50 +0530 Subject: [PATCH 5/7] [DSD-2478] groupId change for bioconverter (#252) --- mock-sdk/pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mock-sdk/pom.xml b/mock-sdk/pom.xml index d48b6521..2a26c18d 100644 --- a/mock-sdk/pom.xml +++ b/mock-sdk/pom.xml @@ -117,7 +117,7 @@ provided - io.mosip + io.mosip.kernel kernel-bio-converter ${kernel.bioconverter.version} lib From c68b31b34040fba3281eca38bbdb6d25b83b9d33 Mon Sep 17 00:00:00 2001 From: JanardhanBS-SyncByte Date: Tue, 21 Nov 2023 15:32:05 +0530 Subject: [PATCH 6/7] MOSIP-29978, MOSIP-30342, ES-480 --- .../sbi/devicehelper/SBIDeviceHelper.java | 2 +- .../mock/sbi/service/SBIServiceResponse.java | 48 +++++++++++-------- .../org/biometric/provider/JwtUtility.java | 3 +- .../mosip/mock/sdk/service/MatchService.java | 34 ++++--------- 4 files changed, 39 insertions(+), 48 deletions(-) diff --git a/MockMDS/src/main/java/io/mosip/mock/sbi/devicehelper/SBIDeviceHelper.java b/MockMDS/src/main/java/io/mosip/mock/sbi/devicehelper/SBIDeviceHelper.java index afd4f590..297a9d21 100644 --- a/MockMDS/src/main/java/io/mosip/mock/sbi/devicehelper/SBIDeviceHelper.java +++ b/MockMDS/src/main/java/io/mosip/mock/sbi/devicehelper/SBIDeviceHelper.java @@ -269,7 +269,7 @@ protected DeviceInfo getDeviceInfo(String deviceType, String deviceSubType, Digi deviceInfo = objectMapper.readValue(new File(fileName), DeviceInfo.class); if (deviceInfo != null) { - deviceInfo.setDigitalId(getUnsignedDigitalId (digitalId, false)); + deviceInfo.setDigitalId(getUnsignedDigitalId (digitalId, true)); deviceInfo.setDeviceStatus(getDeviceStatus()); deviceInfo.setPurpose(getPurpose ()); deviceInfo.setCallbackId("http://" + ApplicationPropertyHelper.getPropertyKeyValue(SBIConstant.SERVER_ADDRESS) + ":" + getPort() + "/"); diff --git a/MockMDS/src/main/java/io/mosip/mock/sbi/service/SBIServiceResponse.java b/MockMDS/src/main/java/io/mosip/mock/sbi/service/SBIServiceResponse.java index 3fc29342..acb6508c 100644 --- a/MockMDS/src/main/java/io/mosip/mock/sbi/service/SBIServiceResponse.java +++ b/MockMDS/src/main/java/io/mosip/mock/sbi/service/SBIServiceResponse.java @@ -57,6 +57,7 @@ import io.mosip.mock.sbi.devicehelper.iris.monocular.SBIIrisSingleBioExceptionInfo; import io.mosip.mock.sbi.devicehelper.iris.monocular.SBIIrisSingleCaptureInfo; import io.mosip.mock.sbi.devicehelper.iris.monocular.SBIIrisSingleHelper; +import io.mosip.mock.sbi.exception.SBIException; import io.mosip.mock.sbi.util.ApplicationPropertyHelper; import io.mosip.mock.sbi.util.StringHelper; import io.mosip.registration.mdm.dto.BioMetricsDataDto; @@ -1318,24 +1319,32 @@ else if (captureTimeOut) } else { - List biometrics = getBioMetricsDtoList (lang, requestObject, deviceHelper, deviceSubId, true); - if (biometrics != null && biometrics.size() > 0) + List biometrics = null; + try { - RCaptureResponse captureResponse = new RCaptureResponse (); - captureResponse.setBiometrics(biometrics); - - ObjectMapper mapper = new ObjectMapper (); - SerializationConfig config = mapper.getSerializationConfig(); - config.setSerializationInclusion(Inclusion.NON_NULL); - mapper.setSerializationConfig(config); - - response = mapper.writeValueAsString(captureResponse); - } - else + biometrics = getBioMetricsDtoList (lang, requestObject, deviceHelper, deviceSubId, true); + if (biometrics != null && biometrics.size() > 0) + { + RCaptureResponse captureResponse = new RCaptureResponse (); + captureResponse.setBiometrics(biometrics); + + ObjectMapper mapper = new ObjectMapper (); + SerializationConfig config = mapper.getSerializationConfig(); + config.setSerializationInclusion(Inclusion.NON_NULL); + mapper.setSerializationConfig(config); + + response = mapper.writeValueAsString(captureResponse); + } + else + { + response = SBIJsonInfo.getCaptureErrorJson (specVersion, lang, "708", "", false); + } + } + catch (Exception ex) { - response = SBIJsonInfo.getCaptureErrorJson (specVersion, lang, "708", "", false); + response = SBIJsonInfo.getCaptureErrorJson (specVersion, lang, "999", ex.getLocalizedMessage(), false); } - + deviceHelper.deInitDevice(); deviceHelper.setDeviceStatus(SBIConstant.DEVICE_STATUS_ISREADY); } @@ -1377,7 +1386,7 @@ else if (captureTimeOut) return response; } - private List getBioMetricsDtoList (String lang, CaptureRequestDto requestObject, SBIDeviceHelper deviceHelper, int deviceSubId, boolean isForAuthenication) throws JsonGenerationException, JsonMappingException, IOException, NoSuchAlgorithmException, DecoderException + private List getBioMetricsDtoList (String lang, CaptureRequestDto requestObject, SBIDeviceHelper deviceHelper, int deviceSubId, boolean isForAuthenication) throws JsonGenerationException, JsonMappingException, IOException, NoSuchAlgorithmException, DecoderException, SBIException { List biometrics = new ArrayList (); String specVersion = requestObject.getSpecVersion(); @@ -2196,7 +2205,7 @@ else if (deviceHelper.getDigitalId().getType().equalsIgnoreCase(SBIConstant.MOSI private BioMetricsDto getBiometricData (String transactionId, CaptureRequestDto requestObject, SBIDeviceHelper deviceHelper, String previousHash, String bioType, String bioSubType, String bioValue, - int qualityScore, int qualityRequestScore, String lang, String errorCode, boolean isUsedForAuthenication) throws JsonGenerationException, JsonMappingException, IOException, NoSuchAlgorithmException, DecoderException + int qualityScore, int qualityRequestScore, String lang, String errorCode, boolean isUsedForAuthenication) throws SBIException, JsonGenerationException, JsonMappingException, IOException, DecoderException, NoSuchAlgorithmException { DeviceInfo deviceInfo = deviceHelper.getDeviceInfo(); @@ -2236,12 +2245,11 @@ private BioMetricsDto getBiometricData (String transactionId, CaptureRequestDto cryptoResult.get("ENC_DATA") : null); biometric.setSessionKey(cryptoResult.get("ENC_SESSION_KEY")); String thumbPrint = toHex (JwtUtility.getCertificateThumbprint(certificate)).replace ("-", "").toUpperCase(); - //System.out.println("ThumbPrint>>" + thumbPrint); biometric.setThumbprint(thumbPrint); } catch (Exception ex) { - LOGGER.error("getBiometricData :: encrypt :: ", ex); - // TODO Auto-generated catch block ex.printStackTrace(); + LOGGER.error("getBiometricData :: encrypt :: ", ex); + throw new SBIException("IDA Biometric encryption Certificate not found", "IDA Biometric encryption Certificate not found", ex); } } diff --git a/MockMDS/src/main/java/org/biometric/provider/JwtUtility.java b/MockMDS/src/main/java/org/biometric/provider/JwtUtility.java index a0c59060..db8ad7ad 100644 --- a/MockMDS/src/main/java/org/biometric/provider/JwtUtility.java +++ b/MockMDS/src/main/java/org/biometric/provider/JwtUtility.java @@ -165,7 +165,7 @@ public static byte[] getCertificateThumbprint(Certificate cert) throws Certifica return DigestUtils.sha256(cert.getEncoded()); } - public String getCertificateFromIDA() { + public String getCertificateFromIDA() throws Exception { OkHttpClient client = new OkHttpClient(); String requestBody = String.format(AUTH_REQ_TEMPLATE, getPropertyValue("mosip.auth.appid"), @@ -199,6 +199,7 @@ public String getCertificateFromIDA() { } catch (IOException | JSONException e) { e.printStackTrace(); + throw e; } return null; } diff --git a/mock-sdk/src/main/java/io/mosip/mock/sdk/service/MatchService.java b/mock-sdk/src/main/java/io/mosip/mock/sdk/service/MatchService.java index 73391169..a21653fc 100644 --- a/mock-sdk/src/main/java/io/mosip/mock/sdk/service/MatchService.java +++ b/mock-sdk/src/main/java/io/mosip/mock/sdk/service/MatchService.java @@ -2,6 +2,7 @@ import java.security.NoSuchAlgorithmException; import java.util.ArrayList; +import java.util.Collections; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -9,6 +10,7 @@ import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.core.env.Environment; +import org.springframework.util.CollectionUtils; import io.mosip.kernel.biometrics.constant.BiometricType; import io.mosip.kernel.biometrics.constant.Match; @@ -383,23 +385,17 @@ private Decision compareFaces(List sampleSegments, List gallerySegment break; Boolean bio_found = false; - LOGGER.info("SampleBIR Value check",sampleBIR.getBdbInfo().getSubtype()); - if (sampleBIR.getBdbInfo().getSubtype() != null && !sampleBIR.getBdbInfo().getSubtype().isEmpty() - && sampleBIR.getBdbInfo().getSubtype().get(0) != null - && !sampleBIR.getBdbInfo().getSubtype().get(0).isEmpty()) { + if (!CollectionUtils.isEmpty(sampleBIR.getBdbInfo().getType()) + && sampleBIR.getBdbInfo().getType().get(0).equals(BiometricType.FACE)) { + LOGGER.info("SampleBIR Value check", sampleBIR.getBdbInfo().getSubtype()); for (BIR galleryBIR : gallerySegments) { - // need to check isValidBIRParams and isValidBDBData too - // if (!isValidBirData(galleryBIR)) - // break; - LOGGER.info("GalleryBIR Value check",galleryBIR.getBdbInfo().getSubtype()); - if (galleryBIR.getBdbInfo().getSubtype() == null || galleryBIR.getBdbInfo().getSubtype().isEmpty() || galleryBIR.getBdbInfo().getSubtype().get(0) - .equals(sampleBIR.getBdbInfo().getSubtype().get(0))) { + if (!CollectionUtils.isEmpty(galleryBIR.getBdbInfo().getType()) + && galleryBIR.getBdbInfo().getType().get(0).equals(BiometricType.FACE)) { if (Util.compareHash(galleryBIR.getBdb(), sampleBIR.getBdb())) { LOGGER.info("Modality: {}; Subtype: {} -- matched", BiometricType.FACE.value(), galleryBIR.getBdbInfo().getSubtype()); matched.add(true); bio_found = true; - break; } else { LOGGER.info("Modality: {}; Subtype: {} -- not matched", BiometricType.FACE.value(), galleryBIR.getBdbInfo().getSubtype()); @@ -408,21 +404,7 @@ private Decision compareFaces(List sampleSegments, List gallerySegment } } } - } else { - for (BIR galleryBIR : gallerySegments) { - if (Util.compareHash(galleryBIR.getBdb(), sampleBIR.getBdb())) { - LOGGER.info("Modality: {}; Subtype: {} -- matched", BiometricType.FACE.value(), - galleryBIR.getBdbInfo().getSubtype()); - matched.add(true); - bio_found = true; - } else { - LOGGER.info("Modality: {}; Subtype: {} -- not matched", BiometricType.FACE.value(), - galleryBIR.getBdbInfo().getSubtype()); - matched.add(false); - bio_found = true; - } - } - } + } if (!bio_found) { LOGGER.info("Modality: {}; Subtype: {} -- not found", BiometricType.FACE.value(), sampleBIR.getBdbInfo().getSubtype()); From 32092eb55c3305e685644290135543b18858d960 Mon Sep 17 00:00:00 2001 From: JanardhanBS-SyncByte <72377118+JanardhanBS-SyncByte@users.noreply.github.com> Date: Wed, 22 Nov 2023 10:05:04 +0530 Subject: [PATCH 7/7] [MOSIP-30342] reverted B1 related pom changes --- MockMDS/pom.xml | 9 +++++---- mock-abis/pom.xml | 6 +++--- mock-mv/pom.xml | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/MockMDS/pom.xml b/MockMDS/pom.xml index 5a477454..f465a6f3 100644 --- a/MockMDS/pom.xml +++ b/MockMDS/pom.xml @@ -12,7 +12,7 @@ io.mosip.mock.mds mock-mds - 1.2.0.1-B1-SNAPSHOT + 1.2.1-SNAPSHOT mock-mds A mock project for biometric provider @@ -47,7 +47,7 @@ io.mosip.biometric.util biometrics-util - 1.2.0.1-B1-SNAPSHOT + 0.0.1-SNAPSHOT org.springframework.boot @@ -129,7 +129,8 @@ io.mosip.kernel kernel-core - 1.2.0.1-B1 + + 1.2.1-SNAPSHOT @@ -382,4 +383,4 @@ - + \ No newline at end of file diff --git a/mock-abis/pom.xml b/mock-abis/pom.xml index c2629800..865973e4 100644 --- a/mock-abis/pom.xml +++ b/mock-abis/pom.xml @@ -3,7 +3,7 @@ 4.0.0 io.mosip.mock.abis mock-abis - 1.2.0.1.B1-SNAPSHOT + 1.2.1-SNAPSHOT jar MockAbis @@ -85,8 +85,8 @@ 2.9.2 - 1.2.0.1-B1 - 1.2.0.1-B1 + 1.2.1-SNAPSHOT + 1.2.1-SNAPSHOT 42.2.16 diff --git a/mock-mv/pom.xml b/mock-mv/pom.xml index 65d458d0..79c3dd28 100644 --- a/mock-mv/pom.xml +++ b/mock-mv/pom.xml @@ -5,7 +5,7 @@ 4.0.0 io.mosip.mock.mv mock-mv - 1.2.0.1-B1-SNAPSHOT + 1.2.1-SNAPSHOT jar mock-mv @@ -346,4 +346,4 @@ - + \ No newline at end of file