wasScanTruncated (core/redactor.ts)

open-second-brain · src/core/redactor.ts · typescript · MIT
auth

Redacts secrets and normalizes text fields for secure data handling.

// Source: https://github.com/itechmeat/open-second-brain | License: MIT | Copyright 2026 Open Second Brain contributors
// Provided via justclaw.it.com; keep this notice with the code.
/**
 * Best-effort secret redactor + text-field normaliser shared across
 * the Brain writers.
 *
 * The redactor catches six secret-bearing keys in four assignment
 * shapes:
 *
 *   key=value                     env-style assignments, including a
 *                                 prefixed name (`ANTHROPIC_API_KEY=…`)
 *   key: value                    YAML / log lines / single-line `key: token`
 *   "key": "value"                JSON object entries
 *   Authorization: Bearer <token> HTTP authorization header (special case)
 *
 * Each match keeps the key (and surrounding quoting) and replaces the
 * value

... (truncated -- full source via MCP)

See the full source, get the GitHub permalink, and search for more like it.

Get a free API key