Skip to main content

Module capture

Module capture 

Source
Expand description

Terminal run’s capture: a value a command prints goes straight into the Vault (docs/specs/SPEC_VAULT_GENERATE_CAPTURE_AND_BROWSER_SIGNINS_2026_10_28.md §4.2).

srv holds the command’s output until it ends (crate::backend::shell_node), then Capture::finish applies the rules to its standard output, stores each match as a new entry or as a new value of an existing one (the old value kept 7 days, §4.4), and returns a Scrubber for the values, so the output is published with [vault:<id>] where each was. If a rule matches nothing, srv can’t tell which line held the secret: the output is withheld whole, and kept as a note the person can open with Reveal.

Structs§

Capture
A command’s capture, checked before it runs.
Found
A rule’s value, and the text the output printed it as when that differs (a JSON string’s escaped form), which is cleaned out of the output too.
Job
A capture as the command’s runner holds it: the rules, the store they write to, and a call that tells every Vault pane its entries changed.
Rule

Enums§

Outcome
What a capture came to, once the command ended.
Source
Where a rule finds its value in standard output.
Step
Target
Where one rule’s value goes.

Constants§

CAPTURED
The action an entry’s activity log names a capture by.
MAX_HELD
A card’s other parts (a security code, an expiry, a ZIP) are short by nature: they are taken at any length and then checked against what the scrubber can clean (scrub::cleanable), so none is stored that would still show in the output. The most output held for a capture; past it the capture fails and the output kept for the person is cut here.
MIN_LEN
A shorter value is refused: the output couldn’t be cleaned of it reliably.
MOST
Most rules one command may have.

Functions§

card_found
A card’s parts read from a page, by the keys a parts capture takes: the number as the main value and the rest beside it, ready for Capture::store. The page’s parts are not cleaned out of an output, so they have no minimum length.
clean_held
The held output cleaned of every value, as the lines to publish. It is cleaned as one text, so a multi-line value is found across the lines it was printed on; lines it took up become one. If a line of such a value that is too short for the scrubber to find alone is still there (printed apart from the rest), the output can’t be published: the reason is returned.
extract
One rule’s value in stdout, or why there is none. Never says what it found.
extract_min
extract, taking a value of at least min characters.
json_path
$.a.b[0]['c d'] as steps. $ alone is the whole document.
plan
Checks a command’s capture before it runs: every rule readable, every entry it names there, every new one makeable.

Type Aliases§

HeldLine
One line of held output: its stream, its text and when it was printed.