Skip to content

feat(platform): introduce GovModeService for FedRAMP region gating#21366

Draft
addisonbeck wants to merge 1 commit into
pm-38018from
pm-38020
Draft

feat(platform): introduce GovModeService for FedRAMP region gating#21366
addisonbeck wants to merge 1 commit into
pm-38018from
pm-38020

Conversation

@addisonbeck

@addisonbeck addisonbeck commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

🎟️ Tracking

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

📔 Objective

GovModeService is a shared Platform service that downstream teams consume to gate FedRAMP-specific behavior.

The MVP implementation infers the gov-mode signal from the client-side Region (true when env.getRegion() === Region.Gov). A redundant implementation of this same kind of check will be introduced to the SDK by PM-38266. Later PM-36520 will replace both implementations with a single server-backed check propagated by the SDK, while keeping this contract stable.

The service exposes two Observable surfaces: globalIsGovMode$ (pre-login) and isGovMode$(userId) (when a UserId is in scope).

📸 Screenshots

…M-38020]

GovModeService is a shared Platform service that downstream teams consume to
gate FedRAMP-specific behavior.

The MVP implementation infers the gov-mode signal from the client-side Region
(true when `env.getRegion() === Region.Gov`). PM-36520 will replace the
implementation with a server-backed check while keeping this contract stable.

The service exposes two Observable surfaces: `globalIsGovMode$` (pre-login) and
`isGovMode$(userId)` (when a UserId is in scope). Consumers needing a Promise
snapshot bridge with `firstValueFrom` at the call-site -- the synthesis memory
A5086F94 captured the decision to omit Promise overloads from the service
surface.

Registered in all four app bootstraps: Angular DI (jslib-services.module),
browser background, CLI service-container, and desktop main. Unit tests cover
all four regions (Gov, US, EU, SelfHosted) for both API surfaces.
@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Jun 18, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 64.70588% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 49.18%. Comparing base (9fa9909) to head (e406d57).
✅ All tests successful. No failed tests found.

Files with missing lines Patch % Lines
apps/desktop/src/main.ts 0.00% 2 Missing ⚠️
libs/angular/src/services/jslib-services.module.ts 0.00% 2 Missing ⚠️
apps/browser/src/background/main.background.ts 50.00% 1 Missing ⚠️
...mmon/src/platform/abstractions/gov-mode.service.ts 0.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           pm-38018   #21366      +/-   ##
============================================
- Coverage     49.18%   49.18%   -0.01%     
============================================
  Files          4055     4057       +2     
  Lines        126950   126967      +17     
  Branches      19359    19359              
============================================
+ Hits          62443    62449       +6     
- Misses        59908    59919      +11     
  Partials       4599     4599              

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

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@bw-ghapp

bw-ghapp Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Changes in this PR impact the Autofill experience of the browser client

BIT has tested the core experience with these changes and the feature flag configuration used by vault.bitwarden.com.

✅ Fortunately, these BIT tests have passed! 🎉

@bw-ghapp

bw-ghapp Bot commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Changes in this PR impact the Autofill experience of the browser client

BIT has tested the core experience with these changes and all feature flags disabled.

✅ Fortunately, these BIT tests have passed! 🎉

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.

1 participant