feat(vault): create/edit card ciphers (write path)#25
Merged
Conversation
`vault add --type card` and `vault edit <card>` now build and update type-3 ciphers. Non-secret fields (cardholder, brand, expiry) are flags; the card number and CVV are read from /dev/tty, never argv. - vault-ipc: typed `CardWrite` (Option per field, serves add+edit; number/code as secret bytes with a redacted `Debug`) rides a serde-defaulted `card` on `Request::Add`/`Edit`; transport round-trip. - vault-core: `from_plain` emits a `Card` for cipher_type 3, mirroring the read-path `decrypt`; from_plain→decrypt card round-trip test. - vault-agent: `add_cipher` decodes the secret bytes into a `PlainCard` before `from_plain`; `apply_cipher_edits` sets only the given card fields (get-or-insert, encrypt-on-change), rejecting card edits on a non-card item; unit-tested. - vault-cli: `KindArg::Card`, `--cardholder`/`--brand`/`--expiry`, `--number`/`--code` bool flags gating tty prompts; `split_expiry` parses MM/YYYY or MM/YY. - vault-tui: thread the new `card: None` through its Add/Edit literals. - docs: README card create/edit, CHANGELOG entry. 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
Makes card (type 3) ciphers writable via the CLI:
vault add --type card …andvault edit <card> …. Cards were already readable end-to-end (PRs #23/#24) butadd/editonly built logins and secure notes.Non-secret fields (cardholder, brand, expiry) are plain flags; the card number and CVV are read from
/dev/tty, never passed as argv (same convention as--password— flags leak to shell history /ps).How
CardWrite(oneOptionper field, serving both addNone=unset and editSome=set;number/codeare secretVec<u8>with a hand-writtenDebugthat redacts them). Rides a#[serde(default)] cardonRequest::Add/Edit(forward-compatible). Transport round-trip test.from_plainemits aCardforcipher_type == 3, the exact inverse of the read-pathdecrypt.from_plain→decryptcard round-trip test.add_cipherdecodes the secret bytes (zeroizing) into aPlainCardbeforefrom_plain;apply_cipher_editssets only the given card fields (get-or-insert aCard, encrypt-on-change), and rejects card edits on a non-card item. Unit-tested.KindArg::Card,--cardholder/--brand/--expiryflags,--number/--codebool flags gating tty prompts;split_expiryparsesMM/YYYYorMM/YY.card: Nonethrough its Add/Edit request literals.Verification
cargo fmt --check, fresh-isolatedclippy -D warnings(pedantic+nursery),cargo test --workspace --all-targets,cargo deny check, and both headless builds all clean.Out of scope (tracked follow-ups)
🤖 Generated with Claude Code