diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000000..b46eb33dd7 --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,108 @@ +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Build Commands + +```bash +# Build all modules (skip GPG signing for local dev) +mvn clean install -Dgpg.skip=true + +# Build a single module +mvn clean install -Dgpg.skip=true -pl biometrics-util +mvn clean install -Dgpg.skip=true -pl kernel-biometrics-api +mvn clean install -Dgpg.skip=true -pl kernel-cbeffutil-api +mvn clean install -Dgpg.skip=true -pl kernel-biosdk-provider + +# Run all tests +mvn test + +# Run tests for a single module +mvn test -pl biometrics-util + +# Run a specific test class +mvn test -pl biometrics-util -Dtest=FingerDecoderTest + +# Run with Sonar analysis +mvn verify sonar:sonar -Psonar + +# Skip tests during build +mvn clean install -Dgpg.skip=true -DskipTests +``` + +Java 21 is required. All modules compile with `--enable-preview` enabled. The surefire plugin passes several `--add-opens` JVM flags for tests; these are already configured in each module's pom.xml. + +## Architecture Overview + +This is a Maven multi-module project (`groupId: io.mosip.biometrics`, version `1.4.0-SNAPSHOT`) providing biometric utility libraries for the [MOSIP](https://mosip.io) ecosystem. All modules are pure library JARs published to Maven Central (Sonatype OSS). + +### Module Dependency Chain + +``` +kernel-biometrics-api ← defines all SPIs, entities, constants, models + ↑ +kernel-cbeffutil-api ← implements CbeffUtil SPI; depends on kernel-biometrics-api +kernel-biosdk-provider ← implements iBioProviderApi; depends on kernel-biometrics-api +biometrics-util ← standalone ISO↔image converters; no dependency on other modules here +test/ ← sample CLI apps showing library usage (not a deployed artifact) +``` + +### kernel-biometrics-api + +Defines the contracts everything else depends on: + +- **`IBioApi`** (`spi/`) — core SPI: `init`, `checkQuality`, `match`, `extractTemplate`, `segment`, `convertFormat` (deprecated since 1.2.1) +- **`IBioApiV2`** extends `IBioApi` — adds `convertFormatV2` (use this instead of deprecated `convertFormat`) +- **`CbeffUtil`** (`spi/`) — SPI for CBEFF XML operations: `createXML`, `updateXML`, `validateXML`, `getBIRDataFromXML`, `getAllBDBData`, etc. +- **`BIR`** / **`BiometricRecord`** (`entities/`) — core data model; `BIR` = Biometric Information Record, `BiometricRecord` wraps a list of BIRs +- **`BiometricType`** (`constant/`) — `FINGER`, `IRIS`, `FACE` +- **`BiometricFunction`** (`constant/`) — enum of functions the SDK can perform +- **`Response`** (`model/`) — generic wrapper returned by all `IBioApi` methods; contains status code and typed payload +- **`CbeffValidator`** (`commons/`) — static utility for XML schema validation and BIR extraction + +### kernel-cbeffutil-api + +Single implementation of the CBEFF standard: + +- **`CbeffImpl`** — Spring `@Component` implementing `CbeffUtil`; loads its XSD schema at startup from a config server URL (`mosip.kernel.xsdstorage-uri` + `mosip.kernel.xsdfile`) +- **`CbeffContainerImpl`** — handles XML serialization/deserialization of BIR lists; wraps the JAXB-based container +- **`CbeffContainerI`** — interface for the container + +### kernel-biosdk-provider + +Bridges MOSIP kernel to external biometric SDKs via reflection. Does not call SDK directly — it uses reflection to invoke SDK methods by configured class names. + +- **`iBioProviderApi`** (`spi/`) — internal SPI; each `BioProviderImpl_V_X_X` implements this per SDK protocol version +- **`BioProviderImpl_V_0_7`**, **`_V_0_8`**, **`_V_0_9`** — three concrete implementations; each handles a different SDK API version. The V_0_9 variant is the most current +- **`BioAPIFactory`** — Spring `@Component` with `@ConfigurationProperties(prefix = "mosip.biometric.sdk.providers")`; reads per-vendor per-modality config at startup, initializes providers, and builds a registry `Map>` +- Configuration keys follow the pattern: `mosip.biometric.sdk.providers.finger..*`, `.iris..*`, `.face..*` +- Uses H2 in-memory database and Spring Boot JPA (declared as dependencies but used by the SDK provider framework, not this library itself) + +### biometrics-util + +Standalone utility for ISO biometric format ↔ image conversion. No Spring dependency; purely functional static methods. + +- **ISO standards supported**: ISO 19794-4:2011 (Finger), ISO 19794-6:2011 (Iris), ISO 19794-5:2011 (Face) +- **Decoders**: `FingerDecoder`, `IrisDecoder`, `FaceDecoder` — convert ISO binary (`byte[]`) → JPEG/PNG `byte[]` or `BufferedImage` +- **Encoders**: `FingerEncoder`, `IrisEncoder`, `FaceEncoder` — convert image → ISO binary +- **`CommonUtil`** — converts a Base64URL-encoded ISO biometric from one image type (JP2000, WSQ) to another (JPEG, PNG) +- **`ConvertRequestDto`** — DTO used as input to all decoders/encoders; holds `version`, `inputBytes`, `compressionRatio` (default 95 for JPEG quality) +- **`ISOStandardsValidator`** — validates ISO header fields across all modalities +- **NIST parser** (`nist/parser/v2011/`) — parses NIST ITL 1-2011 XML biometric files into a rich DTO hierarchy; used by the `test/` sample apps +- JPEG2000 support via `jai-imageio-jpeg2000`; WSQ support via `jnbis`; OpenCV via `openpnp.opencv` + +### test/ module + +Not a deployed artifact — contains standalone CLI sample applications demonstrating library usage: `BioUtilApplication` (decode/encode ISO↔image), `BioUtilConvertApplication` (convert image type within ISO), `SampleNistFileReader`, `NistDataQualityAnalyser`. + +## Key Design Patterns + +**SPI + reflection for SDK integration**: `kernel-biosdk-provider` never has a compile-time dependency on the actual biometric SDK JAR. SDK class names are passed as config properties; the provider uses reflection to call `init`, `verify`, `identify`, `extractTemplate` etc. This allows swapping SDKs without recompiling. + +**CBEFF XML as the canonical biometric interchange format**: All biometric data exchanged between MOSIP components flows as CBEFF XML. The `BIR` entity maps directly to ISO/IEC 19785 CBEFF structures. The XSD for validation is loaded at runtime from a config server. + +**`convertFormat` is deprecated**: Prefer `IBioApiV2.convertFormatV2` (returns `Response`) over the old `IBioApi.convertFormat` (returns `BiometricRecord` directly with no error wrapping). The old method is marked `@Deprecated(since = "1.2.1", forRemoval = true)`. + +## Sonar Coverage Exclusions + +`biometrics-util` excludes from coverage: `constant/`, `exception/`, `nist/parser/v2011/`, and various ISO data model classes (e.g., `FaceBDIR`, `IrisBDIR`, `FingerBDIR`, `FeaturePoint`, `LandmarkPointType`). These are excluded because they are generated/data-only classes with no logic to test. \ No newline at end of file diff --git a/THIRD-PARTY-NOTICES b/THIRD-PARTY-NOTICES index baef52da2d..4b1129735b 100644 --- a/THIRD-PARTY-NOTICES +++ b/THIRD-PARTY-NOTICES @@ -4,7 +4,7 @@ This project includes third-party packages that are distributed under various op ================================================================================ Package: MOSIP Bio Utils -Version: 1.3.0-SNAPSHOT +Version: 1.4.0-SNAPSHOT License: Mozilla Public License 2.0 (Inferred from project’s official repository) Homepage: https://github.com/mosip/bio-utils ================================================================================ @@ -152,7 +152,7 @@ Homepage: https://www.h2database.com ================================================================================ Package: imgscalr-lib License: Apache License 2.0 -Homepage: https://github.com/rkalla/imgscalr +Homepage: https://github.com/thebuzzmedia/imgscalr ================================================================================ ================================================================================ diff --git a/THIRD-PARTY-NOTICES.txt b/THIRD-PARTY-NOTICES.txt new file mode 100644 index 0000000000..4b1129735b --- /dev/null +++ b/THIRD-PARTY-NOTICES.txt @@ -0,0 +1,164 @@ +THIRD-PARTY-NOTICES + +This project includes third-party packages that are distributed under various open-source licenses. Below is a list of packages and their associated licenses. + +================================================================================ +Package: MOSIP Bio Utils +Version: 1.4.0-SNAPSHOT +License: Mozilla Public License 2.0 (Inferred from project’s official repository) +Homepage: https://github.com/mosip/bio-utils +================================================================================ + +================================================================================ +Package: Apache Maven Plugins +(maven-compiler-plugin, maven-gpg-plugin, maven-javadoc-plugin, maven-source-plugin, maven-jar-plugin, maven-resources-plugin, maven-shade-plugin, maven-surefire-plugin, maven-war-plugin, maven-antrun-plugin, maven-dependency-plugin) +Version: + - maven-compiler-plugin: 3.11.0 + - maven-gpg-plugin: 3.2.3 + - maven-javadoc-plugin: 3.2.0 + - maven-source-plugin: 3.3.1 + - maven-jar-plugin: 3.4.0 + - maven-resources-plugin: 3.3.1 + - maven-shade-plugin: 3.2.4 + - maven-surefire-plugin: 3.1.2 + - maven-war-plugin: 3.1.0 + - maven-antrun-plugin: 3.0.0 + - maven-dependency-plugin: 2.10 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/ +================================================================================ + +================================================================================ +Package: Sonar Maven Plugin (org.sonarsource.scanner.maven:sonar-maven-plugin) +Version: 3.7.0.1746 +License: LGPL 3.0 +Homepage: https://docs.sonarqube.org/latest/analysis/scan/sonarscanner-for-maven/ +================================================================================ + +================================================================================ +Package: Apache Commons Lang (org.apache.commons:commons-lang3) +Version: (Not specified) +License: Apache License 2.0 (Inferred from project’s official repository) +Homepage: https://commons.apache.org/proper/commons-lang/ +================================================================================ + +================================================================================ +Package: Jackson Libraries (com.fasterxml.jackson.core, com.fasterxml.jackson.dataformat, com.fasterxml.jackson.module) +Version: (Not specified) +License: Apache License 2.0 +Homepage: https://github.com/FasterXML/jackson +================================================================================ + +================================================================================ +Package: Google Protobuf (com.google.protobuf:protobuf-java) +Version: 3.13.0, 3.16.3 +License: BSD-3-Clause (Inferred from project’s official repository) +Homepage: https://github.com/protocolbuffers/protobuf +================================================================================ + +================================================================================ +Package: OpenCV (org.openpnp:opencv) +Version: 4.5.3-4 +License: Apache License 2.0 +Homepage: https://opencv.org/ +================================================================================ + +================================================================================ +Package: Lombok (org.projectlombok:lombok) +Version: (Not specified) +License: MIT License (Inferred from project’s official repository) +Homepage: https://projectlombok.org/ +================================================================================ + +================================================================================ +Package: Hibernate Validator (org.hibernate.validator:hibernate-validator) +Version: (Not specified) +License: Apache License 2.0 (Inferred from project’s official repository) +Homepage: http://hibernate.org/validator/ +================================================================================ + +================================================================================ +Package: JUnit (junit:junit, org.junit.vintage:junit-vintage-engine, org.junit.jupiter:junit-jupiter) +Version: Various +License: Eclipse Public License 1.0/2.0 (Inferred from project’s official repository) +Homepage: https://junit.org/ +================================================================================ + +================================================================================ +Package: Mockito (org.mockito:mockito-core, org.mockito:mockito-inline) +Version: 3.3.3, 5.8.0 +License: MIT License (Inferred from project’s official repository) +Homepage: https://site.mockito.org/ +================================================================================ + +================================================================================ +Package: Powermock (org.powermock:powermock-api-mockito2, org.powermock:powermock-module-junit4) +Version: (Not specified) +License: Apache License 2.0 (Inferred from project’s official repository) +Homepage: https://github.com/powermock/powermock +================================================================================ + +================================================================================ +Package: Bouncy Castle (org.bouncycastle:bcutil-jdk18on) +Version: 1.78.1 +License: MIT License (Inferred from project’s official repository) +Homepage: https://www.bouncycastle.org/ +================================================================================ + +================================================================================ +Package: Apache POI (org.apache.poi:poi-ooxml) +Version: 5.2.5 +License: Apache License 2.0 +Homepage: https://poi.apache.org/ +================================================================================ + +================================================================================ +Package: Google Gson (com.google.code.gson:gson) +Version: 2.10.1 +License: Apache License 2.0 +Homepage: https://github.com/google/gson +================================================================================ + +================================================================================ +Package: Spring Boot +License: Apache License 2.0 +Homepage: https://spring.io/projects/spring-boot +================================================================================ + +================================================================================ +Package: SLF4J (slf4j-api, log4j12) +License: MIT License +Homepage: https://www.slf4j.org/ +================================================================================ + +================================================================================ +Package: JAI ImageIO JPEG2000 +License: Dual License (JJ2000 License AND BSD 3-Clause with Nuclear Disclaimer) +Homepage: https://github.com/jai-imageio/jai-imageio-core +================================================================================ + +================================================================================ +Package: JNBIS +License: Apache License 2.0 +Homepage: https://github.com/mhshams/jnbis +================================================================================ + +================================================================================ +Package: H2 Database +License: EPL-1.0 OR MPL-2.0 +Homepage: https://www.h2database.com +================================================================================ + +================================================================================ +Package: imgscalr-lib +License: Apache License 2.0 +Homepage: https://github.com/thebuzzmedia/imgscalr +================================================================================ + +================================================================================ +Package: OkHttp (mockwebserver) +License: Apache License 2.0 +Homepage: https://square.github.io/okhttp/ +================================================================================ + +Full license texts and additional details for each of the above packages are available in the license/ directory of this repository. Please refer to those files or the original source of each package for complete legal terms and conditions. diff --git a/biometrics-util/pom.xml b/biometrics-util/pom.xml index f0203e6d47..51a73e7553 100644 --- a/biometrics-util/pom.xml +++ b/biometrics-util/pom.xml @@ -5,7 +5,7 @@ 4.0.0 io.mosip.biometric.util biometrics-util - 1.2.1-SNAPSHOT + 1.4.0-SNAPSHOT biometrics-util https://github.com/mosip/bio-utils This utility is used to convert ISO to Image and Image to ISO @@ -24,8 +24,8 @@ 3.2.3 3.0.2 3.1.0 - 0.7.0 3.7.0.1746 + 0.7.0 3.0.1 @@ -35,23 +35,23 @@ 1.3.0 2.0.2 + + 0.8.11 + 4.5.3-4 - 1.2.1-SNAPSHOT - 1.2.1-SNAPSHOT - - - 0.8.11 + 1.4.0-SNAPSHOT + 1.4.0-SNAPSHOT - - 5.8.2 - 4.11.0 - 4.5.1 + + 5.8.2 + 4.11.0 + 4.5.1 - - **/constant/**,**/exception/**,**/nist/parser/v2011/**,**/AbstractImageInfo.java,**/ConvertRequestDto.java,**/ImageDecoderRequestDto.java,**/NistRequestDto.java,**/FaceBDIR.java,**/FeaturePoint.java,**/ImageDataType.java,**/LandmarkPointType.java,**/io/mosip/biometrics/util/finger/Representation.java,**/io/mosip/biometrics/util/finger/SegmentationBlock.java,**/io/mosip/biometrics/util/finger/ExtendedDataBlock.java,**/IrisBDIR.java,**/FingerBDIR.java,**/io/mosip/biometrics/util/iris/Representation.java,**/io/mosip/biometrics/util/iris/ImageInformation.java,**/io/mosip/biometrics/util/iris/ImageData.java,**/io/mosip/biometrics/util/iris/RepresentationData.java + + **/constant/**,**/exception/**,**/nist/parser/v2011/**,**/AbstractImageInfo.java,**/ConvertRequestDto.java,**/ImageDecoderRequestDto.java,**/NistRequestDto.java,**/FaceBDIR.java,**/FeaturePoint.java,**/ImageDataType.java,**/LandmarkPointType.java,**/io/mosip/biometrics/util/finger/Representation.java,**/io/mosip/biometrics/util/finger/SegmentationBlock.java,**/io/mosip/biometrics/util/finger/ExtendedDataBlock.java,**/IrisBDIR.java,**/FingerBDIR.java,**/io/mosip/biometrics/util/iris/Representation.java,**/io/mosip/biometrics/util/iris/ImageInformation.java,**/io/mosip/biometrics/util/iris/ImageData.java,**/io/mosip/biometrics/util/iris/RepresentationData.java @@ -158,7 +158,7 @@ junit-bom ${org.junit.version} pom - test + import @@ -235,6 +235,25 @@ + + org.jacoco + jacoco-maven-plugin + ${jacoco.maven.plugin.version} + + + + prepare-agent + + + + report + prepare-package + + report + + + + org.apache.maven.plugins maven-javadoc-plugin @@ -296,25 +315,6 @@ ${project.basedir}/.git - - org.jacoco - jacoco-maven-plugin - ${jacoco.maven.plugin.version} - - - - prepare-agent - - - - report - prepare-package - - report - - - - diff --git a/kernel-biometrics-api/NOTICE b/kernel-biometrics-api/NOTICE index 42a324af51..6afc1ec71b 100644 --- a/kernel-biometrics-api/NOTICE +++ b/kernel-biometrics-api/NOTICE @@ -10,7 +10,9 @@ License 2.0 and require attribution. Their original NOTICE contents are retained as required by the Apache License 2.0. +=============================================================================== Apache License 2.0 Components +=============================================================================== • Spring Boot Starter Web • Spring Boot Starter Test @@ -43,7 +45,9 @@ Apache License 2.0 Components • Git Commit ID Plugin (3.0.1) +=============================================================================== Notes +=============================================================================== All MOSIP Kernel and Biometrics components (licensed under MPL-2.0), JUnit (EPL-1.0 / EPL-2.0), SLF4J and Mockito (MIT), Protobuf (BSD-3-Clause), @@ -52,3 +56,4 @@ NOTICE.txt. Their license texts are included separately. Full license texts for all dependencies are available in the `license/` directory or at their respective project repositories. + diff --git a/kernel-biometrics-api/THIRD-PARTY-NOTICES b/kernel-biometrics-api/THIRD-PARTY-NOTICES index b9748c12a7..5390a1c394 100644 --- a/kernel-biometrics-api/THIRD-PARTY-NOTICES +++ b/kernel-biometrics-api/THIRD-PARTY-NOTICES @@ -4,35 +4,35 @@ This project includes third-party packages that are distributed under various op ================================================================================ Package: MOSIP Kernel BOM -Version: 1.3.0-SNAPSHOT +Version: 1.4.0-SNAPSHOT License: Mozilla Public License 2.0 (Inferred from project’s official repository) Homepage: https://mosip.io ================================================================================ ================================================================================ Package: MOSIP Kernel Core -Version: 1.3.0-SNAPSHOT +Version: 1.4.0-SNAPSHOT License: Mozilla Public License 2.0 (Inferred from project’s official repository) Homepage: https://mosip.io ================================================================================ ================================================================================ Package: MOSIP Kernel Logger Logback -Version: 1.3.0-SNAPSHOT +Version: 1.4.0-SNAPSHOT License: Mozilla Public License 2.0 (Inferred) Homepage: https://mosip.io ================================================================================ ================================================================================ Package: MOSIP Biometrics API -Version: 1.3.0-SNAPSHOT +Version: 1.4.0-SNAPSHOT License: Mozilla Public License 2.0 (Inferred) Homepage: https://mosip.io ================================================================================ ================================================================================ Package: MOSIP Biometrics Util -Version: 1.3.0-SNAPSHOT +Version: 1.4.0-SNAPSHOT License: Mozilla Public License 2.0 (Inferred) Homepage: https://mosip.io ================================================================================ diff --git a/kernel-biometrics-api/THIRD-PARTY-NOTICES.txt b/kernel-biometrics-api/THIRD-PARTY-NOTICES.txt new file mode 100644 index 0000000000..dab31da7ee --- /dev/null +++ b/kernel-biometrics-api/THIRD-PARTY-NOTICES.txt @@ -0,0 +1,276 @@ +THIRD-PARTY-NOTICES + +This project includes third-party packages that are distributed under various open-source licenses. Below is a list of packages and their associated licenses. + +================================================================================ +Package: MOSIP Kernel BOM +Version: 1.4.0-SNAPSHOT +License: Mozilla Public License 2.0 (Inferred from project’s official repository) +Homepage: https://mosip.io +================================================================================ + +================================================================================ +Package: MOSIP Kernel Core +Version: 1.4.0-SNAPSHOT +License: Mozilla Public License 2.0 (Inferred from project’s official repository) +Homepage: https://mosip.io +================================================================================ + +================================================================================ +Package: MOSIP Kernel Logger Logback +Version: 1.4.0-SNAPSHOT +License: Mozilla Public License 2.0 (Inferred) +Homepage: https://mosip.io +================================================================================ + +================================================================================ +Package: MOSIP Biometrics API +Version: 1.4.0-SNAPSHOT +License: Mozilla Public License 2.0 (Inferred) +Homepage: https://mosip.io +================================================================================ + +================================================================================ +Package: MOSIP Biometrics Util +Version: 1.4.0-SNAPSHOT +License: Mozilla Public License 2.0 (Inferred) +Homepage: https://mosip.io +================================================================================ + +================================================================================ +Package: Spring Boot Starter Web +License: Apache License 2.0 (Inferred) +Homepage: https://spring.io/projects/spring-boot +================================================================================ + +================================================================================ +Package: Spring Boot Starter Test +License: Apache License 2.0 (Inferred) +Homepage: https://spring.io/projects/spring-boot +================================================================================ + +================================================================================ +Package: Spring Boot Starter Data JPA +License: Apache License 2.0 (Inferred) +Homepage: https://spring.io/projects/spring-data-jpa +================================================================================ + +================================================================================ +Package: Hibernate Validator +Version: Not specified +License: Apache License 2.0 (Inferred) +Homepage: https://hibernate.org/validator/ +================================================================================ + +================================================================================ +Package: Jackson Core +License: Apache License 2.0 (Inferred) +Homepage: https://github.com/FasterXML/jackson +================================================================================ + +================================================================================ +Package: Jackson Databind +License: Apache License 2.0 (Inferred) +Homepage: https://github.com/FasterXML/jackson-databind +================================================================================ + +================================================================================ +Package: Jackson Annotations +License: Apache License 2.0 (Inferred) +Homepage: https://github.com/FasterXML/jackson-annotations +================================================================================ + +================================================================================ +Package: Jackson Dataformat XML +License: Apache License 2.0 (Inferred) +Homepage: https://github.com/FasterXML/jackson-dataformat-xml +================================================================================ + +================================================================================ +Package: Jackson Dataformat CSV +License: Apache License 2.0 (Inferred) +Homepage: https://github.com/FasterXML/jackson-dataformat-csv +================================================================================ + +================================================================================ +Package: Jackson JAXB Annotations Module +License: Apache License 2.0 (Inferred) +Homepage: https://github.com/FasterXML/jackson-module-jaxb-annotations +================================================================================ + +================================================================================ +Package: SLF4J API +License: MIT License (Inferred) +Homepage: http://www.slf4j.org +================================================================================ + +================================================================================ +Package: Gson +Version: 2.8.6 +License: Apache License 2.0 +Homepage: https://github.com/google/gson +================================================================================ + +================================================================================ +Package: JNBIS (Fingerprint Image Decoder) +Version: 2.0.2 +License: Apache License 2.0 +Homepage: https://github.com/mhshams/jnbis +================================================================================ + +================================================================================ +Package: H2 Database +License: EPL 1.0 or MPL 2.0 +Homepage: https://www.h2database.com +================================================================================ + +================================================================================ +Package: Protobuf Java +Version: 3.13.0 +License: BSD-3-Clause +Homepage: https://github.com/protocolbuffers/protobuf +================================================================================ + +================================================================================ +Package: Protobuf Java +Version: 3.16.3 +License: BSD-3-Clause +Homepage: https://github.com/protocolbuffers/protobuf +================================================================================ + +================================================================================ +Package: imgscalr-lib +Version: 4.2 +License: Apache License 2.0 +Homepage: https://github.com/thebuzzmedia/imgscalr +================================================================================ + +================================================================================ +Package: JAI ImageIO JPEG2000 +Version: 1.3.0 +License: BSD-3-Clause-No-Nuclear-License +Homepage: https://github.com/jai-imageio/jai-imageio-core +================================================================================ + +================================================================================ +Package: OkHttp +Version: 2.7.5 +License: Apache License 2.0 +Homepage: https://square.github.io/okhttp/ +================================================================================ + +================================================================================ +Package: JUnit 4 +License: Eclipse Public License 1.0 (Inferred) +Homepage: https://junit.org +================================================================================ + +================================================================================ +Package: JUnit Vintage Engine +License: Eclipse Public License 2.0 (Inferred) +Homepage: https://junit.org +================================================================================ + +================================================================================ +Package: JUnit Jupiter +Version: 5.10.2 +License: Eclipse Public License 2.0 +Homepage: https://junit.org/junit5/ +================================================================================ + +================================================================================ +Package: Mockito Core +Version: 3.3.3 +License: MIT License +Homepage: https://github.com/mockito/mockito +================================================================================ + +================================================================================ +Package: Mockito Core +Version: 5.8.0 +License: MIT License +Homepage: https://github.com/mockito/mockito +================================================================================ + +================================================================================ +Package: PowerMock API Mockito2 +License: Apache License 2.0 +Homepage: https://github.com/powermock/powermock +================================================================================ + +================================================================================ +Package: PowerMock Module JUnit4 +License: Apache License 2.0 +Homepage: https://github.com/powermock/powermock +================================================================================ + +================================================================================ +Package: Apache Commons Lang3 +License: Apache License 2.0 +Homepage: https://commons.apache.org/proper/commons-lang/ +================================================================================ + +================================================================================ +Package: Apache Maven Compiler Plugin +Version: 3.11.0 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-compiler-plugin/ +================================================================================ + +================================================================================ +Package: Apache Maven GPG Plugin +Version: 1.5 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-gpg-plugin/ +================================================================================ + +================================================================================ +Package: Apache Maven GPG Plugin +Version: 3.2.3 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-gpg-plugin/ +================================================================================ + +================================================================================ +Package: Apache Maven Javadoc Plugin +Version: 3.2.0 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-javadoc-plugin/ +================================================================================ + +================================================================================ +Package: Apache Maven Surefire Plugin +Version: 2.22.0 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-surefire-plugin/ +================================================================================ + +================================================================================ +Package: Apache Maven Surefire Plugin +Version: 3.1.2 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-surefire-plugin/ +================================================================================ + +================================================================================ +Package: Apache Maven Source Plugin +Version: 3.3.1 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-source-plugin/ +================================================================================ + +================================================================================ +Package: Apache Maven JAR Plugin +Version: 3.4.0 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-jar-plugin/ +================================================================================ + +================================================================================ +Package: Apache Maven Dependency Plugin +Version: 2.10 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-dependency-plugin/ +================================================================================ + +Full license texts and additional details for each of the above packages are available in the license/ directory of this repository. Please refer to those files or the original source of each package for complete legal terms and conditions. diff --git a/kernel-biometrics-api/pom.xml b/kernel-biometrics-api/pom.xml index 538e0af74c..a66bed7839 100644 --- a/kernel-biometrics-api/pom.xml +++ b/kernel-biometrics-api/pom.xml @@ -5,7 +5,7 @@ io.mosip.kernel kernel-biometrics-api - 1.2.1-SNAPSHOT + 1.4.0-SNAPSHOT kernel-biometrics-api biometrics api definitions https://github.com/mosip/bio-utils @@ -40,8 +40,8 @@ 2.8.6 - 1.2.1-SNAPSHOT - 1.2.1-SNAPSHOT + 1.4.0-SNAPSHOT + 1.4.0-SNAPSHOT **/constant/** diff --git a/kernel-biometrics-api/src/main/java/io/mosip/kernel/biometrics/commons/CbeffValidator.java b/kernel-biometrics-api/src/main/java/io/mosip/kernel/biometrics/commons/CbeffValidator.java index e046fee2af..102f5546bc 100644 --- a/kernel-biometrics-api/src/main/java/io/mosip/kernel/biometrics/commons/CbeffValidator.java +++ b/kernel-biometrics-api/src/main/java/io/mosip/kernel/biometrics/commons/CbeffValidator.java @@ -2,7 +2,6 @@ import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; -import java.io.IOException; import java.io.OutputStreamWriter; import java.nio.charset.StandardCharsets; import java.time.ZoneOffset; @@ -11,7 +10,6 @@ import javax.xml.bind.JAXBContext; import javax.xml.bind.JAXBElement; -import javax.xml.bind.JAXBException; import javax.xml.bind.Marshaller; import javax.xml.bind.Unmarshaller; import javax.xml.transform.stream.StreamSource; @@ -27,6 +25,7 @@ import io.mosip.kernel.core.cbeffutil.constant.CbeffConstant; import io.mosip.kernel.core.cbeffutil.exception.CbeffException; import io.mosip.kernel.core.util.CryptoUtil; +import io.mosip.kernel.biometrics.entities.*; /** * Utility class for Cbeff (Common Biometric Exchange File Format) data @@ -49,7 +48,11 @@ public class CbeffValidator { static { try { - BIR_CONTEXT = JAXBContext.newInstance(BIR.class); + BIR_CONTEXT = JAXBContext.newInstance(BIR.class, + BIRInfo.class, + BDBInfo.class, + SBInfo.class, + VersionType.class); } catch (Exception e) { throw new ExceptionInInitializerError("Failed to initialize JAXBContext for BIR: " + e.getMessage()); } @@ -184,18 +187,21 @@ private static long getFormatType(String type) { * @param xsd The XSD (XML Schema Definition) used for validation as a byte * array. * @return A byte array containing the generated and validated XML data. - * @throws CbeffValidationException If XSD validation fails. - * @throws CbeffException If any other error occurs during the - * process. + * @throws Exception If XSD validation fails */ public static byte[] createXMLBytes(BIR bir, byte[] xsd) throws Exception { CbeffValidator.validateXML(bir); Marshaller jaxbMarshaller = BIR_CONTEXT.createMarshaller(); jaxbMarshaller.setProperty(Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.TRUE); + jaxbMarshaller.setProperty(Marshaller.JAXB_ENCODING, "UTF-8"); + byte[] savedData; - try (ByteArrayOutputStream baos = new ByteArrayOutputStream()) { - jaxbMarshaller.marshal(bir, baos); + try (ByteArrayOutputStream baos = new ByteArrayOutputStream(); + OutputStreamWriter writer = new OutputStreamWriter(baos, StandardCharsets.UTF_8)) { + + jaxbMarshaller.marshal(bir, writer); + writer.flush(); // ensure all characters are written to baos savedData = baos.toByteArray(); } diff --git a/kernel-biometrics-api/src/main/java/io/mosip/kernel/biometrics/entities/ByteArrayToIntArraySerializer.java b/kernel-biometrics-api/src/main/java/io/mosip/kernel/biometrics/entities/ByteArrayToIntArraySerializer.java index 21c8766345..94baca8f74 100644 --- a/kernel-biometrics-api/src/main/java/io/mosip/kernel/biometrics/entities/ByteArrayToIntArraySerializer.java +++ b/kernel-biometrics-api/src/main/java/io/mosip/kernel/biometrics/entities/ByteArrayToIntArraySerializer.java @@ -47,49 +47,49 @@ */ public class ByteArrayToIntArraySerializer extends StdSerializer { - private final boolean useUnsigned; + private final boolean useUnsigned; - /** - * Default constructor using signed integer conversion (-128 to 127). - */ - public ByteArrayToIntArraySerializer() { - this(byte[].class, false); - } + /** + * Default constructor using signed integer conversion (-128 to 127). + */ + public ByteArrayToIntArraySerializer() { + this(byte[].class, false); + } - /** - * Constructs a serializer for byte arrays with configurable signed/unsigned conversion. - * - * @param t the class type (byte[]) - * @param useUnsigned true to treat bytes as unsigned (0 to 255), - * false for signed (-128 to 127) - */ - protected ByteArrayToIntArraySerializer(Class t, boolean useUnsigned) { - super(t); - this.useUnsigned = useUnsigned; - } + /** + * Constructs a serializer for byte arrays with configurable signed/unsigned conversion. + * + * @param t the class type (byte[]) + * @param useUnsigned true to treat bytes as unsigned (0 to 255), + * false for signed (-128 to 127) + */ + protected ByteArrayToIntArraySerializer(Class t, boolean useUnsigned) { + super(t); + this.useUnsigned = useUnsigned; + } - /** - * Serializes a byte array to a JSON array of integers. - *

