Fluxion::Executor::Redaction
Removes secrets and terminal control sequences from anything Fluxion is about to show, log, or persist.
Two independent jobs, both mandatory:
- Secrets must not reach the terminal, the state file, or a plan. A profile
legitimately carries tokens in
env, and package managers echo URLs, so the leak paths are ordinary rather than exotic. - Untrusted text must not be able to drive the terminal. Package names, command output, and remote error messages all end up on screen; without stripping, any of them could move the cursor, clear the display, or forge a line of Fluxion's own output.
Constants
A quoted string or a bare token. Used as the value half of every
assignment pattern so --token "a b" masks the whole quoted value.
Names that almost always hold a secret. Written once and reused for
environment variables, --flag value pairs, and name=value text.
Instance methods
Masks the literal values of sensitive environment variables.
Pattern matching cannot catch a token that looks like an ordinary word, so when Fluxion knows the actual secret it replaces it directly.
Full treatment for a line of command output.
Sanitizes an argv vector for display.
Handled per argument rather than on the joined string so an argument
following a sensitive flag is masked whole โ --password hunter2 hides
the value even though hunter2 looks like nothing in particular.
A single line safe to print: no control sequences, no secrets, no embedded newlines that could forge a second line of output.
True when a name suggests its value is a secret. Splits camelCase first
so githubToken is caught as well as GITHUB_TOKEN.
Strips everything that could steer the terminal.
Escape sequences are removed in order โ OSC, then CSI, then anything else introduced by ESC โ because an OSC payload can legitimately contain bytes that look like the start of a CSI sequence.