feat(vault): card & identity cipher types (read, CLI)#23
Merged
Conversation
Model card (type 3) and identity (type 4) ciphers in vault-core and make their
high-value fields readable from the CLI.
- vault-core: Card + Identity structs (full field sets, PascalCase) on Cipher;
PlainCard/PlainIdentity on PlainCipher (sensitive fields zeroized on drop);
DecryptOptions { card, identity } + decrypt loops.
- vault-ipc: Field selectors CardNumber/Brand/Expiry/Code +
IdentityName/Email/Phone/Address.
- vault-agent: get_item maps them; composes card-expiry (MM/YYYY) and
identity name/address; absent → NoSuchField. Copy path inherits it.
- vault-cli: matching FieldArg variants (clap kebab-cases: --field card-number,
identity-email, …).
TUI detail-pane rendering of card/identity is the tracked next slice (List only
carries name/username, so it needs on-demand fetches). Creating/editing
cards/identities and long-tail identity selectors remain follow-ups.
Tests: vault-core card/identity decrypt; vault-agent get_item card-number/expiry
+ NoSuchField; vault-ipc Field round-trip. No new deps.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This was referenced Jun 15, 2026
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.
What
Vault modeled the login cipher fully but left card (type 3) and
identity (type 4) ciphers structureless —
vault getcouldn't reach a cardnumber or an identity's email. This slice models them in
vault-coreandexposes the high-value fields via the CLI:
Rendering card/identity in the TUI detail pane is the next slice (decided
with you) —
List/ListEntrycarry only name/username today, so the TUI needson-demand fetches, handled separately.
How
vault-core:Card+Identitystructs (full field sets) onCipher;PlainCard/PlainIdentitydecrypted mirrors onPlainCipher(sensitivefields — card number/code, identity ssn/passport/license — zeroized on drop);
DecryptOptions { card, identity }+ decrypt loops reusingdecrypt_optional.vault-ipc: newFieldselectors (CardNumber/CardBrand/CardExpiry/CardCode,IdentityName/IdentityEmail/IdentityPhone/IdentityAddress).vault-agent:get_itemmaps them and composes the derived ones(
card-expiry→MM/YYYY; identity name/address joined); absent →NoSuchField. TheCopypath inherits it.vault-cli: matchingFieldArgvariants (clap kebab-cases them).Scope / follow-ups
Read path only. Out of scope (tracked): the TUI detail render, creating/
editing cards & identities (
from_plain), and per-field selectors for thelong-tail identity fields (ssn/passport/license/company/address parts — modeled
and decryptable, just not individually selectable).
Tests
vault-core: decrypt a card (number/brand/exp/code) and an identity(name/email/phone/address) from
EncStrings; un-asked sub-objects stayNone.vault-agent:get_item(CardNumber)returns the number,CardExpiry→04/2030, missing field →NoSuchField.vault-ipc: aGet/Fieldround-trip for a new variant.Local CI-exact gates all green:
fmt, fresh isolatedclippy -D warnings,cargo test --workspace --all-targetsunderRUSTFLAGS=-D warnings,cargo deny check(no new deps), both headless builds.🤖 Generated with Claude Code