[PM-37474] Include UseRiskInsights in self-host license VerifyData#7818
[PM-37474] Include UseRiskInsights in self-host license VerifyData#7818AlexRubik wants to merge 2 commits into
Conversation
OrganizationLicense.VerifyData() signed the UseRiskInsights claim into the license but never compared it against the organization, so self-host could not rely on the license to grant Access Intelligence. Add the comparison using the conditional HasClaim pattern (PM-33980) so pre-existing licenses that lack the claim continue to validate. [PM-37474]
Adds absent/present-matches/present-mismatches tests mirroring the existing UseMyItems coverage, verifying pre-existing licenses (claim absent) still validate and that a present claim is enforced. [PM-37474]
|
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE Reviewed the addition of the Code Review DetailsNo findings. The change is well-scoped, consistent with the documented PM-33980 pattern, and does not affect license signature hashing ( |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7818 +/- ##
=======================================
Coverage 61.26% 61.26%
=======================================
Files 2194 2194
Lines 97313 97318 +5
Branches 8768 8768
=======================================
+ Hits 59615 59620 +5
Misses 35584 35584
Partials 2114 2114 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
Closing this draft. The self-host license VerifyData change is being consolidated with the rest of the PM-37469 subtasks into a single PR, #7782, so the whole org-ability change ships in one deploy. Work continues there. |



🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-37474
📔 Objective
OrganizationLicense.VerifyData()signed theUseRiskInsightsclaim into the self-host license but never validated it against the organization, leaving the last gap in the org-ability wiring for Access Intelligence on self-host. This adds the comparison using the conditionalHasClaimpattern introduced in PM-33980 (!claimsPrincipal.HasClaim(...) || claimValue == orgValue), so that:UseRiskInsightsability on self-host, andThis mirrors the existing
UseMyItemsandUseInviteLinksclauses in the same method. The claim is already emitted byOrganizationLicenseClaimsFactoryand synced onto the organization byOrganization.UpdateFromLicense();VerifyData()was the only consumer missing it.📸 Screenshots
Not applicable — server-side license validation, no UI changes.
⏰ Reminders before review
Unit tests cover the three branches of the new clause: claim absent (pre-existing license still validates), claim present and matching, and claim present and mismatching (validation fails).