MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / redactSecrets

Function redactSecrets

source code/bridge/debugUtils.ts:28–36  ·  view source on GitHub ↗
(s: string)

Source from the content-addressed store, hash-verified

26const REDACT_MIN_LENGTH = 16
27
28export function redactSecrets(s: string): string {
29 return s.replace(SECRET_PATTERN, (_match, field: string, value: string) => {
30 if (value.length < REDACT_MIN_LENGTH) {
31 return `"${field}":"[REDACTED]"`
32 }
33 const redacted = `${value.slice(0, 8)}...${value.slice(-4)}`
34 return `"${field}":"${redacted}"`
35 })
36}
37
38/** Truncate a string for debug logging, collapsing newlines. */
39export function debugTruncate(s: string): string {

Callers 1

debugBodyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected