Skip to content

[PM-40533] feat: Validate recipient email domains against SendControls allowed domains - #7269

Draft
andrebispo5 wants to merge 3 commits into
PM-40531-lock-who-can-view-when-enforcedfrom
PM-40533-validate-recipient-email-domains
Draft

[PM-40533] feat: Validate recipient email domains against SendControls allowed domains#7269
andrebispo5 wants to merge 3 commits into
PM-40531-lock-who-can-view-when-enforcedfrom
PM-40533-validate-recipient-email-domains

Conversation

@andrebispo5

Copy link
Copy Markdown
Contributor

🎟️ Tracking

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

📔 Objective

When an org's SendControls policy sets allowedDomains, saving a Send with Specific people
recipients now checks each recipient's domain against that list, and blocks the save with an error
dialog if any of them falls outside it.

What changed

  • The check runs at save time in handleSaveClick, right after the existing email format
    validation, so it does not fire on every keystroke
  • Error dialog reuses the existing "Invalid email addresses" title, with a new description listing
    the allowed domains
  • The policy value arrives as one comma-separated string, so it gets trimmed and emptied of blanks
    before both matching and display. Domain matching is case-insensitive
  • A policy value with nothing usable in it, "," for example, counts as no restriction. Failing
    closed there would block saving with no way for the user to recover

Scope

  • Only applies when Who can view is Specific people, since that is the only case with recipients.
    Other access types are untouched
  • Flag off or no domains configured means no domain checking at all, and the existing format
    validation is unaffected either way

Note for reviewers

This stacks on #7266 (PM-40531), so please review that one first. The diff here is only the last
three commits.

📸 Screenshots

Before After

@github-actions github-actions Bot added app:password-manager Bitwarden Password Manager app context app:authenticator Bitwarden Authenticator app context t:feature Change Type - Feature Development labels Aug 14, 2026
@codecov

codecov Bot commented Aug 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.11765% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 86.20%. Comparing base (af5320d) to head (0ff6ab5).

Files with missing lines Patch % Lines
...tools/feature/send/addedit/AddEditSendViewModel.kt 94.11% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@                             Coverage Diff                              @@
##           PM-40531-lock-who-can-view-when-enforced    #7269      +/-   ##
============================================================================
+ Coverage                                     85.93%   86.20%   +0.27%     
============================================================================
  Files                                           937      894      -43     
  Lines                                         67225    65371    -1854     
  Branches                                       9861     9826      -35     
============================================================================
- Hits                                          57769    56354    -1415     
+ Misses                                         5937     5513     -424     
+ Partials                                       3519     3504      -15     
Flag Coverage Δ
app-data 17.86% <0.00%> (+0.33%) ⬆️
app-ui-auth-tools 18.81% <94.11%> (+<0.01%) ⬆️
app-ui-platform 16.40% <0.00%> (-0.49%) ⬇️
app-ui-vault 27.30% <0.00%> (-0.55%) ⬇️
authenticator 6.08% <0.00%> (-0.01%) ⬇️
lib-core-network-bridge 4.09% <0.00%> (-0.01%) ⬇️
lib-data-ui 1.20% <0.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

app:authenticator Bitwarden Authenticator app context app:password-manager Bitwarden Password Manager app context t:feature Change Type - Feature Development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant