Skip to content

[ES-2944] New map entry for resetPasswordChallengeFileds#189

Closed
KashiwalHarsh wants to merge 3 commits intomosip:developfrom
Infosys:ES-2944
Closed

[ES-2944] New map entry for resetPasswordChallengeFileds#189
KashiwalHarsh wants to merge 3 commits intomosip:developfrom
Infosys:ES-2944

Conversation

@KashiwalHarsh
Copy link

@KashiwalHarsh KashiwalHarsh commented Mar 10, 2026

Summary by CodeRabbit

  • New Features
    • Password reset now supports configurable challenge fields, which are shown dynamically in the UI for customizable verification.
  • Bug Fixes
    • Password reset handles absence of challenge fields gracefully to avoid errors or broken UI.
    • Fixed a configuration typo in the backend properties to ensure endpoint parsing works correctly.

Signed-off-by: Harsh Kashiwal <harsh.kashiwal@infosys.com>
@coderabbitai
Copy link

coderabbitai bot commented Mar 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 4f970bad-9526-4178-8a08-2e7e0927b639

📥 Commits

Reviewing files that changed from the base of the PR and between 155ffdc and 5daf84f.

📒 Files selected for processing (1)
  • mosip-identity-plugin/src/main/resources/application.properties
✅ Files skipped from review due to trivial changes (1)
  • mosip-identity-plugin/src/main/resources/application.properties

Walkthrough

Added extraction and wiring of resetPasswordChallengeFields into IdrepoProfileRegistryPluginImpl: new JSON-path config field, a parser method with error handling, and inclusion of the parsed value in the UI specification output; also fixed a stray quote in application.properties endpoint value.

Changes

Cohort / File(s) Summary
Password Reset UI-Spec Enhancement
mosip-identity-plugin/src/main/java/io/mosip/signup/plugin/mosipid/service/IdrepoProfileRegistryPluginImpl.java
Added private String resetPasswordChallengeFieldsJsonpath (@Value), implemented private Object readResetPasswordChallengeFields(String responseJson) to parse resetPasswordChallengeFields from the UI-spec response with error handling and logging, and included the extracted value in getUISpecification output.
Configuration Fix
mosip-identity-plugin/src/main/resources/application.properties
Removed an extraneous trailing double-quote from mosip.signup.mosipid.dynamic-fields.endpoint value.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 I nibbled JSON paths at night,
Dug out fields by soft moonlight,
Parsed and placed them in their nest,
Hopped off easy — tests can rest,
A little hop, the spec's just right.

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 33.33% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title mentions 'resetPasswordChallengeFileds' (misspelled) and references adding a new map entry, which aligns with the primary change of adding resetPasswordChallengeFields support to the IdrepoProfileRegistryPluginImpl.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
mosip-identity-plugin/src/main/java/io/mosip/signup/plugin/mosipid/service/IdrepoProfileRegistryPluginImpl.java (2)

254-256: Don't log the fallback as an error.

This branch already handles the field being absent by returning Collections.emptyList(). Logging it at error will create false alerts whenever older UI-spec responses omit the field, so warn or debug would fit the behavior better.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@mosip-identity-plugin/src/main/java/io/mosip/signup/plugin/mosipid/service/IdrepoProfileRegistryPluginImpl.java`
around lines 254 - 256, In IdrepoProfileRegistryPluginImpl (inside the
resetPasswordChallengeFields handling), change the PathNotFoundException catch
to stop logging as an error; instead log at warn or debug level (e.g., log.warn
or log.debug) and optionally include the exception message/context, then
continue returning Collections.emptyList() as before so absence of the field
doesn't generate false error alerts.

160-161: Add the matching property to the default config.

This new JSONPath is configurable here, but mosip-identity-plugin/src/main/resources/application.properties:145-164 does not list mosip.signup.mosipid.uispec.resetPasswordChallengeFields-jsonpath alongside the other UI-spec JSONPath keys. Please add it there too so the override is discoverable and stays consistent with the rest of the UI-spec settings.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@mosip-identity-plugin/src/main/java/io/mosip/signup/plugin/mosipid/service/IdrepoProfileRegistryPluginImpl.java`
around lines 160 - 161, Add the new configurable JSONPath key used by
IdrepoProfileRegistryPluginImpl -> resetPasswordChallengeFieldsJsonpath to the
project's default application.properties so it is discoverable and consistent
with other UI-spec keys; add an entry for
mosip.signup.mosipid.uispec.resetPasswordChallengeFields-jsonpath with the same
default value used in the `@Value` annotation
($[0].jsonSpec[0].spec.resetPasswordChallengeFields) alongside the other UI-spec
JSONPath properties and ensure the key formatting matches the surrounding
entries.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In
`@mosip-identity-plugin/src/main/java/io/mosip/signup/plugin/mosipid/service/IdrepoProfileRegistryPluginImpl.java`:
- Around line 569-570: The Map.entry list inside the Map.ofEntries call in
IdrepoProfileRegistryPluginImpl has a missing comma between
Map.entry("maxUploadFileSize", maxUploadFileSize) and
Map.entry("resetPasswordChallengeFields", resetPasswordChallengeFields); add the
comma after the maxUploadFileSize entry so the Map.entry(...) elements are
properly separated and the Map.ofEntries(...) block compiles.

---

Nitpick comments:
In
`@mosip-identity-plugin/src/main/java/io/mosip/signup/plugin/mosipid/service/IdrepoProfileRegistryPluginImpl.java`:
- Around line 254-256: In IdrepoProfileRegistryPluginImpl (inside the
resetPasswordChallengeFields handling), change the PathNotFoundException catch
to stop logging as an error; instead log at warn or debug level (e.g., log.warn
or log.debug) and optionally include the exception message/context, then
continue returning Collections.emptyList() as before so absence of the field
doesn't generate false error alerts.
- Around line 160-161: Add the new configurable JSONPath key used by
IdrepoProfileRegistryPluginImpl -> resetPasswordChallengeFieldsJsonpath to the
project's default application.properties so it is discoverable and consistent
with other UI-spec keys; add an entry for
mosip.signup.mosipid.uispec.resetPasswordChallengeFields-jsonpath with the same
default value used in the `@Value` annotation
($[0].jsonSpec[0].spec.resetPasswordChallengeFields) alongside the other UI-spec
JSONPath properties and ensure the key formatting matches the surrounding
entries.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository UI

Review profile: CHILL

Plan: Pro

Run ID: 01bfae41-a0ff-4bfb-956d-2885cebabcb1

📥 Commits

Reviewing files that changed from the base of the PR and between f93800c and 72ae963.

📒 Files selected for processing (1)
  • mosip-identity-plugin/src/main/java/io/mosip/signup/plugin/mosipid/service/IdrepoProfileRegistryPluginImpl.java

Signed-off-by: Harsh Kashiwal <harsh.kashiwal@infosys.com>
Signed-off-by: Harsh Kashiwal <harsh.kashiwal@infosys.com>
Copy link
Contributor

@sacrana0 sacrana0 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@ase-101
Copy link
Contributor

ase-101 commented Mar 12, 2026

Changes are taken from #190

@ase-101 ase-101 closed this Mar 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants