feat(platform): let an SdkRecordMapper exclude records from SDK-visible state - #22168
Closed
Hinton wants to merge 1 commit into
Closed
feat(platform): let an SdkRecordMapper exclude records from SDK-visible state#22168Hinton wants to merge 1 commit into
Hinton wants to merge 1 commit into
Conversation
…le state Adds an optional `shouldInclude` predicate to SdkRecordMapper. When it returns false for a record, RepositoryRecord.get returns null and list() omits it, so the SDK never has to parse a record it cannot represent. Writes are deliberately unfiltered: the record still round-trips through client state and stays readable via the client's own services. Only the SDK-facing view is narrowed. No behavior change for existing mappers - the predicate is optional and absent ones include everything.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #22168 +/- ##
=======================================
Coverage 52.72% 52.72%
=======================================
Files 4203 4203
Lines 133154 133159 +5
Branches 20957 20958 +1
=======================================
+ Hits 70201 70211 +10
+ Misses 57819 57815 -4
+ Partials 5134 5133 -1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Hinton
added a commit
that referenced
this pull request
Aug 6, 2026
…pivot) Pivots the PAM cipher-gating client work: instead of hiding gated rows from the SDK and hand-decrypting them, gated rows now flow through the SDK, which decrypts the reduced envelope into a `partial` view (bitwarden/sdk-internal#1359). - Revert the SdkRecordMapper `shouldInclude` filter and the `decryptPartialCiphers` path (the last caller of the deprecated `Cipher.decrypt`). Gated rows go through `decryptMany*` like any cipher. - CipherResponse passes `partialData` through verbatim (no client lift); `Cipher.toSdkCipher`/`fromSdkCipher` map it both ways so it round-trips losslessly (re-attach hack removed). The decrypted view's gating marker is the SDK's `partial` boolean. - Vault seams read `view.partial`; `CipherOpenVerdict` gains a `handled` case so the open gate can block the open and surface the "Privileged Controls license required" dialog (unlicensed-user design). - Move the "Privileged" badge into a dedicated "Controlled access" column, shown only when a PAM-enabled org (`Organization.usePam`) is in view and the badge seam is provided. Depends on sdk-internal#1359 (adds Cipher.partial_data + the `partial` view flag + the restricted decrypt path); the `@bitwarden/sdk-internal` bump lands once that publishes. Supersedes #22168, #22169, #22170.
Member
Author
Hinton
added a commit
that referenced
this pull request
Aug 6, 2026
…pivot) Pivots the PAM cipher-gating client work: instead of hiding gated rows from the SDK and hand-decrypting them, gated rows now flow through the SDK, which decrypts the reduced envelope into a `partial` view (bitwarden/sdk-internal#1359). - Revert the SdkRecordMapper `shouldInclude` filter and the `decryptPartialCiphers` path (the last caller of the deprecated `Cipher.decrypt`). Gated rows go through `decryptMany*` like any cipher. - CipherResponse passes `partialData` through verbatim (no client lift); `Cipher.toSdkCipher`/`fromSdkCipher` map it both ways so it round-trips losslessly (re-attach hack removed). The decrypted view's gating marker is the SDK's `partial` boolean. - Vault seams read `view.partial`; `CipherOpenVerdict` gains a `handled` case so the open gate can block the open and surface the "Privileged Controls license required" dialog (unlicensed-user design). - Move the "Privileged" badge into a dedicated "Controlled access" column, shown only when a PAM-enabled org (`Organization.usePam`) is in view and the badge seam is provided. Depends on sdk-internal#1359 (adds Cipher.partial_data + the `partial` view flag + the restricted decrypt path); the `@bitwarden/sdk-internal` bump lands once that publishes. Supersedes #22168, #22169, #22170.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎟️ Tracking
Prerequisite for the PAM cipher-gating stack (#22169 → #22170 → #22171). Small and
generic — no PAM knowledge needed to review.
📔 Objective
Adds an optional
shouldIncludepredicate toSdkRecordMapper. When it returns false fora record,
RepositoryRecord.getreturnsnullandlist()omits it, so the SDK never hasto parse a record it cannot represent.
Writes are deliberately unfiltered: the record still round-trips through client state
and stays readable via the client's own services. Only the SDK-facing view is narrowed.
The consumer is #22169, where PAM-gated ciphers are hidden from the SDK — it has no
partial-data decrypt path and rejects sparsely-populated ciphers with a serde
invalid type: unit valueerror.Verification
npm test -- libs/common/src/platform/services/sdk/client-managed-state.spec.ts— 40passed (35 existing + 5 new, covering both
get/listfiltering, the no-predicatedefault, and that writes still land).
🚨 Breaking Changes
None — the predicate is optional and existing mappers include everything, exactly as before.