[PM-40527] feat: Add SendControls policy data model and feature flags#7179
[PM-40527] feat: Add SendControls policy data model and feature flags#7179andrebispo5 wants to merge 2 commits into
Conversation
…ture flags Introduces the client-side scaffolding for the new consolidated SendControls org policy (server policy type 21), which will supersede DisableSend and SendOptions. This is data-layer only: PolicyInformation.SendControls model, JSON decoding, the SendWhoCanAccessTypeJson enum, and the two feature flags gating rollout. No enforcement behavior changes yet.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7179 +/- ##
==========================================
+ Coverage 85.69% 86.07% +0.37%
==========================================
Files 941 885 -56
Lines 67045 64655 -2390
Branches 9660 9629 -31
==========================================
- Hits 57454 55649 -1805
+ Misses 6137 5553 -584
+ Partials 3454 3453 -1
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
…lags Covers SendControls JSON decoding, getPolicyType() mapping, and the two new FlagKey entries, matching existing test conventions for sibling policy types.
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE This PR adds client-side data-layer scaffolding for the consolidated SendControls organization policy (server policy type 21) and two feature flags. Reviewed the new Code Review DetailsNo blocking findings.
An existing (resolved) thread notes the |
There was a problem hiding this comment.
Pull request overview
Adds client-side scaffolding for the consolidated SendControls organization policy (server policy type 21) and wires it through sync decoding, policy-type mapping, feature flags, and debug UI.
Changes:
- Introduces
PolicyInformation.SendControlsand a new network enumSendWhoCanAccessTypeJsonfor policy data decoding. - Adds
SEND_CONTROLSdecoding support inSyncResponseJsonExtensionsand type mapping inPolicyManagerExtensions(+ tests). - Adds two feature flags (
SendControls,SendControlsExistingSends) and exposes them in the debug feature-flag menu.
Reviewed changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| ui/src/main/res/values/strings_non_localized.xml | Adds debug-menu labels for the new feature flags. |
| ui/src/main/kotlin/com/bitwarden/ui/platform/components/debug/FeatureFlagListItems.kt | Adds the two new flags to the debug feature flag list and label mapping. |
| network/src/main/kotlin/com/bitwarden/network/model/SendWhoCanAccessTypeJson.kt | Adds enum + serializer for whoCanAccess values under SendControls. |
| core/src/test/kotlin/com/bitwarden/core/data/manager/model/FlagKeyTest.kt | Tests new flag keys and confirms default values. |
| core/src/main/kotlin/com/bitwarden/core/data/manager/model/FlagKey.kt | Defines the two new feature flags and includes them in active PM flags. |
| app/src/test/kotlin/com/x8bit/bitwarden/data/platform/manager/util/PolicyManagerExtensionsTest.kt | Adds test for getPolicyType<SendControls>() mapping. |
| app/src/test/kotlin/com/x8bit/bitwarden/data/auth/repository/util/SyncResponseJsonExtensionsTest.kt | Adds test verifying SendControls policy data decodes to PolicyInformation. |
| app/src/main/kotlin/com/x8bit/bitwarden/data/platform/manager/util/PolicyManagerExtensions.kt | Maps PolicyInformation.SendControls to PolicyType.SEND_CONTROLS. |
| app/src/main/kotlin/com/x8bit/bitwarden/data/auth/repository/util/SyncResponseJsonExtensions.kt | Adds decode branch for PolicyType.SEND_CONTROLS. |
| app/src/main/kotlin/com/x8bit/bitwarden/data/auth/repository/model/PolicyInformation.kt | Adds PolicyInformation.SendControls data model. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| * Represents who is allowed to view a Send under the `SendControls` policy. | ||
| */ | ||
| @Serializable(SendWhoCanAccessTypeSerializer::class) | ||
| enum class SendWhoCanAccessTypeJson { |
There was a problem hiding this comment.
What do you think about just calling this SendAccessTypeJson?
|
|
||
| PolicyType.SEND_CONTROLS -> { | ||
| JSON.decodeFromStringOrNull<PolicyInformation.SendControls>(it) | ||
| } |
There was a problem hiding this comment.
Is any spot in the app using this yet?
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-40527
📔 Objective
Introduces the client-side data-layer scaffolding for the new consolidated
SendControls organization policy (server policy type 21), which will
supersede the DisableSend and SendOptions policies. This ticket is data-model
only — no enforcement/UI behavior changes yet:
PolicyInformation.SendControlsmodel decodingdisableSend,disableHideEmail,whoCanAccess,allowedDomains,deletionHours,allowedSendTypesSendWhoCanAccessTypeJsonenum (network module)SyncResponseJsonExtensions.ktandgetPolicyType<T>()branch in
PolicyManagerExtensions.ktSendControls(pm-31885-send-controls) andSendControlsExistingSends(pm-31885-send-controls-existing-sends)📸 Screenshots
No UI/behavior changes in this PR — data-layer scaffolding only.