Skip to content

[PM-39884] feat: Hide Gov region from start registration region picker#2869

Draft
fedemkr wants to merge 8 commits into
mainfrom
PM-39884/hide-gov-from-region-picker-creation
Draft

[PM-39884] feat: Hide Gov region from start registration region picker#2869
fedemkr wants to merge 8 commits into
mainfrom
PM-39884/hide-gov-from-region-picker-creation

Conversation

@fedemkr

@fedemkr fedemkr commented Jul 8, 2026

Copy link
Copy Markdown
Member

🎟️ Tracking

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

📔 Objective

FedRAMP does not allow self-registration, so the Gov region
(bitwarden-gov.com) is now hidden from the region selector on the
start registration screen. Additionally, the processor subscribes to
configPublisher and dismisses with an alert if disableUserRegistration
becomes true after a region change — mirroring the pattern used in
LandingProcessor.

fedemkr added 8 commits July 6, 2026 11:13
… selector

Adds a `.gov` RegionType case backed by bitwarden-gov.com default URLs so
users can select the new government cloud environment from the region
selector, ahead of the broader FedRAMP support work tracked in PM-35110.
# Conflicts:
#	BitwardenKit/Core/Platform/Models/Domain/EnvironmentURLData.swift
#	BitwardenKit/Core/Platform/Models/Domain/EnvironmentURLs.swift
#	BitwardenShared/Core/Platform/Models/Enum/RegionType.swift
#	BitwardenShared/Core/Platform/Models/Enum/RegionTypeTests.swift
#	BitwardenShared/Core/Platform/Services/EnvironmentService.swift
#	BitwardenShared/UI/Auth/Utilities/RegionHelper.swift
…erRegistration config

Adds `settings.disableUserRegistration` to `ConfigResponseModel` and `ServerConfig`.
The landing processor subscribes to `configPublisher` in `init` and reactively hides
the "New around here? Create account" row whenever the server signals that user
registration is disabled.
…gainst disableUserRegistration

FedRAMP does not allow self-registration, so the Gov region is now
excluded from the region selector on the start registration screen.
Additionally, the processor now subscribes to configPublisher and
shows an alert + dismisses when disableUserRegistration becomes true
after a region change, mirroring the pattern used in LandingProcessor.
@fedemkr fedemkr added the ai-review Request a Claude code review label Jul 8, 2026
@github-actions github-actions Bot added app:password-manager Bitwarden Password Manager app context app:authenticator Bitwarden Authenticator app context t:feature labels Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

🤖 Bitwarden Claude Code Review

Overall Assessment: APPROVE

Reviewed the addition of the Gov (FedRAMP) region to the shared RegionType enum, its environment URLs, and the FedRAMP self-registration guards. The change hides Gov from the start-registration region picker via excludingRegions, subscribes StartRegistrationProcessor to configPublisher to dismiss with an alert when disableUserRegistration becomes true, and hides the create-account button in LandingProcessor under the same condition. All exhaustive RegionType switches were updated (compiler-enforced), and the config-subscription approach mirrors the established LandingProcessor pattern.

No blocking issues found. Test coverage is thorough across EnvironmentURLData/EnvironmentURLs, RegionType, RegionHelper exclusion, the alert, and the config-publisher behavior (view-visible vs not-visible, region-change refresh).

Code Review Details

No findings at or above the reporting confidence threshold.

Notes considered and intentionally not raised as findings:

  • The Task { for await metaConfig in ... } subscription in StartRegistrationProcessor retains self for the publisher lifetime — this matches the pre-existing LandingProcessor pattern, so it is consistent with the codebase.
  • When disableUserRegistration emits while viewIsVisible is false, the emission is skipped and .appeared does not re-fetch config. In practice this is defense-in-depth: Gov is excluded from the registration picker and the Landing screen already hides the create-account button, so the primary guard runs before this screen is reachable.

@codecov

codecov Bot commented Jul 8, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 28.57143% with 15 lines in your changes missing coverage. Please review.
✅ Project coverage is 40.58%. Comparing base (c8ff888) to head (0a48268).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...Kit/Core/Platform/Models/Domain/ServerConfig.swift 0.00% 7 Missing ⚠️
...rm/Services/API/Response/ConfigResponseModel.swift 0.00% 4 Missing ⚠️
...re/Platform/Models/Domain/EnvironmentURLData.swift 71.42% 2 Missing ⚠️
...rdenKit/Core/Platform/Models/Enum/RegionType.swift 0.00% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##             main    #2869       +/-   ##
===========================================
- Coverage   81.24%   40.58%   -40.67%     
===========================================
  Files        1027      357      -670     
  Lines       66109    16675    -49434     
===========================================
- Hits        53712     6767    -46945     
+ Misses      12397     9908     -2489     

☔ 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.

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

Labels

ai-review Request a Claude code review app:authenticator Bitwarden Authenticator app context app:password-manager Bitwarden Password Manager app context t:feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant