MCPcopy Index your code
hub / github.com/BuilderIO/agent-native / redactString

Function redactString

packages/core/src/tools/proxy-security.ts:90–98  ·  view source on GitHub ↗
(text: string, secretValues: string[])

Source from the content-addressed store, hash-verified

88}
89
90export function redactString(text: string, secretValues: string[]): string {
91 let out = text;
92 for (const secret of secretValues) {
93 for (const candidate of redactionCandidates(secret)) {
94 if (candidate) out = out.split(candidate).join("[redacted]");
95 }
96 }
97 return out;
98}
99
100function redactionCandidates(secret: string): string[] {
101 const candidates = new Set([secret]);

Callers 4

createFetchToolEntryFunction · 0.85
redactSecretsFunction · 0.85
handleProxyFunction · 0.85

Calls 1

redactionCandidatesFunction · 0.85

Tested by

no test coverage detected