feat(identity): honour include_sensitive as a real second escalation - #340
Merged
Merged
Conversation
The pool listing behind the identity pane's `show_values` (`v`) passed the one `include_values` flag to BOTH SDK arguments, so turning values on pulled every `sensitivity: high` value — card numbers, ids — into the process. Passing `include_sensitive: false` naively was not the fix either: a high-sensitivity attribute would then come back valueless and render as "(no value)", indistinguishable from "you hold nothing here" (the `masked_is_not_the_same_state_as_absent` invariant). Split the two escalations, per the module's own long-standing note: - `pool::list` takes `include_sensitive` separately; the bulk read passes `false`, so sensitive values never enter memory in bulk. - New `pool::reveal` fetches one attribute's value on its own (`type_prefix`-scoped list + `include_sensitive: true`, filtered by id) — the per-attribute `s` key. `PoolAttribute::is_withheld_sensitive` + `ClaimTypeDefaults::is_sensitive` tell "withheld because sensitive" apart from "absent". - `s` (`RevealValue`) becomes a targeted fetch ONLY for a withheld sensitive value (new `PersonaJob::AttributeReveal` → `PersonaOutcome::AttributeRevealed` splices the value in and lifts the mask); a value already in memory is still an instant mask-lift, and a genuinely-absent row still just toggles. - The pane renders a third state — "sensitive — not loaded" with "s to show" — so a withheld card number never reads as "(no value)". No dependency bump: `persona_attribute_list` in vta-sdk 0.42.1 already carries `type_prefix` and `include_sensitive`. Signed-off-by: Glenn Gore <glenn.g@affinidi.com>
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.
Backlog follow-up (
tasks/follow-ups.md→ "Honourinclude_sensitiveas a real second escalation").The problem
The pool listing behind the identity pane's
show_values(v) passed the oneinclude_valuesflag to both SDK arguments, so turning values on pulled everysensitivity: highvalue — card numbers, ids — into the process. Passinginclude_sensitive: falsenaively was not the fix either: a high-sensitivity attribute would then come back valueless and render as(no value), indistinguishable from "you hold nothing here" (themasked_is_not_the_same_state_as_absentinvariant). The module header already documented this exact intended fix.The change (split the two escalations)
pool::listtakesinclude_sensitiveseparately; the bulk read passesfalse, so sensitive values never enter memory in bulk.pool::revealfetches one attribute's value on its own — atype_prefix-scoped list withinclude_sensitive: true, filtered by id (the SDK has no by-id read). Behind the per-attributeskey.PoolAttribute::is_withheld_sensitive+ClaimTypeDefaults::is_sensitivetell "withheld because sensitive, not fetched" apart from "genuinely absent".s(RevealValue) becomes a targeted fetch only for a withheld sensitive value (newPersonaJob::AttributeReveal→PersonaOutcome::AttributeRevealedsplices the value into the in-memory row and lifts the mask). A value already in memory is still an instant mask-lift; a genuinely-absent row still just toggles — so existing reveal behaviour/tests are unchanged.sensitive — not loadedwiths to show— so a withheld card number never reads as(no value).Net effect: pressing
vno longer loads every card number into memory; each sensitive value is fetched only when the holder asks for that one withs, and the reveal stays truthful.No dependency bump
persona_attribute_listin the pinned vta-sdk 0.42.1 already carriestype_prefixandinclude_sensitive.Tests / gates
pool::a_withheld_sensitive_value_is_distinct_from_absent(the third-state invariant, asserting its own fixture classification).a_reveal_of_a_withheld_sensitive_value_fetches_it(reducer:son a sensitive valueless row returns a fetch job and reveals nothing until it returns); existing reveal tests still pass unchanged.cargo fmt,clippy --all-targets --all-features,RUSTDOCFLAGS="-D warnings" cargo doc, fullcargo testall pass.