[PoC] [PM-27720] Device Management - #1224
Conversation
|
Introduce the ManagementProfile snapshot and ManagedSettingsError read error for the device-management (Managed Settings) framework. These are client configuration forced by an OS Unified Endpoint Management channel, not Vault Data, and involve no cryptography. The crate deliberately does not depend on bitwarden-core in order to break a dependency cycle: bitwarden-core must name the shared profile type while the higher-level handle and override API depend on bitwarden-core.
Adds a shared in-memory managed-settings profile cell to InternalClient with a managed_profile_handle() accessor, and a ClientBuilder::with_managed_profile hook that defaults to a fresh empty cell. This is the low-level plumbing the bitwarden-managed-settings crate builds on to share one profile cell between the host and the SDK.
Adds ManagedSettingsClient, a cloneable host-facing handle over the shared in-memory management profile cell, with new/update_profile/is_managed/get plus cell/current_profile/from_profile accessors and a feature-gated wasm_bindgen surface. Adds the ManagedSettingsClientExt trait so a constructed bitwarden-core Client can read its managed-settings handle back.
Threads a ManagedSettingsClient through the client-managed-token constructor so the host shares one managed-settings profile cell with the SDK. - bitwarden-pm: new_with_client_tokens gains a &ManagedSettingsClient parameter and injects its cell via ClientBuilder::with_managed_profile; adds a managed_settings() accessor. new/builder/new_with_sync keep their default empty cell. - bitwarden-wasm-internal: the wasm_bindgen constructor gains a &ManagedSettingsClient parameter, re-exports the wasm ManagedSettingsClient, and adds a managed_settings() accessor. - bitwarden-uniffi: adds ManagedSettingsBindingClient (uniffi::Object) and gives Client::new an Arc<ManagedSettingsBindingClient> parameter.
44f97e0 to
da23e98
Compare
🔍 SDK Breaking Change DetectionSDK Version:
Breaking change detection uses the build of the SDK from this branch, including any incompatibities pre-existing on or merged into this branch. Check the workflow logs to confirm. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #1224 +/- ##
==========================================
+ Coverage 85.74% 85.82% +0.07%
==========================================
Files 483 490 +7
Lines 68364 70158 +1794
==========================================
+ Hits 58622 60211 +1589
- Misses 9742 9947 +205 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE Reviewed this PoC that introduces the Code Review DetailsNo blocking findings. PR Metadata Assessment
|
| *self | ||
| .profile | ||
| .write() | ||
| .expect("managed-settings cell poisoned") = profile; |
There was a problem hiding this comment.
What behavior does this cause downstream? Managed settings just stop working and user settings are applied?



🎟️ Tracking
PM-27720
📔 Objective
This PR is a proof of concept of the expanded device management features, including some example usages.
🚨 Breaking Changes