- * Writes {@code null} to the output if the byte array itself is null. - * - * @param value the byte array to serialize - * @param gen the JSON generator - * @param provider the serializer provider - * @throws IOException if serialization fails - */ - @Override - public void serialize(byte[] value, JsonGenerator gen, SerializerProvider provider) throws IOException { - if (value == null) { - gen.writeNull(); - return; - } + /** + * Serializes a byte array to a JSON array of integers. + *

+ * Writes {@code null} to the output if the byte array itself is null. + * + * @param value the byte array to serialize + * @param gen the JSON generator + * @param provider the serializer provider + * @throws IOException if serialization fails + */ + @Override + public void serialize(byte[] value, JsonGenerator gen, SerializerProvider provider) throws IOException { + if (value == null) { + gen.writeNull(); + return; + } - gen.writeStartArray(); - for (byte b : value) { - int intValue = useUnsigned ? Byte.toUnsignedInt(b) : b; - gen.writeNumber(intValue); - } - gen.writeEndArray(); - } -} + // Convert byte[] to int[] for writing + int[] intArray = new int[value.length]; + for (int i = 0; i < value.length; i++) { + intArray[i] = useUnsigned ? Byte.toUnsignedInt(value[i]) : value[i]; + } + gen.writeArray(intArray, 0, intArray.length); + } +} \ No newline at end of file diff --git a/kernel-biometrics-api/src/main/java/io/mosip/kernel/biometrics/entities/IntArrayToByteArrayDeserializer.java b/kernel-biometrics-api/src/main/java/io/mosip/kernel/biometrics/entities/IntArrayToByteArrayDeserializer.java index 22a33f1671..aaf889f08b 100644 --- a/kernel-biometrics-api/src/main/java/io/mosip/kernel/biometrics/entities/IntArrayToByteArrayDeserializer.java +++ b/kernel-biometrics-api/src/main/java/io/mosip/kernel/biometrics/entities/IntArrayToByteArrayDeserializer.java @@ -3,12 +3,12 @@ import com.fasterxml.jackson.core.JsonParser; import com.fasterxml.jackson.core.JsonToken; import com.fasterxml.jackson.databind.DeserializationContext; +import com.fasterxml.jackson.databind.DeserializationFeature; +import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.databind.deser.std.StdDeserializer; import java.io.IOException; -import java.util.ArrayList; import java.util.Base64; -import java.util.List; /** * A custom Jackson {@link StdDeserializer} that converts a JSON array of integers @@ -47,76 +47,79 @@ */ public class IntArrayToByteArrayDeserializer extends StdDeserializer { - private final boolean useUnsigned; + private static final ObjectMapper MAPPER = new ObjectMapper() + .disable(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES) + .disable(JsonParser.Feature.STRICT_DUPLICATE_DETECTION); - /** - * Default constructor using signed byte conversion (-128 to 127). - */ - public IntArrayToByteArrayDeserializer() { - this(byte[].class, false); - } + private static final Base64.Decoder STD_DECODER = Base64.getDecoder(); - /** - * Constructs a deserializer with configurable signed/unsigned conversion. - * - * @param t the class type handled by this deserializer - * @param useUnsigned {@code true} to interpret integers as unsigned (0 to 255), - * {@code false} for signed (-128 to 127) - */ - protected IntArrayToByteArrayDeserializer(Class t, boolean useUnsigned) { - super(t); - this.useUnsigned = useUnsigned; - } + private final boolean useUnsigned; - /** - * Deserializes a JSON array of integers into a byte array. - * - * @param parser the JSON parser - * @param context the deserialization context - * @return a byte array corresponding to the numeric JSON input - * @throws IOException if the JSON is invalid, not an array, or contains values outside - * the expected signed/unsigned byte range - */ - @Override - public byte[] deserialize(JsonParser parser, DeserializationContext context) throws IOException { - JsonToken token = parser.getCurrentToken(); - if (token == JsonToken.VALUE_STRING) { - // Base64 input - String base64 = parser.getText(); - if (base64 == null || base64.isEmpty()) { - return new byte[0]; // return empty array - } - return Base64.getDecoder().decode(base64); - } + /** + * Default constructor using signed byte conversion (-128 to 127). + */ + public IntArrayToByteArrayDeserializer() { + this(byte[].class, false); + } - if (token != JsonToken.START_ARRAY) { - String errorMsg = "Expected JSON array for byte[] deserialization, found: " + parser.getCurrentToken(); - throw new IOException(errorMsg); - } + /** + * Constructs a deserializer with configurable signed/unsigned conversion. + * + * @param t the class type handled by this deserializer + * @param useUnsigned {@code true} to interpret integers as unsigned (0 to 255), + * {@code false} for signed (-128 to 127) + */ + protected IntArrayToByteArrayDeserializer(Class t, boolean useUnsigned) { + super(t); + this.useUnsigned = useUnsigned; + } - List byteList = new ArrayList<>(); - while (parser.nextToken() != JsonToken.END_ARRAY) { - if (parser.getCurrentToken() != JsonToken.VALUE_NUMBER_INT) { - throw new IOException("Expected integer value in JSON array, found: " + parser.getCurrentToken()); - } + /** + * Deserializes a JSON array of integers into a byte array. + * + * @param parser the JSON parser + * @param context the deserialization context + * @return a byte array corresponding to the numeric JSON input + * @throws IOException if the JSON is invalid, not an array, or contains values outside + * the expected signed/unsigned byte range + */ + @Override + public byte[] deserialize(JsonParser parser, DeserializationContext context) throws IOException { + JsonToken token = parser.getCurrentToken(); + if (token == JsonToken.VALUE_STRING) { + // Base64 input + String base64 = parser.getText(); + if (base64 == null || base64.isEmpty()) { + return new byte[0]; // return empty array + } + return STD_DECODER.decode(base64); + } - int value = parser.getIntValue(); - if (useUnsigned) { - if (value < 0 || value > 255) { - throw new IOException("Unsigned byte value out of range (0 to 255): " + value); - } - } else { - if (value < -128 || value > 127) { - throw new IOException("Signed byte value out of range (-128 to 127): " + value); - } - } - byteList.add((byte) value); - } + else if (token != JsonToken.START_ARRAY) { + String errorMsg = "Expected JSON array for byte[] deserialization, found: " + parser.getCurrentToken(); + throw new IOException(errorMsg); + } + else { + // Read the entire array as int[] to avoid manual token iteration + int[] intArray = MAPPER.readValue(parser, int[].class); - byte[] result = new byte[byteList.size()]; - for (int i = 0; i < byteList.size(); i++) { - result[i] = byteList.get(i); - } - return result; - } + // Validate range and convert to byte[] + byte[] result = new byte[intArray.length]; + for (int i = 0; i < intArray.length; i++) { + int value = intArray[i]; + if (useUnsigned) { + if (value < 0 || value > 255) { + throw new IOException("Unsigned byte value out of range (0 to 255): " + value); + } + } else { + if (value < -128 || value > 127) { + throw new IOException("Signed byte value out of range (-128 to 127): " + value); + } + } + result[i] = (byte) value; + } + + return result; + } + } } \ No newline at end of file diff --git a/kernel-biometrics-api/src/main/java/io/mosip/kernel/biometrics/entities/ObjectFactory.java b/kernel-biometrics-api/src/main/java/io/mosip/kernel/biometrics/entities/ObjectFactory.java new file mode 100644 index 0000000000..ba55acae52 --- /dev/null +++ b/kernel-biometrics-api/src/main/java/io/mosip/kernel/biometrics/entities/ObjectFactory.java @@ -0,0 +1,23 @@ +// +// This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v2.2.8-b130911.1802 +// See http://java.sun.com/xml/jaxb +// Any modifications to this file will be lost upon recompilation of the source schema. +// Generated on: 2019.05.13 at 03:22:53 PM IST +// + +package io.mosip.kernel.biometrics.entities; + +import lombok.Data; + +import javax.xml.bind.annotation.*; + +@Data +@XmlRegistry +public class ObjectFactory { + public ObjectFactory() {} + + public BIR createBIR() { + return new BIR(); + } + // Add other factory methods as needed +} \ No newline at end of file diff --git a/kernel-biometrics-api/src/test/io/mosip/kernel/biometrics/CbeffValidatorTest.java b/kernel-biometrics-api/src/test/io/mosip/kernel/biometrics/CbeffValidatorTest.java index dc5ff0f937..71ec3c6fd9 100644 --- a/kernel-biometrics-api/src/test/io/mosip/kernel/biometrics/CbeffValidatorTest.java +++ b/kernel-biometrics-api/src/test/io/mosip/kernel/biometrics/CbeffValidatorTest.java @@ -262,7 +262,7 @@ public void setUp() throws Exception { .build(); birList.add(iHandGeo); - + } @@ -455,7 +455,7 @@ public void getBDBBasedOnTypeAndSubTypeSubTypeNULLWithIrisBioTypeTest() throws E Map bdbMap = CbeffValidator.getBDBBasedOnTypeAndSubType(bir, "Iris", null); MatcherAssert.assertThat(bdbMap.size(), is(1)); } - + @Test public void getBDBBasedOnTypeAndSubTypeAllNULLTest() throws Exception { BIR bir = new BIR(); diff --git a/kernel-biometrics-api/src/test/resources/schema/updatedcbeff.xsd b/kernel-biometrics-api/src/test/resources/schema/updatedcbeff.xsd index f4ffb23a43..3bc3942584 100644 --- a/kernel-biometrics-api/src/test/resources/schema/updatedcbeff.xsd +++ b/kernel-biometrics-api/src/test/resources/schema/updatedcbeff.xsd @@ -15,8 +15,10 @@ SCHEMA. --> - - + + + + diff --git a/kernel-biosdk-provider/THIRD-PARTY-NOTICES b/kernel-biosdk-provider/THIRD-PARTY-NOTICES index b9748c12a7..5390a1c394 100644 --- a/kernel-biosdk-provider/THIRD-PARTY-NOTICES +++ b/kernel-biosdk-provider/THIRD-PARTY-NOTICES @@ -4,35 +4,35 @@ This project includes third-party packages that are distributed under various op ================================================================================ Package: MOSIP Kernel BOM -Version: 1.3.0-SNAPSHOT +Version: 1.4.0-SNAPSHOT License: Mozilla Public License 2.0 (Inferred from project’s official repository) Homepage: https://mosip.io ================================================================================ ================================================================================ Package: MOSIP Kernel Core -Version: 1.3.0-SNAPSHOT +Version: 1.4.0-SNAPSHOT License: Mozilla Public License 2.0 (Inferred from project’s official repository) Homepage: https://mosip.io ================================================================================ ================================================================================ Package: MOSIP Kernel Logger Logback -Version: 1.3.0-SNAPSHOT +Version: 1.4.0-SNAPSHOT License: Mozilla Public License 2.0 (Inferred) Homepage: https://mosip.io ================================================================================ ================================================================================ Package: MOSIP Biometrics API -Version: 1.3.0-SNAPSHOT +Version: 1.4.0-SNAPSHOT License: Mozilla Public License 2.0 (Inferred) Homepage: https://mosip.io ================================================================================ ================================================================================ Package: MOSIP Biometrics Util -Version: 1.3.0-SNAPSHOT +Version: 1.4.0-SNAPSHOT License: Mozilla Public License 2.0 (Inferred) Homepage: https://mosip.io ================================================================================ diff --git a/kernel-biosdk-provider/THIRD-PARTY-NOTICES.txt b/kernel-biosdk-provider/THIRD-PARTY-NOTICES.txt new file mode 100644 index 0000000000..dab31da7ee --- /dev/null +++ b/kernel-biosdk-provider/THIRD-PARTY-NOTICES.txt @@ -0,0 +1,276 @@ +THIRD-PARTY-NOTICES + +This project includes third-party packages that are distributed under various open-source licenses. Below is a list of packages and their associated licenses. + +================================================================================ +Package: MOSIP Kernel BOM +Version: 1.4.0-SNAPSHOT +License: Mozilla Public License 2.0 (Inferred from project’s official repository) +Homepage: https://mosip.io +================================================================================ + +================================================================================ +Package: MOSIP Kernel Core +Version: 1.4.0-SNAPSHOT +License: Mozilla Public License 2.0 (Inferred from project’s official repository) +Homepage: https://mosip.io +================================================================================ + +================================================================================ +Package: MOSIP Kernel Logger Logback +Version: 1.4.0-SNAPSHOT +License: Mozilla Public License 2.0 (Inferred) +Homepage: https://mosip.io +================================================================================ + +================================================================================ +Package: MOSIP Biometrics API +Version: 1.4.0-SNAPSHOT +License: Mozilla Public License 2.0 (Inferred) +Homepage: https://mosip.io +================================================================================ + +================================================================================ +Package: MOSIP Biometrics Util +Version: 1.4.0-SNAPSHOT +License: Mozilla Public License 2.0 (Inferred) +Homepage: https://mosip.io +================================================================================ + +================================================================================ +Package: Spring Boot Starter Web +License: Apache License 2.0 (Inferred) +Homepage: https://spring.io/projects/spring-boot +================================================================================ + +================================================================================ +Package: Spring Boot Starter Test +License: Apache License 2.0 (Inferred) +Homepage: https://spring.io/projects/spring-boot +================================================================================ + +================================================================================ +Package: Spring Boot Starter Data JPA +License: Apache License 2.0 (Inferred) +Homepage: https://spring.io/projects/spring-data-jpa +================================================================================ + +================================================================================ +Package: Hibernate Validator +Version: Not specified +License: Apache License 2.0 (Inferred) +Homepage: https://hibernate.org/validator/ +================================================================================ + +================================================================================ +Package: Jackson Core +License: Apache License 2.0 (Inferred) +Homepage: https://github.com/FasterXML/jackson +================================================================================ + +================================================================================ +Package: Jackson Databind +License: Apache License 2.0 (Inferred) +Homepage: https://github.com/FasterXML/jackson-databind +================================================================================ + +================================================================================ +Package: Jackson Annotations +License: Apache License 2.0 (Inferred) +Homepage: https://github.com/FasterXML/jackson-annotations +================================================================================ + +================================================================================ +Package: Jackson Dataformat XML +License: Apache License 2.0 (Inferred) +Homepage: https://github.com/FasterXML/jackson-dataformat-xml +================================================================================ + +================================================================================ +Package: Jackson Dataformat CSV +License: Apache License 2.0 (Inferred) +Homepage: https://github.com/FasterXML/jackson-dataformat-csv +================================================================================ + +================================================================================ +Package: Jackson JAXB Annotations Module +License: Apache License 2.0 (Inferred) +Homepage: https://github.com/FasterXML/jackson-module-jaxb-annotations +================================================================================ + +================================================================================ +Package: SLF4J API +License: MIT License (Inferred) +Homepage: http://www.slf4j.org +================================================================================ + +================================================================================ +Package: Gson +Version: 2.8.6 +License: Apache License 2.0 +Homepage: https://github.com/google/gson +================================================================================ + +================================================================================ +Package: JNBIS (Fingerprint Image Decoder) +Version: 2.0.2 +License: Apache License 2.0 +Homepage: https://github.com/mhshams/jnbis +================================================================================ + +================================================================================ +Package: H2 Database +License: EPL 1.0 or MPL 2.0 +Homepage: https://www.h2database.com +================================================================================ + +================================================================================ +Package: Protobuf Java +Version: 3.13.0 +License: BSD-3-Clause +Homepage: https://github.com/protocolbuffers/protobuf +================================================================================ + +================================================================================ +Package: Protobuf Java +Version: 3.16.3 +License: BSD-3-Clause +Homepage: https://github.com/protocolbuffers/protobuf +================================================================================ + +================================================================================ +Package: imgscalr-lib +Version: 4.2 +License: Apache License 2.0 +Homepage: https://github.com/thebuzzmedia/imgscalr +================================================================================ + +================================================================================ +Package: JAI ImageIO JPEG2000 +Version: 1.3.0 +License: BSD-3-Clause-No-Nuclear-License +Homepage: https://github.com/jai-imageio/jai-imageio-core +================================================================================ + +================================================================================ +Package: OkHttp +Version: 2.7.5 +License: Apache License 2.0 +Homepage: https://square.github.io/okhttp/ +================================================================================ + +================================================================================ +Package: JUnit 4 +License: Eclipse Public License 1.0 (Inferred) +Homepage: https://junit.org +================================================================================ + +================================================================================ +Package: JUnit Vintage Engine +License: Eclipse Public License 2.0 (Inferred) +Homepage: https://junit.org +================================================================================ + +================================================================================ +Package: JUnit Jupiter +Version: 5.10.2 +License: Eclipse Public License 2.0 +Homepage: https://junit.org/junit5/ +================================================================================ + +================================================================================ +Package: Mockito Core +Version: 3.3.3 +License: MIT License +Homepage: https://github.com/mockito/mockito +================================================================================ + +================================================================================ +Package: Mockito Core +Version: 5.8.0 +License: MIT License +Homepage: https://github.com/mockito/mockito +================================================================================ + +================================================================================ +Package: PowerMock API Mockito2 +License: Apache License 2.0 +Homepage: https://github.com/powermock/powermock +================================================================================ + +================================================================================ +Package: PowerMock Module JUnit4 +License: Apache License 2.0 +Homepage: https://github.com/powermock/powermock +================================================================================ + +================================================================================ +Package: Apache Commons Lang3 +License: Apache License 2.0 +Homepage: https://commons.apache.org/proper/commons-lang/ +================================================================================ + +================================================================================ +Package: Apache Maven Compiler Plugin +Version: 3.11.0 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-compiler-plugin/ +================================================================================ + +================================================================================ +Package: Apache Maven GPG Plugin +Version: 1.5 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-gpg-plugin/ +================================================================================ + +================================================================================ +Package: Apache Maven GPG Plugin +Version: 3.2.3 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-gpg-plugin/ +================================================================================ + +================================================================================ +Package: Apache Maven Javadoc Plugin +Version: 3.2.0 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-javadoc-plugin/ +================================================================================ + +================================================================================ +Package: Apache Maven Surefire Plugin +Version: 2.22.0 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-surefire-plugin/ +================================================================================ + +================================================================================ +Package: Apache Maven Surefire Plugin +Version: 3.1.2 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-surefire-plugin/ +================================================================================ + +================================================================================ +Package: Apache Maven Source Plugin +Version: 3.3.1 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-source-plugin/ +================================================================================ + +================================================================================ +Package: Apache Maven JAR Plugin +Version: 3.4.0 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-jar-plugin/ +================================================================================ + +================================================================================ +Package: Apache Maven Dependency Plugin +Version: 2.10 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-dependency-plugin/ +================================================================================ + +Full license texts and additional details for each of the above packages are available in the license/ directory of this repository. Please refer to those files or the original source of each package for complete legal terms and conditions. diff --git a/kernel-biosdk-provider/pom.xml b/kernel-biosdk-provider/pom.xml index c0db95b883..16e1901589 100644 --- a/kernel-biosdk-provider/pom.xml +++ b/kernel-biosdk-provider/pom.xml @@ -5,7 +5,7 @@ kernel-biosdk-provider io.mosip.kernel - 1.2.1-SNAPSHOT + 1.4.0-SNAPSHOT kernel-biosdk-provider Implementation of biosdk provider https://github.com/mosip/bio-utils @@ -45,11 +45,10 @@ 6.0.12.Final - 1.2.1-SNAPSHOT - 1.2.1-SNAPSHOT - 1.2.1-SNAPSHOT - 1.2.1-SNAPSHOT - 1.2.1-SNAPSHOT + 1.4.0-SNAPSHOT + 1.4.0-SNAPSHOT + 1.4.0-SNAPSHOT + 1.4.0-SNAPSHOT diff --git a/kernel-cbeffutil-api/NOTICE b/kernel-cbeffutil-api/NOTICE index 86e63c9607..a11f3bbdbe 100644 --- a/kernel-cbeffutil-api/NOTICE +++ b/kernel-cbeffutil-api/NOTICE @@ -52,3 +52,4 @@ LICENSE directory. Full license texts for all third-party components are provided in the `license/` directory or may be obtained from their original sources. + diff --git a/kernel-cbeffutil-api/README.md b/kernel-cbeffutil-api/README.md index 26b064d063..be55d55dec 100644 --- a/kernel-cbeffutil-api/README.md +++ b/kernel-cbeffutil-api/README.md @@ -4,7 +4,7 @@ **Kernel CBEFF Util API** provides utilities and interfaces to handle CBEFF (Common Biometric Exchange Formats Framework) data structures. It ensures compliance with CBEFF standards for biometric data exchange within the MOSIP ecosystem. ## ✨ Features -- **CBEFF Compliance**: Utilities to create and parse CBEFF compliant data structures. +- **CBEFF Compliance**: Utilities to create and parse CBEFF-compliant data structures. - **Data Encapsulation**: Handles BIR (Biometric Information Record) construction. - **Standardization**: Ensures biometric data is exchanged in a standardized format. @@ -84,4 +84,3 @@ If you have questions or encounter issues, feel free to raise them in the [MOSIP This project is licensed under the **Mozilla Public License 2.0 (MPL 2.0)**. See the [LICENSE](../LICENSE) for full license details. - diff --git a/kernel-cbeffutil-api/THIRD-PARTY-NOTICES b/kernel-cbeffutil-api/THIRD-PARTY-NOTICES index 4bceb8fe52..a24e33b3c6 100644 --- a/kernel-cbeffutil-api/THIRD-PARTY-NOTICES +++ b/kernel-cbeffutil-api/THIRD-PARTY-NOTICES @@ -4,35 +4,35 @@ This project includes third-party packages that are distributed under various op ================================================================================ Package: MOSIP Kernel BOM -Version: 1.3.0-SNAPSHOT +Version: 1.4.0-SNAPSHOT License: Mozilla Public License 2.0 (Inferred from project’s official repository) Homepage: https://mosip.io ================================================================================ ================================================================================ Package: MOSIP Kernel Core -Version: 1.3.0-SNAPSHOT +Version: 1.4.0-SNAPSHOT License: Mozilla Public License 2.0 (Inferred from project’s official repository) Homepage: https://mosip.io ================================================================================ ================================================================================ Package: MOSIP Kernel Logger Logback -Version: 1.3.0-SNAPSHOT +Version: 1.4.0-SNAPSHOT License: Mozilla Public License 2.0 Homepage: https://mosip.io ================================================================================ ================================================================================ Package: MOSIP Biometrics API -Version: 1.3.0-SNAPSHOT +Version: 1.4.0-SNAPSHOT License: Mozilla Public License 2.0 Homepage: https://mosip.io ================================================================================ ================================================================================ Package: MOSIP Biometrics Util -Version: 1.3.0-SNAPSHOT +Version: 1.4.0-SNAPSHOT License: Mozilla Public License 2.0 Homepage: https://mosip.io ================================================================================ diff --git a/kernel-cbeffutil-api/THIRD-PARTY-NOTICES.txt b/kernel-cbeffutil-api/THIRD-PARTY-NOTICES.txt new file mode 100644 index 0000000000..a24e33b3c6 --- /dev/null +++ b/kernel-cbeffutil-api/THIRD-PARTY-NOTICES.txt @@ -0,0 +1,291 @@ +THIRD-PARTY-NOTICES + +This project includes third-party packages that are distributed under various open-source licenses. Below is a list of packages and their associated licenses. + +================================================================================ +Package: MOSIP Kernel BOM +Version: 1.4.0-SNAPSHOT +License: Mozilla Public License 2.0 (Inferred from project’s official repository) +Homepage: https://mosip.io +================================================================================ + +================================================================================ +Package: MOSIP Kernel Core +Version: 1.4.0-SNAPSHOT +License: Mozilla Public License 2.0 (Inferred from project’s official repository) +Homepage: https://mosip.io +================================================================================ + +================================================================================ +Package: MOSIP Kernel Logger Logback +Version: 1.4.0-SNAPSHOT +License: Mozilla Public License 2.0 +Homepage: https://mosip.io +================================================================================ + +================================================================================ +Package: MOSIP Biometrics API +Version: 1.4.0-SNAPSHOT +License: Mozilla Public License 2.0 +Homepage: https://mosip.io +================================================================================ + +================================================================================ +Package: MOSIP Biometrics Util +Version: 1.4.0-SNAPSHOT +License: Mozilla Public License 2.0 +Homepage: https://mosip.io +================================================================================ + +================================================================================ +Package: Spring Boot Starter Web +License: Apache License 2.0 +Homepage: https://spring.io/projects/spring-boot +================================================================================ + +================================================================================ +Package: Spring Boot Starter Test +License: Apache License 2.0 +Homepage: https://spring.io/projects/spring-boot +================================================================================ + +================================================================================ +Package: Spring Boot Starter Data JPA +License: Apache License 2.0 +Homepage: https://spring.io/projects/spring-data-jpa +================================================================================ + +================================================================================ +Package: Hibernate Validator +Version: Not specified +License: Apache License 2.0 +Homepage: https://hibernate.org/validator/ +================================================================================ + +================================================================================ +Package: Jackson Core +License: Apache License 2.0 +Homepage: https://github.com/FasterXML/jackson +================================================================================ + +================================================================================ +Package: Jackson Databind +License: Apache License 2.0 +Homepage: https://github.com/FasterXML/jackson-databind +================================================================================ + +================================================================================ +Package: Jackson Annotations +License: Apache License 2.0 +Homepage: https://github.com/FasterXML/jackson-annotations +================================================================================ + +================================================================================ +Package: Jackson Dataformat XML +License: Apache License 2.0 +Homepage: https://github.com/FasterXML/jackson-dataformat-xml +================================================================================ + +================================================================================ +Package: Jackson Dataformat CSV +License: Apache License 2.0 +Homepage: https://github.com/FasterXML/jackson-dataformat-csv +================================================================================ + +================================================================================ +Package: Jackson JAXB Annotations Module +License: Apache License 2.0 +Homepage: https://github.com/FasterXML/jackson-module-jaxb-annotations +================================================================================ + +================================================================================ +Package: SLF4J API +License: MIT License +Homepage: http://www.slf4j.org +================================================================================ + +================================================================================ +Package: Gson +Version: 2.8.6 +License: Apache License 2.0 +Homepage: https://github.com/google/gson +================================================================================ + +================================================================================ +Package: JNBIS (Fingerprint Image Decoder) +Version: 2.0.2 +License: Apache License 2.0 +Homepage: https://github.com/mhshams/jnbis +================================================================================ + +================================================================================ +Package: H2 Database +License: EPL 1.0 or MPL 2.0 +Homepage: https://www.h2database.com +================================================================================ + +================================================================================ +Package: Protobuf Java +Version: 3.13.0 +License: BSD-3-Clause +Homepage: https://github.com/protocolbuffers/protobuf +================================================================================ + +================================================================================ +Package: Protobuf Java +Version: 3.16.3 +License: BSD-3-Clause +Homepage: https://github.com/protocolbuffers/protobuf +================================================================================ + +================================================================================ +Package: imgscalr-lib +Version: 4.2 +License: Apache License 2.0 +Homepage: https://github.com/thebuzzmedia/imgscalr +================================================================================ + +================================================================================ +Package: JAI ImageIO JPEG2000 +Version: 1.3.0 +License: BSD-3-Clause with No-Nuclear Disclaimer (main code); + JJ2000 License (embedded jj2000 package) +Homepage: https://github.com/jai-imageio/jai-imageio-jpeg2000 +================================================================================ + +================================================================================ +Package: OkHttp +Version: 2.7.5 +License: Apache License 2.0 +Homepage: https://square.github.io/okhttp/ +================================================================================ + +================================================================================ +Package: JUnit 4 +License: Eclipse Public License 1.0 +Homepage: https://junit.org +================================================================================ + +================================================================================ +Package: JUnit Vintage Engine +License: Eclipse Public License 2.0 +Homepage: https://junit.org +================================================================================ + +================================================================================ +Package: JUnit Jupiter +Version: 5.10.2 +License: Eclipse Public License 2.0 +Homepage: https://junit.org/junit5/ +================================================================================ + +================================================================================ +Package: Mockito Core +Version: 3.3.3 +License: MIT License +Homepage: https://github.com/mockito/mockito +================================================================================ + +================================================================================ +Package: Mockito Core +Version: 5.8.0 +License: MIT License +Homepage: https://github.com/mockito/mockito +================================================================================ + +================================================================================ +Package: PowerMock API Mockito2 +License: Apache License 2.0 +Homepage: https://github.com/powermock/powermock +================================================================================ + +================================================================================ +Package: PowerMock Module JUnit4 +License: Apache License 2.0 +Homepage: https://github.com/powermock/powermock +================================================================================ + +================================================================================ +Package: Apache Commons Lang3 +License: Apache License 2.0 +Homepage: https://commons.apache.org/proper/commons-lang/ +================================================================================ + +================================================================================ +Package: Apache Commons IO +Version: Not specified +License: Apache License 2.0 +Homepage: https://commons.apache.org/proper/commons-io/ +================================================================================ + +================================================================================ +Package: Apache Maven Compiler Plugin +Version: 3.11.0 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-compiler-plugin/ +================================================================================ + +================================================================================ +Package: Apache Maven GPG Plugin +Version: 1.5 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-gpg-plugin/ +================================================================================ + +================================================================================ +Package: Apache Maven GPG Plugin +Version: 3.2.3 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-gpg-plugin/ +================================================================================ + +================================================================================ +Package: Apache Maven Javadoc Plugin +Version: 3.2.0 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-javadoc-plugin/ +================================================================================ + +================================================================================ +Package: Apache Maven Surefire Plugin +Version: 2.22.0 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-surefire-plugin/ +================================================================================ + +================================================================================ +Package: Apache Maven Surefire Plugin +Version: 3.1.2 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-surefire-plugin/ +================================================================================ + +================================================================================ +Package: Apache Maven Source Plugin +Version: 3.3.1 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-source-plugin/ +================================================================================ + +================================================================================ +Package: Apache Maven JAR Plugin +Version: 3.4.0 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-jar-plugin/ +================================================================================ + +================================================================================ +Package: Apache Maven Dependency Plugin +Version: 2.10 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-dependency-plugin/ +================================================================================ + +================================================================================ +Package: Git Commit ID Plugin +Version: 3.0.1 +License: Apache License 2.0 +Homepage: https://github.com/git-commit-id/git-commit-id-maven-plugin +================================================================================ + +Full license texts and additional details for each of the above packages are available in the license/ directory of this repository. Please refer to those files or the original source of each package for complete legal terms and conditions. diff --git a/kernel-cbeffutil-api/pom.xml b/kernel-cbeffutil-api/pom.xml index f728098ebb..3a0ef246e1 100644 --- a/kernel-cbeffutil-api/pom.xml +++ b/kernel-cbeffutil-api/pom.xml @@ -5,7 +5,7 @@ 4.0.0 io.mosip.kernel kernel-cbeffutil-api - 1.2.1-SNAPSHOT + 1.4.0-SNAPSHOT kernel-cbeffutil-api Biometric interface to be compliant with CBEFF standard https://github.com/mosip/bio-utils @@ -37,9 +37,9 @@ 3.0.1 - 1.2.1-SNAPSHOT - 1.2.1-SNAPSHOT - 1.2.1-SNAPSHOT + 1.4.0-SNAPSHOT + 1.4.0-SNAPSHOT + 1.4.0-SNAPSHOT 5.10.2 diff --git a/kernel-cbeffutil-api/src/test/java/io/mosip/kernel/cbeffutil/test/CbeffImplTest.java b/kernel-cbeffutil-api/src/test/java/io/mosip/kernel/cbeffutil/test/CbeffImplTest.java index d71282f5fd..e75458c4d6 100644 --- a/kernel-cbeffutil-api/src/test/java/io/mosip/kernel/cbeffutil/test/CbeffImplTest.java +++ b/kernel-cbeffutil-api/src/test/java/io/mosip/kernel/cbeffutil/test/CbeffImplTest.java @@ -6,6 +6,7 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import static org.mockito.ArgumentMatchers.any; import static org.mockito.ArgumentMatchers.eq; +import static org.mockito.ArgumentMatchers.nullable; import static org.mockito.Mockito.mockStatic; import java.io.ByteArrayOutputStream; import java.io.File; @@ -270,7 +271,8 @@ public void shouldValidateXmlWithSingleParameterReturnsTrue() throws Exception { mockStatic(io.mosip.kernel.core.cbeffutil.common.CbeffXSDValidator.class)) { byte[] xmlBytes = "test".getBytes(); - mockedValidator.when(() -> io.mosip.kernel.core.cbeffutil.common.CbeffXSDValidator.validateXML(any(), any())) + mockedValidator.when(() -> io.mosip.kernel.core.cbeffutil.common.CbeffXSDValidator.validateXML( + nullable(byte[].class), any(byte[].class))) .thenReturn(true); boolean result = cbeffUtilImpl.validateXML(xmlBytes); diff --git a/pom.xml b/pom.xml index 9c218702cf..4333c701d0 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ io.mosip.biometrics biometrics pom - 1.2.1-SNAPSHOT + 1.4.0-SNAPSHOT biometric https://github.com/mosip/bio-utils This Pom builds all the Biometric related dependencies. @@ -50,8 +50,9 @@ 0.7.0 - 1.2.1-SNAPSHOT - 1.2.1-SNAPSHOT + 1.4.0-SNAPSHOT + 1.4.0-SNAPSHOT + diff --git a/test/pom.xml b/test/pom.xml index 5ef9e9c929..c34e2ba175 100644 --- a/test/pom.xml +++ b/test/pom.xml @@ -6,7 +6,7 @@ io.mosip.bio.utils bioutils jar - 1.2.1-SNAPSHOT + 1.4.0-SNAPSHOT biometrics-util-test https://github.com/mosip/bio-utils This utility is used to Test the Biomnetric Util Repo @@ -27,7 +27,6 @@ 0.8.11 3.1.2 0.7.0 - 2.0.2.RELEASE @@ -46,9 +45,9 @@ 2.15.0 - 1.2.1-SNAPSHOT - 1.2.1-SNAPSHOT - 1.2.1-SNAPSHOT + 1.4.0-SNAPSHOT + 1.4.0-SNAPSHOT + 1.4.0-SNAPSHOT