Expand description
Redact credentials from JSON before it is displayed or logged.
Startup parameters and actions are echoed in two places an operator reads: the
open_client / open_server summary pushed to the dashboard and MCP status stream, and the
executor’s per-action DEBUG line in netget.log. Both printed the RADIUS client’s shared
secret, the MQTT client’s password and anything else of that kind verbatim. The protocol
still receives the real value; only what is shown is replaced.
Matching is by key name, case-insensitively, on a substring, so secret, shared_secret,
password, bind_password and api_key are all caught. A false positive costs a line of
display; a false negative prints a credential.
Constants§
- DISPLAY_
ONLY_ KEY_ PARTS - Substrings of a key name whose value is masked wherever it is displayed, without making the request that carries it private.
- MAX_
REDACT_ DEPTH - Deepest nesting walked.
serde_jsonrefuses to parse past 128 levels, so a parsed value never reaches this; a value built in code might, and past it the subtree is shown asREDACTEDwhole rather than walked on a shrinking stack. - REDACTED
- What a redacted value is shown as.
- SENSITIVE_
KEY_ PARTS - Substrings of a key name that mark its value as a credential.
Functions§
- actions_
have_ credentials - Whether this request offers an action that can carry credentials. Such model replies can be malformed or plain text, so hiding whole payloads is safer than trying to recover credential fields from an unparseable response.
- contains_
credentials - Detect credential-bearing structured input without cloning or recursive traversal. A budget-exceeding input is private because its remaining keys cannot be proven safe. Null credential fields do not contain a value. Bounds apply to node count, depth and retained string/key content; no request-wide or global privacy state is retained.
- hide_
error_ details - Remove untyped context from a private request’s error while preserving the numeric overload category that protocols use to choose a retryable wire reply.
- is_
sensitive_ entry - Whether a key/value pair holds a credential.
- is_
sensitive_ key - Whether a key names a credential.
- is_
shown_ redacted - Whether a key/value pair is shown as
REDACTED: everyis_sensitive_entry, plus theDISPLAY_ONLY_KEY_PARTS. - redact_
sensitive - A copy of
valuewith every credential-named key’s value replaced byREDACTED, at any depth up toMAX_REDACT_DEPTH.