Skip to content

[PM-30799] Validation added for Domain name#6856

Merged
voommen-livefront merged 1 commit into
mainfrom
dirt/pm-30799/xss-in-organization-events
Jan 23, 2026
Merged

[PM-30799] Validation added for Domain name#6856
voommen-livefront merged 1 commit into
mainfrom
dirt/pm-30799/xss-in-organization-events

Conversation

@voommen-livefront
Copy link
Copy Markdown
Collaborator

🎟️ Tracking

https://bitwarden.atlassian.net/browse/PM-30799

📔 Objective

The Domain name is a string and it is not validated.
This PR addes a DomainNameValidation attribute to the model, thereby forcing the model to be valid and if not, returns a 400 Bad Request.
The attribute pattern for validation is commonly used on the server side.
The client side already handles errors gracefully.

📸 Screenshots

Request to the server returns a 400

image image

⏰ Reminders before review

  • Contributor guidelines followed
  • All formatters and local linters executed and passed
  • Written new unit and / or integration tests where applicable
  • Protected functional changes with optionality (feature flags)
  • Used internationalization (i18n) for all UI strings
  • CI builds passed
  • Communicated to DevOps any deployment requirements
  • Updated any necessary documentation (Confluence, contributing docs) or informed the documentation team

🦮 Reviewer guidelines

  • 👍 (:+1:) or similar for great changes
  • 📝 (:memo:) or ℹ️ (:information_source:) for notes or general info
  • ❓ (:question:) for questions
  • 🤔 (:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion
  • 🎨 (:art:) for suggestions / improvements
  • ❌ (:x:) or ⚠️ (:warning:) for more significant problems or concerns needing attention
  • 🌱 (:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt
  • ⛏ (:pick:) for minor or nitpick changes

@voommen-livefront voommen-livefront requested a review from a team as a code owner January 15, 2026 22:27
@github-actions
Copy link
Copy Markdown
Contributor

Logo
Checkmarx One – Scan Summary & Detailsd362f3af-8e1b-432e-a4e4-a72f87d419f7

Great job! No new security vulnerabilities introduced in this pull request

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 56.01%. Comparing base (c7e364a) to head (25af6c9).
⚠️ Report is 21 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #6856   +/-   ##
=======================================
  Coverage   56.00%   56.01%           
=======================================
  Files        1965     1966    +1     
  Lines       86886    86911   +25     
  Branches     7740     7745    +5     
=======================================
+ Hits        48663    48680   +17     
- Misses      36422    36431    +9     
+ Partials     1801     1800    -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

}

// Check length constraints
if (domainName.Length > 253)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Just thinking out loud: Generally speaking, I prefer meaningful variable and method names over comments for things like this. It's easier to maintain one source of truth instead of two (the code and the comment). That said, I'm not sure if that's still the accepted best practice with the new advances in AI.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

you make a good point jimmy. I will go easy on the comments - specially when the code is not complex

@voommen-livefront voommen-livefront merged commit b623e38 into main Jan 23, 2026
57 checks passed
@voommen-livefront voommen-livefront deleted the dirt/pm-30799/xss-in-organization-events branch January 23, 2026 14:34
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.

2 participants