Auth/PM-41517 - Registration with an Open Org Invite Link - Allow when DisableUserRegistration Enabled - #8277
Conversation
…ation is on The DisableUserRegistration self-hosted admin toggle targets open self-registration; possession of a valid open-org invite link is itself the authorization for the RegisterUserViaEmailVerificationTokenAndOpenOrgInvite path, so the guard was incorrectly ported over and broke fedramp deployments. Adds integration and unit tests pinning the new behavior.
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE Re-reviewed the Code Review DetailsNo findings. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8277 +/- ##
==========================================
+ Coverage 63.32% 63.44% +0.11%
==========================================
Files 2430 2430
Lines 104922 104928 +6
Branches 9505 9505
==========================================
+ Hits 66447 66569 +122
+ Misses 36198 36080 -118
- Partials 2277 2279 +2 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
The DisableUserRegistration guard in SendVerificationEmailForRegistrationCommand fired before the open-org invite was even inspected, so no user could reach register-finish on a self-hosted instance with the toggle on. Moves the guard below the invite validator and skips it for validated invites, letting the integration test exercise the real send endpoint end to end.
Mirrors the pattern on RegisterUserViaSalesAssistedToken so a future reader normalizing guards across these methods sees the reasoning at the contract rather than inferring it from what's missing in the implementation.
…-should-ignore-disable-open-registration
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-41517
previously https://bitwarden.atlassian.net/browse/PM-42625
📔 Objective
DisableUserRegistrationself-hosted toggle targets open self-registration, but a validated open-org invite link is itself the authorization for the invited path — so gating that path behind the toggle was incorrect.SendVerificationEmailForRegistrationCommand.Run— the guard is moved below the invite validator and skipped when a valid invite is present.RegisterUserCommand.RegisterUserViaEmailVerificationTokenAndOpenOrgInvite— the redundant guard is dropped entirely.📸 Screenshots
n/a - integration tests are sufficient.