Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
af3b772
Updated Pom versions for release changes
Prafulrakhade Jul 31, 2024
6a05c0f
Updated Pom versions for release changes (#141)
ckm007 Jul 31, 2024
3711bbb
[MOSIP-36412]Update pom.xml (#152)
JanardhanBS-SyncByte Oct 21, 2024
a8de854
Update Dockerfile
GOKULRAJ136 Nov 12, 2024
1a529cc
Updated chart versions, image and tag for release changes
Prafulrakhade Dec 4, 2024
2abc5cf
[DSD-6825] platform 1.2.1.0-beta-1 release (#161)
ckm007 Dec 10, 2024
b99bc08
Updated chart versions, image and tag for release changes (#162)
ckm007 Dec 10, 2024
2ce8e8b
MOSIP-40694 changed version to snaphsot (#174)
kameshsr Mar 17, 2025
0270efe
[MOSIP-42464] [MOSIP-41674] central sonatype migration changes
Prafulrakhade Aug 4, 2025
77e7633
cherry-pick the changes from develop
ckm007 Nov 15, 2025
37f2fe3
Updated tag version
dhanendra06 Nov 16, 2025
4a3d17a
Update THIRD-PARTY-NOTICES with new packages and licenses(biosdk-serv…
Rakshithasai123 Nov 26, 2025
8e34681
fix cpu & memory
kaledOu Nov 28, 2025
eb85494
Create Apache-2.0.txt
Rakshithasai123 Dec 1, 2025
8aa8d71
Create NOTICES.txt
rajapandi1234 Dec 2, 2025
d5a5c43
Update THIRD-PARTY-NOTICES.txt
Rakshithasai123 Dec 3, 2025
cc89444
Update THIRD-PARTY-NOTICES.txt
Rakshithasai123 Dec 3, 2025
85ca439
Update THIRD-PARTY-NOTICES.txt
Rakshithasai123 Dec 3, 2025
f1acf53
Create NOTICES.txt
Rakshithasai123 Dec 6, 2025
7b5e365
Rename NOTICES.txt to NOTICE
Rakshithasai123 Dec 9, 2025
a22eadd
Rename NOTICES.txt to NOTICE
rajapandi1234 Dec 9, 2025
cd1a504
Update Apache-2.0.txt
Rakshithasai123 Dec 11, 2025
ed687c3
Update THIRD-PARTY-NOTICES.txt
Rakshithasai123 Dec 12, 2025
0c6c97a
[MOSIP-44020] Increase code coverage for biosdk-services in develop (…
NidhiKumari0201 Dec 11, 2025
9e08893
[MOSIP-44020] camel case corrected
NidhiKumari0201 Dec 12, 2025
541dc7e
Update THIRD-PARTY-NOTICES.txt
Rakshithasai123 Dec 15, 2025
fd787e3
Update THIRD-PARTY-NOTICES.txt
Rakshithasai123 Dec 15, 2025
feead2e
Update NOTICE
Rakshithasai123 Dec 15, 2025
01ece68
Update NOTICE
rajapandi1234 Dec 15, 2025
3c15c24
Update NOTICE
Rakshithasai123 Dec 15, 2025
2c0885f
Update NOTICE
Rakshithasai123 Dec 15, 2025
d276604
[DSD-9524] Release Platform 1.2.1.0 GA (#201)
ckm007 Dec 20, 2025
17fd0dc
Updated chart versions, image and tag for release changes (#202)
ckm007 Dec 20, 2025
d4a7872
Perform optimization for JVM argument [MOSIP-44752]
GOKULRAJ136 Apr 1, 2026
4569f2a
Updated commons versions in pom
GOKULRAJ136 Apr 3, 2026
322e82c
Update Dockerfile
GOKULRAJ136 Apr 6, 2026
eeea973
Perform optimization for JVM argument [MOSIP-44752]
GOKULRAJ136 Apr 7, 2026
36beec6
Update values.yaml
GOKULRAJ136 Apr 7, 2026
1971e36
Update values.yaml
GOKULRAJ136 Apr 7, 2026
69eeffe
MOSIP-37901 - Exclude MOSIP services from being published or released…
NidhiKumari0201 Apr 20, 2026
d3417e8
MOSIP-37901 - revert pom changes Exclude MOSIP services from being pu…
NidhiKumari0201 Apr 20, 2026
522141b
[DSD-10347] 1.3.1 Packet Processing Performance Tuning release (#217)
ckm007 Jun 1, 2026
46e808f
#1830 corrected version
kameshsr Jun 4, 2026
fd30548
#1830 added agents.md
kameshsr Jun 4, 2026
79be6f9
#1830 Corrected agents.md
kameshsr Jun 4, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
# AGENTS.md

This file provides guidance to AI agents when working with code in this repository.
## Project Overview

`biosdk-services` is a Spring Boot REST service that wraps MOSIP's `IBioApiV2` biometric SDK interface and exposes it over HTTP. It is used by the MOSIP registration processor to perform biometric operations (match, segment, extract, quality check, format convert). The service loads a third-party SDK JAR at startup via `-Dloader.path` and `-Dbiosdk_bioapi_impl`, so the actual biometric logic lives outside this repo.

## Build & Run

All Maven commands must be run from `biosdk-services/` (the inner module directory), not the repo root.

```bash
# Build (skip GPG signing for local dev)
cd biosdk-services
mvn clean install -Dgpg.skip=true

# Run tests only
mvn test

# Run a single test class
mvn test -Dtest=MainControllerTest

# Run with mock SDK (after build)
java -Dloader.path=mock-sdk-1.4.0-SNAPSHOT-jar-with-dependencies.jar \
-Dbiosdk_bioapi_impl=io.mosip.mock.sdk.impl.SampleSDKV2 \
--add-modules=ALL-SYSTEM \
--add-opens java.xml/jdk.xml.internal=ALL-UNNAMED \
--add-opens java.base/java.lang.reflect=ALL-UNNAMED \
--add-opens java.base/java.lang.stream=ALL-UNNAMED \
--add-opens java.base/java.time=ALL-UNNAMED \
--add-opens java.base/java.time.LocalDate=ALL-UNNAMED \
--add-opens java.base/java.time.LocalDateTime=ALL-UNNAMED \
--add-opens java.base/java.time.LocalDateTime.date=ALL-UNNAMED \
-jar target/biosdk-services-1.4.0-SNAPSHOT.jar
```

The `run_local.bat` script captures the full run command for Windows. Health check: `http://localhost:9099/biosdk-service/`. Swagger UI: `http://localhost:9099/biosdk-service/swagger-ui.html`.

## Key Configuration

- **`biosdk_bioapi_impl`** — fully qualified class name of the `IBioApiV2` implementation to load. Required at startup; must be on the `-Dloader.path`.
- **`spring.cloud.config.enabled`** — set to `false` (via `application-local.properties`) for local development without a config server.
- Config server integration: `bootstrap.properties` points at `http://localhost:51000/config`; remote config files live in [mosip-config](https://github.com/mosip/mosip-config/tree/master) (`application-default.properties`, `biosdk-service-default.properties`).
- Java 21 with `--enable-preview` is required. The compiler and surefire plugin both pass `--enable-preview`.

## Architecture

```
MainController ← single REST controller, all /biosdk-service/* endpoints
└─ BioSdkServiceFactory ← selects BioSdkServiceProvider by request.version
└─ BioSdkServiceProvider (SPI interface)
└─ BioSdkServiceProviderImpl_V_1_0 ← current only implementation (spec "1.0")
└─ IBioApiV2 ← loaded dynamically at startup by BioSdkLibConfig
```

**Request flow**: Every endpoint receives a `RequestDto` (wrapper with `version` + base64-encoded `request` payload). `MainController` asks the factory for the matching `BioSdkServiceProvider` by version string, then delegates. `BioSdkServiceProviderImpl_V_1_0` deserializes the inner request DTO, calls `IBioApiV2`, and returns the result wrapped in `ResponseDto`.

**SDK loading** (`BioSdkLibConfig`): At startup, `@PostConstruct` validates the class name from `biosdk_bioapi_impl`. The `IBioApiV2` bean is created lazily via reflection using that class name; it must exist on the Spring Boot loader path (`-Dloader.path`).

**Versioning**: The factory pattern in `BioSdkServiceFactory` is designed to support multiple spec versions. Adding a new version means implementing `BioSdkServiceProvider`, annotating it `@Component`, and setting `getSpecVersion()` accordingly — Spring will auto-inject it into the factory's list.

## API Endpoints

All endpoints are under `/biosdk-service/` (context path). All POST endpoints consume and produce `application/json`. The request body is always `RequestDto` with a `version` field and a base64-encoded `request` field.

| Path | Method | Operation |
|---|---|---|
| `/` | GET | Health check |
| `/init` | POST | SDK initialization |
| `/match` | POST | Biometric 1:N matching |
| `/check-quality` | POST | Quality assessment |
| `/extract-template` | POST | Feature extraction |
| `/segment` | POST | Biometric segmentation |
| `/convert-format` | POST | ISO to JPEG/PNG conversion |

## Sonar / Code Coverage

Sonar exclusions are configured for `dto/`, `config/`, `constants/`, and `Status/` packages. Run with the `sonar` Maven profile: `mvn verify -Psonar`.
8 changes: 4 additions & 4 deletions THIRD-PARTY-NOTICES
Original file line number Diff line number Diff line change
Expand Up @@ -62,31 +62,31 @@ Homepage: https://github.com/eclipse-ee4j/servlet-api
================================================================================
Package: MOSIP Kernel Core
Name: io.mosip.kernel:kernel-core
Version: 1.3.0-SNAPSHOT
Version: 1.4.0-SNAPSHOT
License: MPL-2.0 (Inferred from MOSIP repo)
Homepage: https://mosip.io
================================================================================

================================================================================
Package: MOSIP Kernel BOM
Name: io.mosip.kernel:kernel-bom
Version: 1.3.0-SNAPSHOT
Version: 1.4.0-SNAPSHOT
License: MPL-2.0 (Inferred)
Homepage: https://mosip.io
================================================================================

================================================================================
Package: MOSIP Kernel Logger (Logback)
Name: io.mosip.kernel:kernel-logger-logback
Version: 1.3.0-SNAPSHOT
Version: 1.4.0-SNAPSHOT
License: MPL-2.0 (Inferred)
Homepage: https://mosip.io
================================================================================

================================================================================
Package: MOSIP Biometrics API
Name: io.mosip.kernel:kernel-biometrics-api
Version: 1.3.0-SNAPSHOT
Version: 1.4.0-SNAPSHOT
License: MPL-2.0 (Inferred)
Homepage: https://mosip.io
================================================================================
Expand Down
217 changes: 217 additions & 0 deletions THIRD-PARTY-NOTICES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,217 @@
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/kattu – GitHub Actions Workflow: tag.yml
Version: master
License: CC0-1.0 (Creative Commons Zero v1.0 Universal)
Homepage: https://github.com/mosip/kattu
================================================================================

================================================================================
Package: mosip/kattu – GitHub Actions Workflow: chart-lint-publish.yml
Version: master
License: CC0-1.0 (Creative Commons Zero v1.0 Universal)
Homepage: https://github.com/mosip/kattu
================================================================================

================================================================================
Package: mosip/kattu – GitHub Actions Workflow: maven-build.yml
Version: master-java21
License: CC0-1.0 (Creative Commons Zero v1.0 Universal)
Homepage: https://github.com/mosip/kattu
================================================================================

================================================================================
Package: mosip/kattu – GitHub Actions Workflow: maven-publish-to-nexus.yml
Version: master-java21
License: CC0-1.0 (Creative Commons Zero v1.0 Universal)
Homepage: https://github.com/mosip/kattu
================================================================================

================================================================================
Package: mosip/kattu – GitHub Actions Workflow: maven-sonar-analysis.yml
Version: master-java21
License: CC0-1.0 (Creative Commons Zero v1.0 Universal)
Homepage: https://github.com/mosip/kattu
================================================================================

================================================================================
Package: mosip/kattu – GitHub Actions Workflow: docker-build.yml
Version: master-java21
License: CC0-1.0 (Creative Commons Zero v1.0 Universal)
Homepage: https://github.com/mosip/kattu
================================================================================

================================================================================
Package: mosip/kattu – GitHub Actions Workflow: release-changes.yml
Version: master
License: CC0-1.0 (Creative Commons Zero v1.0 Universal)
Homepage: https://github.com/mosip/kattu
================================================================================

================================================================================
Package: Java Servlet API
Name: javax.servlet:javax.servlet-api
Version: Not specified
License: CDDL 1.1
Homepage: https://github.com/eclipse-ee4j/servlet-api
================================================================================

================================================================================
Package: MOSIP Kernel Core
Name: io.mosip.kernel:kernel-core
Version: 1.4.0-SNAPSHOT
License: MPL-2.0 (Inferred from MOSIP repo)
Homepage: https://mosip.io
================================================================================

================================================================================
Package: MOSIP Kernel BOM
Name: io.mosip.kernel:kernel-bom
Version: 1.4.0-SNAPSHOT
License: MPL-2.0 (Inferred)
Homepage: https://mosip.io
================================================================================

================================================================================
Package: MOSIP Kernel Logger (Logback)
Name: io.mosip.kernel:kernel-logger-logback
Version: 1.4.0-SNAPSHOT
License: MPL-2.0 (Inferred)
Homepage: https://mosip.io
================================================================================

================================================================================
Package: MOSIP Biometrics API
Name: io.mosip.kernel:kernel-biometrics-api
Version: 1.4.0-SNAPSHOT
License: MPL-2.0 (Inferred)
Homepage: https://mosip.io
================================================================================

================================================================================
Package: Spring Boot Starter Actuator
Name: org.springframework.boot:spring-boot-starter-actuator
Version: Not specified
License: Apache License 2.0 (Inferred)
Homepage: https://spring.io/projects/spring-boot
================================================================================

================================================================================
Package: Spring Boot Starter Web
Name: org.springframework.boot:spring-boot-starter-web
Version: Not specified
License: Apache License 2.0
Homepage: https://spring.io/projects/spring-boot
================================================================================

================================================================================
Package: Spring Boot Maven Plugin
Name: org.springframework.boot:spring-boot-maven-plugin
Version: 3.2.3
License: Apache License 2.0
Homepage: https://spring.io/projects/spring-boot
================================================================================

================================================================================
Package: Spring Data Commons
Name: org.springframework.data:spring-data-commons
Version: Not specified
License: Apache License 2.0 (Inferred)
Homepage: https://spring.io/projects/spring-data
================================================================================

================================================================================
Package: SpringDoc OpenAPI WebMVC UI
Name: org.springdoc:springdoc-openapi-starter-webmvc-ui
Version: 2.5.0
License: Apache License 2.0
Homepage: https://springdoc.org
================================================================================

================================================================================
Package: Jackson Dataformat XML
Name: com.fasterxml.jackson.dataformat:jackson-dataformat-xml
Version: Not specified
License: Apache License 2.0 (Inferred)
Homepage: https://github.com/FasterXML/jackson-dataformat-xml
================================================================================

================================================================================
Package: Jakarta Transaction API
Name: jakarta.transaction:jakarta.transaction-api
Version: Not specified
License: EPL 2.0
Homepage: https://github.com/eclipse-ee4j/jta-api
================================================================================

================================================================================
Package: JSON-Simple
Name: com.googlecode.json-simple:json-simple
Version: Not specified
License: Apache License 2.0 (Inferred)
Homepage: https://github.com/fangyidong/json-simple
================================================================================

================================================================================
Package: Gson
Name: com.google.code.gson:gson
Version: Not specified
License: Apache License 2.0
Homepage: https://github.com/google/gson
================================================================================

================================================================================
Package: Lombok
Name: org.projectlombok:lombok
Version: Not specified
License: MIT License
Homepage: https://projectlombok.org
================================================================================

================================================================================
Package: Apache Maven Compiler Plugin
Version: 3.11.0
License: Apache License 2.0
Homepage: https://maven.apache.org/plugins
================================================================================

================================================================================
Package: Apache Maven Surefire Plugin
Version: 3.1.2
License: Apache License 2.0
Homepage: https://maven.apache.org/plugins
================================================================================

================================================================================
Package: Apache Maven Source Plugin
Version: 3.3.1
License: Apache License 2.0
Homepage: https://maven.apache.org/plugins
================================================================================

================================================================================
Package: Apache Maven Javadoc Plugin
Version: 3.2.0
License: Apache License 2.0
Homepage: https://maven.apache.org/plugins
================================================================================

================================================================================
Package: Apache Maven GPG Plugin
Version: 3.2.3
License: Apache License 2.0
Homepage: https://maven.apache.org/plugins
================================================================================

================================================================================
Package: JUnit Vintage Engine
Name: org.junit.vintage:junit-vintage-engine
Version: Not specified
License: Eclipse Public License 2.0
Homepage: https://junit.org
================================================================================

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.
8 changes: 4 additions & 4 deletions biosdk-services/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM mosipdev/openjdk-21-jre:latest
FROM mosipid/openjdk-21-jre:21.0.4

# label to be assigned along with Docker build [Mandatory]
ARG SOURCE
Expand Down Expand Up @@ -93,7 +93,8 @@ ADD ./target/biosdk-services-*.jar biosdk-services.jar
RUN chmod +x /home/${container_user}/configure_biosdk.sh \
&& chmod a-w /home/${container_user}/configure_biosdk.sh \
&& chmod 775 biosdk-services.jar \
&& chown -R ${container_user}:${container_user} /home/${container_user}
&& chown -R ${container_user}:${container_user} /home/${container_user} \
&& chmod +x configure_biosdk.sh

# select container user for all tasks
USER ${container_user_uid}:${container_user_gid}
Expand All @@ -102,5 +103,4 @@ EXPOSE 9099

ENTRYPOINT ["./configure_biosdk.sh"]

CMD echo $biosdk_bioapi_impl ; \
java -XX:-UseG1GC -XX:-UseParallelGC -XX:-UseShenandoahGC -XX:+ExplicitGCInvokesConcurrent -XX:+UseZGC -XX:+ZGenerational -XX:+UnlockExperimentalVMOptions -XX:+UseStringDeduplication -XX:+HeapDumpOnOutOfMemoryError -XX:+UseCompressedOops -XX:MaxGCPauseMillis=200 -Dfile.encoding=UTF-8 -Dloader.path="${loader_path_env}" -Dserver.servlet.context-path="${server_servlet_context_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dspring.application.name="${spring_application_name_env}" -Dspring.cloud.config.name="${spring_cloud_config_name_env}" --add-modules=ALL-SYSTEM --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang.stream=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/java.time.LocalDate=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime.date=ALL-UNNAMED --add-opens java.base/jdk.internal.reflect.DirectMethodHandleAccessor=ALL-UNNAMED -jar biosdk-services.jar
CMD java -Dloader.path="${loader_path_env}" -Dserver.servlet.context-path="${server_servlet_context_path_env}" -Dspring.cloud.config.label="${spring_config_label_env}" -Dspring.profiles.active="${active_profile_env}" -Dspring.cloud.config.uri="${spring_config_url_env}" -Dspring.application.name="${spring_application_name_env}" -Dspring.cloud.config.name="${spring_cloud_config_name_env}" --add-modules=ALL-SYSTEM --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang.stream=ALL-UNNAMED --add-opens java.base/java.time=ALL-UNNAMED --add-opens java.base/java.time.LocalDate=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime=ALL-UNNAMED --add-opens java.base/java.time.LocalDateTime.date=ALL-UNNAMED --add-opens java.base/jdk.internal.reflect.DirectMethodHandleAccessor=ALL-UNNAMED -jar biosdk-services.jar
Loading
Loading