Checkmate icon indicating copy to clipboard operation
Checkmate copied to clipboard

Fix:- update the regex for password validation

Open Darshan98Solanki opened this issue 1 month ago • 1 comments

(Please remove this line only before submitting your PR. Ensure that all relevant items are checked before submission.)

Describe your changes

Getting the error for password start with <>. The error we have got is about empty password. I have just add the regex part for the backend and will update the frontend in other pr as per @gorkemcetin.

Write your issue number after "Fixes "

Fixes #3010

just update the regex as per last conversation with @ajhollid and @gorkemcetin.

Summary by CodeRabbit

  • Security Improvements
    • Updated password validation to disallow the following characters: <, >, `, and ".
    • Adjusted special character requirements in password validation patterns.

✏️ Tip: You can customize this high-level summary in your review settings.

Darshan98Solanki avatar Nov 22 '25 17:11 Darshan98Solanki

[!NOTE]

.coderabbit.yml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'release_notes'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Walkthrough

The passwordPattern regex in the password validation schema is updated to disallow specific problematic characters (<, >, backtick, and double quote) via a negative lookahead assertion, while replacing the digit character class [0-9] with \d for consistency. The password strength requirements remain unchanged.

Changes

Cohort / File(s) Summary
Password validation regex update
server/src/validation/joi.js
Modified passwordPattern regex to add negative lookahead disallowing <, >, backtick, and " characters; replaced [0-9] with \d for digit validation

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Single regex modification in one file addressing a specific validation bug
  • No logic flow changes or structural alterations
  • Verify the negative lookahead syntax is correct and the excluded characters match the bug report

Poem

A rabbit once found validation's plight, When angle brackets caused a blight, With lookahead magic, now set straight, No sneaky < to seal our fate! 🐰✨

Pre-merge checks and finishing touches

❌ Failed checks (2 inconclusive)
Check name Status Explanation Resolution
Title check ❓ Inconclusive Title is vague and uses unclear phrasing ('Fiz:-' appears to be a typo or non-standard convention) that doesn't clearly convey the specific change. Revise title to be more specific and professional, e.g., 'Update password validation regex to allow < character' or 'Fix password validation regex to handle special characters'.
Description check ❓ Inconclusive Description includes the template placeholder text and most checklist items are unchecked, making it incomplete and unclear which items were actually verified. Remove template instruction lines, complete all checklist items with proper checks, and clarify testing and deployment status before requesting review.
✅ Passed checks (3 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The regex changes directly address issue #3010 by modifying password validation to disallow '<', '>', '`', and '"' characters, fixing the password validation logic that was causing the false 'empty password' error.
Out of Scope Changes check ✅ Passed The change is narrowly focused on updating the password validation regex in a single file, which is directly related to resolving the identified bug with no extraneous modifications.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing touches
  • [ ] 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • [ ] Create PR with unit tests
  • [ ] Post copyable unit tests in a comment

[!TIP]

📝 Customizable high-level summaries are now available in beta!

You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.

  • Provide your own instructions using the high_level_summary_instructions setting.
  • Format the summary however you like (bullet lists, tables, multi-section layouts, contributor stats, etc.).
  • Use high_level_summary_in_walkthrough to move the summary from the description to the walkthrough section.

Example instruction:

"Divide the high-level summary into five sections:

  1. 📝 Description — Summarize the main change in 50–60 words, explaining what was done.
  2. 📓 References — List relevant issues, discussions, documentation, or related PRs.
  3. 📦 Dependencies & Requirements — Mention any new/updated dependencies, environment variable changes, or configuration updates.
  4. 📊 Contributor Summary — Include a Markdown table showing contributions: | Contributor | Lines Added | Lines Removed | Files Changed |
  5. ✔️ Additional Notes — Add any extra reviewer context. Keep each section concise (under 200 words) and use bullet or numbered lists for clarity."

Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later.


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.

coderabbitai[bot] avatar Nov 22 '25 17:11 coderabbitai[bot]