Expand description
Values copied into a worktree from the person’s secret files (a .env
that [worktree] include copies): masked in everything speccoder shows
or hands on — command and check output, tool results, messages — as
[redacted:NAME], each in the forms it may be printed in (as is,
base64, hex, URL-encoded).
The values are held for the process, never written anywhere: masking more than one worktree’s values everywhere is the safe direction.
Constants§
- MIN_LEN
- The shortest value masked: shorter ones are flags and ports.
Functions§
- dotenv
- The
NAME=valuepairs of a dotenv file:exportand quotes dropped (a quoted value may span lines), comments and blank lines skipped. - found_
in - The variable whose value (as is)
textholds, if any. - longest
- The longest form registered, in bytes: how far a value can straddle a cut.
- mask
textwith every registered value, in each of its forms, replaced by[redacted:NAME].- mask_
bytes maskover bytes that need not be UTF-8: each form replaced where it occurs, every other byte kept.- mask_
json maskover every string in a JSON value.- register
- Masks
value(the variablename’s) from now on, in this process; once per name and value. - secret_
name - Whether a variable’s name says its value is secret: what the commands’
environment drops (
crate::verify::process::is_secret), and names withKEY,PASS,PWD,CREDENTIAL,AUTH,PRIVATE,TOKENorDSN. - to_mask
- What a copied secret file’s text gives to mask, as
(NAME, value). A dotenv file (named.env*): the variables whose name says secret (secret_name) — each line of a multi-line value too — and any URL with credentials, whole and its password. Any other file (a key, a.netrc): each line, without PEM’s-----BEGIN …-----markers, under the file’s name, and each line’s last word. - worth_
masking - Whether
valueis worth masking: at leastMIN_LENlong and not a plain number.