Skip to content

Commit 249105e

Browse files
UnbreakableMJclaude
andcommitted
feat(vault): M5 slice 2 — TUI reveal + agent-side clipboard copy
Wire the TUI's detail pane to show and copy secrets, gated on a new agent-side copy path so the plaintext never crosses the socket and the auto-clear survives the TUI quitting. Protocol (vault-ipc): Request::Get gains `id: Option<String>`; new Request::Copy { id, name, field, clear_after_secs } returns Response::Ok. Agent: get_item targets an exact cipher id when given (name is the fallback/label), closing the duplicate-name footgun where copy/reveal could hit the wrong item. New default-on `clipboard` feature holds an arboard handle; the Copy arm decrypts the field, places it on the agent's own clipboard, and schedules a 30s auto-clear that wipes only if the clipboard still holds what we wrote (or can't be read — fail-safe). --no-default-features drops the X11/Wayland tree and declines Copy cleanly. CLI: cmd_get passes `id: None` (behavior unchanged). TUI: Space reveals the selected login's password (id-targeted Get, re-masked on any navigation, held in a zeroizing/Debug-redacted RevealedSecret); c/u/o copy password/username/URI via Copy with a status-bar toast. Copy/reveal act only when the item list is focused. Tests: id-targeting-among-duplicates regression, should_clear_clipboard and clipboard_set-when-None units, a dispatch-level Copy-while-locked test, and TUI reveal/re-mask/toast/Debug-redaction units plus TestBackend smokes for masked/revealed/toast states. Supply-chain: arboard pulls error-code (BSL-1.0, via Windows-only clipboard-win) — added to deny.toml's allow-list (FSF GPL-compatible). No new advisories. Known limitation (tracked): on Quit/stop-agent a pending clear task dies with the runtime, so a just-copied secret can linger until overwritten. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 7c4c0a1 commit 249105e

15 files changed

Lines changed: 976 additions & 40 deletions

File tree

CHANGELOG.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,40 @@ range may break in any release.
1010

1111
### Added
1212

13+
- **M5 (slice 2) — TUI reveal + clipboard copy.** The detail pane is no longer
14+
secret-free: `Space` reveals the selected login's password on demand and
15+
`c` / `u` / `o` copy the password / username / URI to the clipboard, with a
16+
status-bar toast (`copied password · clears in 30s`) and a 30-second
17+
auto-clear. Copy/reveal act only when the item list is focused.
18+
- **Clipboard lives in the agent**, not the TUI. A new `Request::Copy { id,
19+
name, field, clear_after_secs }` has the agent decrypt the field, place it on
20+
its own clipboard (`arboard`, `wayland-data-control`), and schedule the
21+
clear — so the secret never crosses the socket on the copy path, the copy
22+
survives the TUI quitting, and a future `vault get --copy` becomes possible.
23+
The auto-clear task only wipes the clipboard if it still holds what we wrote
24+
(or can't read it back, failing safe), leaving anything the user copied since
25+
untouched. Behind a default-on `clipboard` feature on `vault-agent`; a
26+
`--no-default-features` headless build drops the X11/Wayland tree and answers
27+
`Copy` with a clean "not compiled in" error.
28+
- **Reveal uses `Request::Get`**, which gains an `id: Option<String>` field.
29+
The TUI targets the *exact* selected cipher id, closing a real footgun:
30+
`get_item` matched by name only, so a duplicate item name could reveal/copy
31+
the wrong item. Name remains the fallback selector and error label; the CLI
32+
passes `id: None` (unchanged behavior). Revealed plaintext is held in a
33+
`RevealedSecret` newtype (zeroised on drop, redacted in `Debug`) and
34+
re-masked on any navigation.
35+
- Tests: `vault-agent` gains an id-targeting-among-duplicate-names regression
36+
test and a pure `should_clear_clipboard` unit; `vault-tui` adds reveal /
37+
re-mask / toast / `Debug`-redaction units and `TestBackend` smokes for the
38+
masked-by-default, revealed, and toast states.
39+
- Supply-chain: `arboard` pulls `error-code` (`BSL-1.0`, via Windows-only
40+
`clipboard-win`) — added to `deny.toml`'s allow-list (FSF-confirmed
41+
GPL-compatible). No new advisories (`cargo deny check advisories` clean).
42+
- Known limitation: on `Quit` / `stop-agent` a pending auto-clear task dies
43+
with the runtime, so a just-copied secret can linger on the clipboard until
44+
overwritten (notably under `wayland-data-control`'s serving process). A
45+
clear-on-shutdown sweep is a tracked follow-up.
46+
1347
- **M5 (slice 1) — `vault-tui` skeleton (read-only browser).** The TUI stub is
1448
now a real cruxpass-style three-pane interface (`ratatui` + `crossterm`):
1549
**left** folder list, **center** filterable item list, **right** item detail,

0 commit comments

Comments
 (0)