You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[PM-37933] refactor: Introduce OrganizationUserPolicyContext model (#1124)
The policies crate requires the full `ProfileOrganization` sync response
model to be passed in for policy evaluation. However, that model is
different between mobile and TS clients - the mobile sync model is much
smaller because they need fewer admin-related properties. This tight
coupling would require mobile to expand their organization model just to
meet the interface, even though the logic doesn't actually need all
these properties.
The fix is to introduce a domain-specific `PolicyOrganizationContext` in
`bitwarden-policies` and switch the filtering APIs and FFI wrapper to
use it instead of the 61-field `ProfileOrganization`. The policy domain
only needs 6 fields; this gives consumers a small, purpose-built input
type to construct at the FFI boundary. This decoupling generally seems
like better design for a library crate.
## 🚨 Breaking Changes
The FFI signature of `filter_by_type` now takes
`PolicyOrganizationContext` instead of `ProfileOrganization`. **No
client is consuming this API yet**, so there is no migration impact in
practice.
0 commit comments