Repository navigation
[PM-44990] refactor: Add SDK record mapper for policies - #24086
Conversation
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE This PR adds |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #24086 +/- ##
=======================================
Coverage 61.61% 61.61%
=======================================
Files 4892 4893 +1
Lines 157691 157693 +2
Branches 25265 25263 -2
=======================================
+ Hits 97164 97168 +4
+ Misses 53836 53835 -1
+ Partials 6691 6690 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
cf41b3c to
554ea80
Compare
b5b6afe to
f9f377e
Compare
|
Other teams' changes have been split to stacked PRs. |
8800f83 to
1e7d710
Compare
1e7d710 to
f99a3fe
Compare
Replaced by a newer auto-merge request
624a371 to
f99a3fe
Compare
523fa66 to
e62fe51
Compare
🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-44990
📔 Objective
Add
PolicyRecordMapperso the SDK can read and write policy state through a client-managed repository. Registering it ininitializeClientManagedStateis done in #24209.Also:
PolicyData/PolicyRecordMapper.Policy.toSdkPolicyis removed, andInternalNewPolicyService.policies$now returnsPolicyData[]so that it can pass through the mapper.Policy.fromSdkPolicyis kept as a thin wrapper aroundPolicyRecordMapper.fromSdk, so callers outside Admin Console don't need to change.Policyconstructor requires aPolicyData. Other teams' tests are updated for this in [PM-44990] Build Policy test fixtures from PolicyData in vault #24206, [PM-44990] Build Policy test fixtures from PolicyData in send #24207 and [PM-44990] Build Policy test fixtures from PolicyData in auth #24208.revisionDateis now non-nullable. The server never returns a policy without one, and the SDK type is only optional because the SDK hasn't caught up.PolicyRecordMapper.fromSdk(and soPolicy.fromSdkPolicy) throws if it is missing.🤖 AI-assisted review
Local code review (Standard,
code-review-local): APPROVE, no findings, nothing deferred. This review covered the original unsplit change. ThefromSdkPolicywrapper was added afterwards.