Skip to content

feat(vault): card & identity cipher types (read, CLI)#23

Merged
UnbreakableMJ merged 1 commit into
mainfrom
card-identity
Jun 15, 2026
Merged

feat(vault): card & identity cipher types (read, CLI)#23
UnbreakableMJ merged 1 commit into
mainfrom
card-identity

Conversation

@UnbreakableMJ

Copy link
Copy Markdown
Contributor

What

Vault modeled the login cipher fully but left card (type 3) and
identity (type 4) ciphers structureless — vault get couldn't reach a card
number or an identity's email. This slice models them in vault-core and
exposes the high-value fields via the CLI:

vault get visa --field card-number   # + card-brand, card-expiry, card-code
vault get me   --field identity-email # + identity-name, identity-phone, identity-address

Rendering card/identity in the TUI detail pane is the next slice (decided
with you) — List/ListEntry carry only name/username today, so the TUI needs
on-demand fetches, handled separately.

How

  • vault-core: Card + Identity structs (full field sets) on Cipher;
    PlainCard/PlainIdentity decrypted mirrors on PlainCipher (sensitive
    fields — card number/code, identity ssn/passport/license — zeroized on drop);
    DecryptOptions { card, identity } + decrypt loops reusing decrypt_optional.
  • vault-ipc: new Field selectors (CardNumber/CardBrand/CardExpiry/
    CardCode, IdentityName/IdentityEmail/IdentityPhone/IdentityAddress).
  • vault-agent: get_item maps them and composes the derived ones
    (card-expiryMM/YYYY; identity name/address joined); absent →
    NoSuchField. The Copy path inherits it.
  • vault-cli: matching FieldArg variants (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 the
long-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 stay None.
  • vault-agent: get_item(CardNumber) returns the number, CardExpiry
    04/2030, missing field → NoSuchField.
  • vault-ipc: a Get/Field round-trip for a new variant.

Local CI-exact gates all green: fmt, fresh isolated clippy -D warnings,
cargo test --workspace --all-targets under RUSTFLAGS=-D warnings,
cargo deny check (no new deps), both headless builds.

🤖 Generated with Claude Code

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>
@UnbreakableMJ
UnbreakableMJ merged commit 6e28bf2 into main Jun 15, 2026
8 checks passed
@UnbreakableMJ
UnbreakableMJ deleted the card-identity branch June 15, 2026 20:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant