Skip to content

PM-40657: feat: Add support for disableUserRegistration boolean - #7186

Merged
david-livefront merged 1 commit into
mainfrom
PM-40675-config-settings-response
Jul 21, 2026
Merged

PM-40657: feat: Add support for disableUserRegistration boolean#7186
david-livefront merged 1 commit into
mainfrom
PM-40675-config-settings-response

Conversation

@david-livefront

@david-livefront david-livefront commented Jul 21, 2026

Copy link
Copy Markdown
Collaborator

🎟️ Tracking

PM-35124
PM-40675
PM-40657

📔 Objective

This PR adds the setting to the ConfigResponseJson and uses that data to hide the Create account button on the Landing screen and the Welcome screen.

@david-livefront
david-livefront requested a review from a team as a code owner July 21, 2026 15:09
@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 Jul 21, 2026
@github-actions

github-actions Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: REQUEST CHANGES

This PR adds a settings.disableUserRegistration field to ConfigResponseJson and uses it (alongside the existing FedRamp check) to hide the "Create account" button on the Landing and Welcome screens. The ViewModel wiring, state hoisting, and internal-action pattern follow established conventions, and test coverage for both ViewModels and screens is thorough. One robustness concern with the new network model is noted below.

Code Review Details
  • ⚠️ : SettingJson.disableUserRegistration is non-nullable with no default; a present-but-partial settings object would throw MissingFieldException and break parsing of the entire config response. Other non-nullable Boolean fields in this layer default to false.
    • network/src/main/kotlin/com/bitwarden/network/model/ConfigResponseJson.kt:139

@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 84.88372% with 13 lines in your changes missing coverage. Please review.
✅ Project coverage is 86.08%. Comparing base (56277b3) to head (78c0abd).

Files with missing lines Patch % Lines
...warden/ui/auth/feature/landing/LandingViewModel.kt 79.16% 0 Missing and 5 partials ⚠️
...warden/ui/auth/feature/welcome/WelcomeViewModel.kt 85.29% 0 Missing and 5 partials ⚠️
...re/startregistration/StartRegistrationViewModel.kt 82.35% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #7186      +/-   ##
==========================================
+ Coverage   85.94%   86.08%   +0.13%     
==========================================
  Files        1124      886     -238     
  Lines       68200    64756    -3444     
  Branches     9799     9683     -116     
==========================================
- Hits        58612    55742    -2870     
+ Misses       6065     5538     -527     
+ Partials     3523     3476      -47     
Flag Coverage Δ
app-data 17.74% <0.00%> (-1.17%) ⬇️
app-ui-auth-tools 18.78% <84.88%> (-0.25%) ⬇️
app-ui-platform 16.55% <0.00%> (-0.56%) ⬇️
app-ui-vault 27.36% <0.00%> (-0.51%) ⬇️
authenticator 6.10% <0.00%> (-0.03%) ⬇️
lib-core-network-bridge 4.01% <0.00%> (-0.02%) ⬇️
lib-data-ui 1.15% <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.

@david-livefront david-livefront changed the title PM-40657: feat: Restructure Environment to better handle FedRamp requirements PM-40657: feat: Add support for disableUserRegistration boolean Jul 21, 2026
@david-livefront
david-livefront force-pushed the PM-40675-config-settings-response branch from 40c63af to 64d97ae Compare July 21, 2026 16:12
@david-livefront
david-livefront force-pushed the PM-40675-config-settings-response branch from 64d97ae to 78c0abd Compare July 21, 2026 16:13
*/
val allowCreateAccount: Boolean
get() = selectedEnvironmentType != Environment.Type.FED_RAMP
get() = !disableCreateAccount && selectedEnvironmentType != Environment.Type.FED_RAMP

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.

🤔 more of a thought, we are adding the disableCreateAccount for the FED_RAMP environment but we are keeping the hard check on the env.

As I believe we never want to display this on FED_RAMP env, also feel that it is more of a server responsability 🤔 also on other places we are simply relying on the disableUserRegistration value

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.

This is the only screen that allows a full FedRamp type to be selected. Since we know the type directly here we can block account creation. Whereas on the StartRegistrationScreen, we completely filter out the FedRamp option. but the individual environments might still have the disableUserRegistration boolean set.

Keeping the check for the FED_RAMP type just means we do not need to wait for the config request go through. It's a minor optimization that was added to the requirements.

@aj-rosado aj-rosado left a comment

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.

LGTM, just left a little non blocking comment

@david-livefront

Copy link
Copy Markdown
Collaborator Author

Thanks @aj-rosado

@david-livefront
david-livefront added this pull request to the merge queue Jul 21, 2026
Merged via the queue into main with commit 0bb0173 Jul 21, 2026
39 checks passed
@david-livefront
david-livefront deleted the PM-40675-config-settings-response branch July 21, 2026 17:09
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.

2 participants