From a432b616710fab87ee6a676eaf1cfa49f7e2ef1f Mon Sep 17 00:00:00 2001 From: kameshsr Date: Wed, 3 Jun 2026 18:18:47 +0530 Subject: [PATCH 1/6] Merge upstream mosip/demosdk v1.3.1 into develop-#1830 - Bumps kernel versions from 1.2.1-SNAPSHOT to 1.3.0 release (kernel-bom, kernel-core, kernel-logger-logback) - Fixes organizationUrl to use https:// prefix in POM - Adds THIRD-PARTY-NOTICES.txt and updates NOTICE with licensing attribution - Aligns profiles block indentation with upstream style - Cleans up ClientV1UnitTest to use imported EncoderException type Co-Authored-By: Claude Sonnet 4.6 Signed-off-by: kameshsr --- NOTICE | 1 + README.md | 69 ++++++++- THIRD-PARTY-NOTICES.txt | 128 ++++++++++++++++ demosdk/pom.xml | 138 ++++++++++++------ .../impl/spec_1_0/ClientV1UnitTest.java | 2 +- 5 files changed, 286 insertions(+), 52 deletions(-) create mode 100644 THIRD-PARTY-NOTICES.txt diff --git a/NOTICE b/NOTICE index ec3fc48..6b7fd53 100644 --- a/NOTICE +++ b/NOTICE @@ -40,3 +40,4 @@ Only components with NOTICE obligations are listed here. Full license texts for the above components are available in the `license/` directory of this repository. + diff --git a/README.md b/README.md index 19f42e5..ebc07d7 100644 --- a/README.md +++ b/README.md @@ -1,10 +1,69 @@ -[![Maven Package upon a push](https://github.com/mosip/demosdk/actions/workflows/push_trigger.yml/badge.svg?branch=release-1.2.0)](https://github.com/mosip/demosdk/actions/workflows/push_trigger.yml) -[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?branch=release-1.2.0&project=mosip_biometrics-util&id=mosip_demosdk&metric=alert_status)](https://sonarcloud.io/dashboard?id=mosip_demosdk) +# MOSIP Demo SDK -# Demo SDK +[![Maven Package upon a push](https://github.com/mosip/demosdk/actions/workflows/push-trigger.yml/badge.svg?branch=release-1.3.x)](https://github.com/mosip/demosdk/actions/workflows/push-trigger.yml) +[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure&project=mosip_demosdk&metric=alert_status)](https://sonarcloud.io/dashboard&id=mosip_demosdk) ## Overview -This library is used for demographic authentication in [ID-Authentication](https://github.com/mosip/id-authentication/tree/master/authentication). This SDK have impelmentations for demographic data match along with the name and address normilzations. + +The **Demo SDK** provides core demographic authentication capabilities used by the **ID Authentication subsystem**. +It includes: + +- Demographic data matching logic +- Name and address normalization utilities +- Support functions required for demographic authentication workflows + +This SDK is referenced by **ID-Authentication**, available here: + https://github.com/mosip/id-authentication/tree/master/authentication + +## Installation + +### Local Setup (for Development or Contribution) + +1. Clone the repository: + +```text +git clone +cd demosdk +``` + +2. Build the project: + +```text +mvn clean install -Dmaven.javadoc.skip=true -Dgpg.skip=true +``` + +This will compile the SDK and install it into your local Maven repository. + +## Usage + +It's used as a library dependency in the **ID-Authentication** project. +To include Demo SDK in your Maven project: + +```xml + + io.mosip.demosdk + demosdk + 1.3.0 + +``` + +(Replace **1.3.0** with the appropriate released version.) + +For detailed usage examples and integration steps, refer to the **ID-Authentication repository**. + +## Documentation + +Additional documentation and design references are available in the main MOSIP documentation portal: + https://github.com/mosip/documentation/tree/1.2.0/docs + +## Contribution & Community + +• To learn how you can contribute code to this application, [click here](https://docs.mosip.io/community/code-contributions). + +• If you have questions or encounter issues, visit the [MOSIP Community](https://community.mosip.io/) for support. + +• For any GitHub issues: [Report here](https://github.com/mosip/demosdk/issues) ## License -This project is licensed under the terms of [Mozilla Public License 2.0](LICENSE). + +This project is licensed under the [Mozilla Public License 2.0](LICENSE). diff --git a/THIRD-PARTY-NOTICES.txt b/THIRD-PARTY-NOTICES.txt new file mode 100644 index 0000000..8060e67 --- /dev/null +++ b/THIRD-PARTY-NOTICES.txt @@ -0,0 +1,128 @@ +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: Spring Framework +(includes: spring-web, spring-boot-test-autoconfigure, spring-security-test) +Version: Not specified in SBOM +License: Apache License 2.0 (Inferred from project’s official repository) +Homepage: https://spring.io/projects/spring-framework +================================================================================ + +================================================================================ +Package: Spring Boot Maven Plugin +Version: 3.2.3 +License: Apache License 2.0 +Homepage: https://spring.io/projects/spring-boot +================================================================================ + +================================================================================ +Package: Jackson JSON Processor +(includes: jackson-databind, jackson-module-jaxb-annotations, jackson-dataformat-xml) +Version: Not specified in SBOM +License: Apache License 2.0 (Inferred from official FasterXML repository) +Homepage: https://github.com/FasterXML/jackson +================================================================================ + +================================================================================ +Package: Google Gson +Version: Not specified in SBOM +License: Apache License 2.0 (Inferred from official project repository) +Homepage: https://github.com/google/gson +================================================================================ + +================================================================================ +Package: JSON.simple +Version: Not specified in SBOM +License: Apache License 2.0 (Inferred from official project repository) +Homepage: https://github.com/fangyidong/json-simple +================================================================================ + +================================================================================ +Package: Apache Commons Lang (commons-lang3) +Version: Not specified in SBOM +License: Apache License 2.0 +Homepage: https://commons.apache.org/proper/commons-lang/ +================================================================================ + +================================================================================ +Package: Apache Commons Codec (commons-codec) +Version: Not specified in SBOM +License: Apache License 2.0 +Homepage: https://commons.apache.org/proper/commons-codec/ +================================================================================ + +================================================================================ +Package: Apache HttpClient +Version: Not specified in SBOM +License: Apache License 2.0 +Homepage: https://hc.apache.org/httpcomponents-client-5.0.x/ +================================================================================ + +================================================================================ +Package: MOSIP Kernel Libraries +(includes: kernel-core, kernel-bom, kernel-demographics-api, kernel-logger-logback) +Version: 1.3.0-SNAPSHOT +License: Mozilla Public License 2.0 (Inferred from MOSIP official repository) +Homepage: https://github.com/mosip +================================================================================ + +================================================================================ +Package: Project Lombok +Version: Not specified in SBOM +License: MIT License +Homepage: https://projectlombok.org/ +================================================================================ + +================================================================================ +Package: JUnit 4 +Version: Not specified in SBOM +License: Eclipse Public License 1.0 (Inferred from project’s official repository) +Homepage: https://junit.org/junit4/ +================================================================================ + +================================================================================ +Package: SLF4J +(includes: jul-to-slf4j, jcl-over-slf4j) +Version: Not specified in SBOM +License: MIT License (Inferred from project’s official repository) +Homepage: http://www.slf4j.org/ +================================================================================ + +================================================================================ +Package: Maven GPG Plugin +Version: 1.5 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-gpg-plugin/ +================================================================================ + +================================================================================ +Package: Maven Source Plugin +Version: 2.2.1 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-source-plugin/ +================================================================================ + +================================================================================ +Package: Maven Javadoc Plugin +Version: 3.2.0 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-javadoc-plugin/ +================================================================================ + +================================================================================ +Package: Maven Compiler Plugin +Version: 3.8.0 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-compiler-plugin/ +================================================================================ + +================================================================================ +Package: Maven Assembly Plugin +Version: 3.3.0 +License: Apache License 2.0 +Homepage: https://maven.apache.org/plugins/maven-assembly-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/demosdk/pom.xml b/demosdk/pom.xml index 82b7824..a245aa1 100644 --- a/demosdk/pom.xml +++ b/demosdk/pom.xml @@ -13,7 +13,7 @@ demosdk io.mosip.demosdk - 1.2.1-SNAPSHOT + 1.3.1 demosdk-client Sample implementation of demo SDK client @@ -28,10 +28,10 @@ - Mosip + mosip mosip.emailnotifier@gmail.com MOSIP - www.mosip.io + https://www.mosip.io @@ -50,7 +50,7 @@ UTF-8 - 1.2.0 + 1.3.0 3.0.2 3.8.0 2.8.1 @@ -62,20 +62,15 @@ 21 0.8.11 0.7.0 + + 1.3.0 + 1.3.0 + 1.3.0 3.5.4 **/config/** **/config/** 5.3.0.6276 5.20.0 - - - - - - - 1.2.1-SNAPSHOT - 1.2.1-SNAPSHOT - 1.2.1-SNAPSHOT @@ -84,7 +79,7 @@ io.mosip.kernel kernel-bom - ${kerne-bom.version} + ${kernel-bom.version} pom import @@ -162,7 +157,12 @@ commons-codec commons-codec - + + org.mockito + mockito-core + ${mockito.core.version} + test + org.slf4j jul-to-slf4j @@ -238,6 +238,15 @@ + + + + org.springframework.boot + spring-boot-maven-plugin + 3.2.3 + + + org.apache.maven.plugins @@ -286,7 +295,44 @@ ${maven.compiler.target} + + org.apache.maven.plugins + maven-surefire-plugin + ${maven.surefire.plugin.version} + + false + false + ${jacocoArgLine} --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --enable-preview + + + + org.jacoco + jacoco-maven-plugin + ${jacoco.maven.plugin.version} + + + **/config/** + + jacocoArgLine + + + + prepare-agent + initialize + + prepare-agent + + + + report + prepare-package + + report + + + + org.apache.maven.plugins maven-gpg-plugin @@ -432,36 +478,36 @@ - - - sonar - - . - src/main/java/**,src/main/resources/** - ${sonar.coverage.exclusions} - https://sonarcloud.io - - - false - - - - - org.sonarsource.scanner.maven - sonar-maven-plugin - ${maven.sonar.plugin.version} - - - verify - - sonar - - - - + + + sonar + + . + src/main/java/**,src/main/resources/** + ${sonar.coverage.exclusions} + https://sonarcloud.io + + + false + + + + + org.sonarsource.scanner.maven + sonar-maven-plugin + ${maven.sonar.plugin.version} + + + verify + + sonar + + + + - - - - + + + + diff --git a/demosdk/src/test/java/io/mosip/demosdk/client/impl/spec_1_0/ClientV1UnitTest.java b/demosdk/src/test/java/io/mosip/demosdk/client/impl/spec_1_0/ClientV1UnitTest.java index c300331..866362d 100644 --- a/demosdk/src/test/java/io/mosip/demosdk/client/impl/spec_1_0/ClientV1UnitTest.java +++ b/demosdk/src/test/java/io/mosip/demosdk/client/impl/spec_1_0/ClientV1UnitTest.java @@ -94,7 +94,7 @@ public void testDoPhoneticsMatchCallsTextMatcherUtil() throws EncoderException { @Test public void testDoPhoneticsMatchHandlesEncoderException() throws Exception { - mockedStatic.when(() -> TextMatcherUtil.phoneticsMatch("x", "y", "en")).thenThrow(new org.apache.commons.codec.EncoderException("boom")); + mockedStatic.when(() -> TextMatcherUtil.phoneticsMatch("x", "y", "en")).thenThrow(new EncoderException("boom")); int val = client.doPhoneticsMatch("x", "y", "en", new HashMap<>()); // exception path returns default 0 assertEquals(0, val); From cabe6cd3851663e349dcde79d8ae328b108c66a0 Mon Sep 17 00:00:00 2001 From: kameshsr Date: Wed, 3 Jun 2026 18:24:46 +0530 Subject: [PATCH 2/6] corrected version Signed-off-by: kameshsr --- THIRD-PARTY-NOTICES | 2 +- THIRD-PARTY-NOTICES.txt | 2 +- demosdk/pom.xml | 10 +++++----- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/THIRD-PARTY-NOTICES b/THIRD-PARTY-NOTICES index 37b51a9..795d2a3 100644 --- a/THIRD-PARTY-NOTICES +++ b/THIRD-PARTY-NOTICES @@ -63,7 +63,7 @@ Homepage: https://hc.apache.org/httpcomponents-client-5.0.x/ ================================================================================ Package: MOSIP Kernel Libraries (includes: kernel-core, kernel-bom, kernel-demographics-api, kernel-logger-logback) -Version: 1.3.0-SNAPSHOT +Version: 1.4.0-SNAPSHOT License: Mozilla Public License 2.0 (Inferred from MOSIP official repository) Homepage: https://github.com/mosip ================================================================================ diff --git a/THIRD-PARTY-NOTICES.txt b/THIRD-PARTY-NOTICES.txt index 8060e67..4a959b9 100644 --- a/THIRD-PARTY-NOTICES.txt +++ b/THIRD-PARTY-NOTICES.txt @@ -63,7 +63,7 @@ Homepage: https://hc.apache.org/httpcomponents-client-5.0.x/ ================================================================================ Package: MOSIP Kernel Libraries (includes: kernel-core, kernel-bom, kernel-demographics-api, kernel-logger-logback) -Version: 1.3.0-SNAPSHOT +Version: 1.4.0-SNAPSHOT License: Mozilla Public License 2.0 (Inferred from MOSIP official repository) Homepage: https://github.com/mosip ================================================================================ diff --git a/demosdk/pom.xml b/demosdk/pom.xml index a245aa1..45b540f 100644 --- a/demosdk/pom.xml +++ b/demosdk/pom.xml @@ -13,7 +13,7 @@ demosdk io.mosip.demosdk - 1.3.1 + 1.4.0-SNAPSHOT demosdk-client Sample implementation of demo SDK client @@ -50,7 +50,7 @@ UTF-8 - 1.3.0 + 1.4.0-SNAPSHOT 3.0.2 3.8.0 2.8.1 @@ -63,9 +63,9 @@ 0.8.11 0.7.0 - 1.3.0 - 1.3.0 - 1.3.0 + 1.4.0-SNAPSHOT + 1.4.0-SNAPSHOT + 1.4.0-SNAPSHOT 3.5.4 **/config/** **/config/** From 661d1964130c7307fbecf71123b3962f0c7f6096 Mon Sep 17 00:00:00 2001 From: kameshsr Date: Wed, 3 Jun 2026 18:30:25 +0530 Subject: [PATCH 3/6] Fix pom.xml: remove duplicate plugin and dependency declarations Remove duplicate declarations introduced during merge conflict resolution: - Remove duplicate mockito-core dependency - Remove duplicate maven-surefire-plugin - Remove duplicate jacoco-maven-plugin Also clean up whitespace and trailing comments in build section. Co-Authored-By: Claude Sonnet 4.6 Signed-off-by: kameshsr --- demosdk/pom.xml | 313 +++++++++++++++++++----------------------------- 1 file changed, 121 insertions(+), 192 deletions(-) diff --git a/demosdk/pom.xml b/demosdk/pom.xml index 45b540f..a704553 100644 --- a/demosdk/pom.xml +++ b/demosdk/pom.xml @@ -66,14 +66,14 @@ 1.4.0-SNAPSHOT 1.4.0-SNAPSHOT 1.4.0-SNAPSHOT - 3.5.4 - **/config/** - **/config/** - 5.3.0.6276 - 5.20.0 - + 3.5.4 + **/config/** + **/config/** + 5.3.0.6276 + 5.20.0 + - + @@ -94,9 +94,7 @@ org.springframework.boot - - spring-boot-starter-security - + spring-boot-starter-security com.fasterxml.jackson.core @@ -138,7 +136,7 @@ org.springframework spring-web - + org.projectlombok @@ -146,23 +144,16 @@ provided - org.apache.commons commons-lang3 - commons-codec commons-codec - - org.mockito - mockito-core - ${mockito.core.version} - test - + org.slf4j jul-to-slf4j @@ -177,7 +168,7 @@ httpclient - + com.googlecode.json-simple json-simple @@ -195,19 +186,19 @@ org.springframework.boot - spring-boot-test-autoconfigure + spring-boot-test-autoconfigure junit junit test - - org.mockito - mockito-core - ${mockito.core.version} - test - + + org.mockito + mockito-core + ${mockito.core.version} + test + io.mosip.kernel kernel-core @@ -248,44 +239,43 @@ - - org.apache.maven.plugins - maven-surefire-plugin - ${maven.surefire.plugin.version} - - false - false - ${jacocoArgLine} --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --enable-preview - - - - org.jacoco - jacoco-maven-plugin - ${jacoco.maven.plugin.version} - - - - **/config/** - - jacocoArgLine - - - - prepare-agent - initialize - - prepare-agent - - - - report - prepare-package - - report - - - - + + org.apache.maven.plugins + maven-surefire-plugin + ${maven.surefire.plugin.version} + + false + false + ${jacocoArgLine} --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --enable-preview + + + + org.jacoco + jacoco-maven-plugin + ${jacoco.maven.plugin.version} + + + **/config/** + + jacocoArgLine + + + + prepare-agent + initialize + + prepare-agent + + + + report + prepare-package + + report + + + + org.apache.maven.plugins maven-compiler-plugin @@ -295,77 +285,39 @@ ${maven.compiler.target} - - org.apache.maven.plugins - maven-surefire-plugin - ${maven.surefire.plugin.version} - - false - false - ${jacocoArgLine} --add-opens java.xml/jdk.xml.internal=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED --add-opens java.base/java.io=ALL-UNNAMED --enable-preview - - - - org.jacoco - jacoco-maven-plugin - ${jacoco.maven.plugin.version} - - - - **/config/** - - jacocoArgLine - - - - prepare-agent - initialize - - prepare-agent - - - - report - prepare-package - - report - - - - - - org.apache.maven.plugins - maven-gpg-plugin - 1.5 - - - sign-artifacts - verify - - sign - - - - --pinentry-mode - loopback - - - - - - - org.apache.maven.plugins - maven-source-plugin - 2.2.1 - - - attach-sources - - jar-no-fork - - - - + + org.apache.maven.plugins + maven-gpg-plugin + 1.5 + + + sign-artifacts + verify + + sign + + + + --pinentry-mode + loopback + + + + + + + org.apache.maven.plugins + maven-source-plugin + 2.2.1 + + + attach-sources + + jar-no-fork + + + + maven-deploy-plugin ${maven.deploy.version} @@ -405,27 +357,6 @@ none - - - - - - - - - - - - - - - - - - - - - pl.project13.maven git-commit-id-plugin @@ -448,7 +379,6 @@ full ${project.basedir}/.git - @@ -467,47 +397,46 @@ - make-assembly - package + make-assembly + package single - - - - sonar - - . - src/main/java/**,src/main/resources/** - ${sonar.coverage.exclusions} - https://sonarcloud.io - - - false - - - - - org.sonarsource.scanner.maven - sonar-maven-plugin - ${maven.sonar.plugin.version} - - - verify - - sonar - - - - - - - - + + + sonar + + . + src/main/java/**,src/main/resources/** + ${sonar.coverage.exclusions} + https://sonarcloud.io + + + false + + + + + org.sonarsource.scanner.maven + sonar-maven-plugin + ${maven.sonar.plugin.version} + + + verify + + sonar + + + + + + + + From 134c767a111394c1b230ded47a258ba519e75797 Mon Sep 17 00:00:00 2001 From: kameshsr Date: Wed, 3 Jun 2026 18:43:47 +0530 Subject: [PATCH 4/6] Fix snapshot repository URL: remove trailing slash Trailing slash in snapshotRepository URL causes Maven to construct double-slash artifact paths (e.g. /maven-snapshots//io/mosip/...) resulting in 403 responses. Aligns with bio-utils pom.xml convention. Co-Authored-By: Claude Sonnet 4.6 Signed-off-by: kameshsr --- demosdk/pom.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/demosdk/pom.xml b/demosdk/pom.xml index a704553..97743f6 100644 --- a/demosdk/pom.xml +++ b/demosdk/pom.xml @@ -38,7 +38,7 @@ ossrh - https://central.sonatype.com/repository/maven-snapshots/ + https://central.sonatype.com/repository/maven-snapshots ossrh @@ -50,7 +50,7 @@ UTF-8 - 1.4.0-SNAPSHOT + 1.3.0 3.0.2 3.8.0 2.8.1 @@ -63,9 +63,9 @@ 0.8.11 0.7.0 - 1.4.0-SNAPSHOT - 1.4.0-SNAPSHOT - 1.4.0-SNAPSHOT + 1.3.0 + 1.3.0 + 1.3.0 3.5.4 **/config/** **/config/** From 5ac221cbd35ab754c5909f6fe008d95893e8164d Mon Sep 17 00:00:00 2001 From: kameshsr Date: Wed, 3 Jun 2026 18:48:28 +0530 Subject: [PATCH 5/6] Added agents.md Signed-off-by: kameshsr --- AGENTS.md | 91 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 91 insertions(+) create mode 100644 AGENTS.md diff --git a/AGENTS.md b/AGENTS.md new file mode 100644 index 0000000..16fae4f --- /dev/null +++ b/AGENTS.md @@ -0,0 +1,91 @@ +# AGENTS.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Project Overview + +MOSIP Demo SDK is a Java library implementing demographic authentication for the [MOSIP ID-Authentication](https://github.com/mosip/id-authentication) subsystem. It is consumed as a Maven dependency — it has no runnable entry point of its own. + +The SDK implements two interfaces from `kernel-demographics-api`: +- `IDemoApi` — demographic data matching (exact, partial, phonetic) +- `IDemoNormalizer` — name and address string normalization driven by Spring Environment properties + +## Build Commands + +All commands run from the `demosdk/` subdirectory (where `pom.xml` lives): + +```bash +# Build and install to local Maven repo (skip GPG signing and Javadoc for local dev) +mvn clean install -Dmaven.javadoc.skip=true -Dgpg.skip=true + +# Run all tests +mvn test + +# Run a single test class +mvn test -Dtest=ClientV1UnitTest +mvn test -Dtest=NormalizerV1UnitTest +mvn test -Dtest=TextMatcherUtilTest + +# Run Sonar analysis (requires sonar credentials) +mvn verify -Psonar +``` + +The surefire plugin passes `--enable-preview` and several `--add-opens` flags automatically — no extra JVM args are needed when running tests through Maven. + +## Architecture + +``` +demosdk/src/main/java/io/mosip/demosdk/client/ +├── impl/spec_1_0/ +│ ├── Client_V_1_0.java # IDemoApi implementation +│ └── Normalizer_V_1_0.java # IDemoNormalizer implementation +├── utils/ +│ └── TextMatcherUtil.java # Phonetic matching (BeiderMorse + Soundex) +└── config/ + └── LoggerConfig.java # MOSIP rolling-file logger setup +``` + +### Matching Logic (`Client_V_1_0`) + +All three match methods return an integer 0–100: + +- **Exact match**: tokenizes both strings by whitespace (lowercased), returns 100 only if token sets are equal (order-insensitive). +- **Partial match**: `matchedTokens * 100 / (entityTokenCount + unmatchedRefTokenCount)`. Single-character ref tokens may match any entity token that starts with that character. +- **Phonetic match**: delegates to `TextMatcherUtil.phoneticsMatch`, which encodes both strings with Apache BeiderMorse (`PhoneticEngine`) then scores the Soundex difference: `(soundexDifference + 1) * 20` → range 20–100. + +### Normalization (`Normalizer_V_1_0`) + +Patterns are loaded lazily from Spring `Environment` properties using the key template: + +``` +ida.demo..normalization.regex.[] +``` + +where `type` is `name`, `address`, or `common`; `language` is the BCP 47 tag or `any`. Each value is `=` (separator configurable via `ida.norm.sep`, default `=`). Indices are iterated 0–999 and stop at the first missing key. + +`normalizeName` additionally strips title prefixes (e.g., "Mr", "Dr") supplied by the caller before applying regex patterns. `normalizeWithCommonAttributes` always merges patterns for the specific language + `any` + `common/` + `common/any`. + +### Testing Patterns + +Tests use JUnit 4 + Mockito 5. Because `Normalizer_V_1_0.environment` is `@Autowired` (private field), tests inject a mocked `Environment` via reflection — see `NormalizerV1UnitTest.setUp()`. Static methods in `TextMatcherUtil` are mocked with `mockStatic` from Mockito's `MockedStatic` API. + +## Key Dependencies + +| Artifact | Purpose | +|---|---| +| `kernel-demographics-api:1.3.0` | `IDemoApi` and `IDemoNormalizer` interfaces | +| `kernel-logger-logback:1.3.0` | MOSIP Logback wrapper (`Logfactory`) | +| `commons-codec` | Soundex and BeiderMorse phonetic encoding | +| `spring-web` / `spring-core` | `Environment` injection in normalizer | +| `jackson-databind`, `jackson-dataformat-xml` | JSON/XML support pulled in transitively | + +## Configuration Properties + +The normalizer reads from whatever Spring `Environment` is active (typically `id-authentication-default.properties` in the consuming service). Relevant property keys: + +- `ida.demo..normalization.regex.[]` — normalization pattern at index `n` +- `ida.norm.sep` — separator between regex and replacement (default `=`) + +## Release / Publishing + +Artifacts are signed with GPG (key in `.github/keys/`) and published to Maven Central via `central-publishing-maven-plugin`. The `autoPublish` flag is `false`, so promotion to release must be done manually in the Sonatype portal. Snapshot builds go to `https://central.sonatype.com/repository/maven-snapshots`. \ No newline at end of file From 414652db70040d1ab6d40e987c1c4b2f8482ebee Mon Sep 17 00:00:00 2001 From: kameshsr Date: Wed, 3 Jun 2026 18:55:25 +0530 Subject: [PATCH 6/6] corrected version Signed-off-by: kameshsr --- README.md | 2 +- demosdk/pom.xml | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index ebc07d7..161d670 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # MOSIP Demo SDK -[![Maven Package upon a push](https://github.com/mosip/demosdk/actions/workflows/push-trigger.yml/badge.svg?branch=release-1.3.x)](https://github.com/mosip/demosdk/actions/workflows/push-trigger.yml) +[![Maven Package upon a push](https://github.com/mosip/demosdk/actions/workflows/push-trigger.yml/badge.svg?branch=develop)](https://github.com/mosip/demosdk/actions/workflows/push-trigger.yml) [![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure&project=mosip_demosdk&metric=alert_status)](https://sonarcloud.io/dashboard&id=mosip_demosdk) ## Overview diff --git a/demosdk/pom.xml b/demosdk/pom.xml index 97743f6..3c8b161 100644 --- a/demosdk/pom.xml +++ b/demosdk/pom.xml @@ -50,7 +50,7 @@ UTF-8 - 1.3.0 + 1.3.0-SNAPSHOT 3.0.2 3.8.0 2.8.1 @@ -63,9 +63,9 @@ 0.8.11 0.7.0 - 1.3.0 - 1.3.0 - 1.3.0 + 1.4.0-SNAPSHOT + 1.4.0-SNAPSHOT + 1.4.0-SNAPSHOT 3.5.4 **/config/** **/config/**