Skip to main content

Module log_sanitizer

Module log_sanitizer 

Source
Expand description

Prepares logs and issue text for publication with @link-foundation/sensitive-data-sanitizer, the sanitizer shared by start-command, gh-upload-log and hive-mind (issue #250).

The library CLI runs with --credentials-only, --env-secrets and --gh-config; it streams the log from stdin, keeps invalid UTF-8 bytes and writes a new private file atomically (--output). Its error messages are value-free and only their ERR_* code is kept here.

Since 0.12.1 the library masks only the scheme and token of an Authorization: <scheme> <value> header, so a logged one-line JSON prompt keeps the rest of its line (issue #249, sensitive-data-sanitizer#45); the pre-pass that did this here is gone (issue #253).

Structs§

PreparedLog
Private temporary copy; dropping it removes its file and directory.

Constants§

BLOCK_SIZE
MINIMUM_VERSION
Requires control-byte preservation, placeholders and bounded dense scanning.
OVERRIDE
Path of the library CLI to use instead of the one on PATH.
PACKAGE
The library version the JavaScript package depends on.

Functions§

ensure_sanitizer_available
Install the library CLI with an available JavaScript package manager when it is missing or older than MINIMUM_VERSION.
find_sanitizer
The library CLI: START_SENSITIVE_DATA_SANITIZER, else sensitive-data-sanitizer on PATH.
parse_version
major.minor.patch from --version output such as 0.12.1.
sanitize_log_to_temp
Create a private sanitized copy of a log. The source is never modified; any failure removes the copy and returns a value-free message.
sanitize_log_to_temp_with_env
sanitize_text
Sanitize a short text, such as the failing command quoted in an issue.
sanitize_text_with_env