feat(platform): introduce GovModeService for FedRAMP region gating#21366
Draft
addisonbeck wants to merge 1 commit into
Draft
feat(platform): introduce GovModeService for FedRAMP region gating#21366addisonbeck wants to merge 1 commit into
addisonbeck wants to merge 1 commit into
Conversation
…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.
|
Codecov Report❌ Patch coverage is 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. 🚀 New features to boost your workflow:
|
Contributor
Changes in this PR impact the Autofill experience of the browser clientBIT has tested the core experience with these changes and the feature flag configuration used by ✅ Fortunately, these BIT tests have passed! 🎉 |
Contributor
Changes in this PR impact the Autofill experience of the browser clientBIT has tested the core experience with these changes and all feature flags disabled. ✅ Fortunately, these BIT tests have passed! 🎉 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



🎟️ 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) andisGovMode$(userId)(when a UserId is in scope).📸 Screenshots