Expand description
Secret shape judgment, the secret: reference grammar and Sealed<T>
. Detection is shape-table-first, entropy-second;
both are hand-written, regex-free, backtracking-free and float-free —
entropy runs in fixed point so the judgment is deterministic and
kani-provable. False positives are the accepted normal: the entrance
replaces losslessly, only the exits refuse.
The part crates/kernel/spec/Secret.lean specifies this module.
Structs§
- Sealed
- A value that cannot reach any sink: no Debug, no Display, no serde,
no Clone; drop zeroizes (secrecy::SecretBox). Expose call sites are
whitelisted by
xtask secret(EXPOSE_WHITELIST). - Secret
Ref secret:<realm>/<name>. Deliberately a separate parser from Locator: sharing the grammar would mean a read path could resolve a secret (7.1’s type-level answer). Malformed shapes areE_CONFIG_INVALID.- Secret
Span - One detected span.
providernames the shape-table entry;Noneis an entropy hit. The span carries offsets only — never the bytes (a finding that quoted its match would itself be a leak surface).
Functions§
- names_
a_ credential - Whether a name reads as the name of a credential.
- scan
- Custody’s detection half. Shape table first;
entropy second over token runs of at least [
ENTROPY_SPAN_MIN_BYTES] that no shape already claimed. Pure, total, deterministic.