[2116] added multiple login ids#2136
Conversation
Signed-off-by: Zeeshan Mehboob <zeeshan.mehboob@infosys.com>
WalkthroughReworks the declarative esignet YAML flow to support selecting among multiple login ID types (UIN/VID, Mobile, Email, NRC) across OTP, credentials, and biometrics stages, introducing new reusable prompts and a login-ID selector, renaming a biometric field identifier, adjusting a DOB input type, and reducing the OTP resend timer. Also bumps an oidc-ui dependency version. ChangesDeclarative Flow Multi Login-ID Support
OIDC UI Dependency Update
Estimated code review effort: 4 (Complex) | ~60 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant ACRSelection
participant LoginIdsSelector
participant OTPPrompt
participant CredentialsNode
participant BasicCredAuth
User->>ACRSelection: choose password/OTP path
ACRSelection->>LoginIdsSelector: route to login ID selection
User->>LoginIdsSelector: pick UIN/Mobile/Email/NRC
LoginIdsSelector->>OTPPrompt: show corresponding OTP prompt
User->>OTPPrompt: submit OTP
OTPPrompt->>CredentialsNode: proceed to credentials node
User->>CredentialsNode: enter password
CredentialsNode->>BasicCredAuth: submit login ID + password
BasicCredAuth-->>User: authentication result
Possibly related PRs
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@esignet-service/data/config/resources/flows/flow-declarative-esignet.yaml`:
- Around line 92-94: The mobile number validation in the declarative flow is too
permissive because the regex is unanchored and allows empty input; update the
regex used in the validation entry under the flow configuration to require at
least one digit and match the full value. Replace the current pattern in the
mobile number rule with an anchored numeric-only expression so the message
“Mobile Number must contain numbers only” is enforced consistently.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: ASSERTIVE
Plan: Pro
Run ID: 14508f52-8d75-4f25-b5bc-45e084543794
⛔ Files ignored due to path filters (5)
oidc-ui/package-lock.jsonis excluded by!**/package-lock.jsonoidc-ui/public/images/email_icon.svgis excluded by!**/*.svgoidc-ui/public/images/mobile_icon.svgis excluded by!**/*.svgoidc-ui/public/images/nrc_id_icon.svgis excluded by!**/*.svgoidc-ui/public/images/vid_icon.svgis excluded by!**/*.svg
📒 Files selected for processing (2)
esignet-service/data/config/resources/flows/flow-declarative-esignet.yamloidc-ui/package.json
| - type: regex | ||
| value: "[0-9]*" | ||
| message: Mobile Number must contain numbers only |
There was a problem hiding this comment.
🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Inspect the relevant flow config around the reported lines.
sed -n '70,110p' esignet-service/data/config/resources/flows/flow-declarative-esignet.yaml
# Find where regex validators are interpreted to understand the matching semantics.
rg -n "type:\s*regex|message:\s*Mobile Number must contain numbers only|regex" esignet-service -g '*.yaml' -g '*.yml' -g '*.java' -g '*.kt' -g '*.js' -g '*.ts'Repository: mosip/esignet
Length of output: 3733
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Show the exact block with line numbers.
cat -n esignet-service/data/config/resources/flows/flow-declarative-esignet.yaml | sed -n '85,100p'Repository: mosip/esignet
Length of output: 697
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Locate the implementation that applies "type: regex" validations and inspect its matching semantics.
rg -n "case\s+['\"]?regex['\"]?|type\s*==\s*['\"]regex['\"]|Pattern\.matches|matches\(" esignet-service -g '*.java' -g '*.kt' -g '*.ts' -g '*.js'Repository: mosip/esignet
Length of output: 151
🏁 Script executed:
#!/bin/bash
set -euo pipefail
# Search for the flow validation model and any regex helper in the repo.
rg -n "validation.*regex|regex.*validation|Pattern\.compile|Pattern\.matches|String\.matches|matches\(" . -g '*.java' -g '*.kt' -g '*.ts' -g '*.js' -g '*.yaml' -g '*.yml'Repository: mosip/esignet
Length of output: 151
Mobile-number regex should be anchored and require at least one digit at esignet-service/data/config/resources/flows/flow-declarative-esignet.yaml:92-94.
"[0-9]*" accepts empty input and can match non-numeric text; it doesn’t enforce “numbers only.” Use ^[0-9]+$ to make the validation do what the message says.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
In `@esignet-service/data/config/resources/flows/flow-declarative-esignet.yaml`
around lines 92 - 94, The mobile number validation in the declarative flow is
too permissive because the regex is unanchored and allows empty input; update
the regex used in the validation entry under the flow configuration to require
at least one digit and match the full value. Replace the current pattern in the
mobile number rule with an anchored numeric-only expression so the message
“Mobile Number must contain numbers only” is enforced consistently.
Summary by CodeRabbit