MCPcopy
hub / github.com/chartbrew/chartbrew / redactScalar

Function redactScalar

server/modules/updateAudit.js:66–75  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

64}
65
66function redactScalar(value) {
67 if (typeof value !== "string") {
68 return value;
69 }
70
71 return value
72 .replace(/Bearer\s+[A-Za-z0-9\-._~+/]+=*/gi, "Bearer [REDACTED]")
73 .replace(/Basic\s+[A-Za-z0-9\-._~+/]+=*/gi, "Basic [REDACTED]")
74 .replace(/(token|password|secret|apikey|api_key)=([^&\s]+)/gi, "$1=[REDACTED]");
75}
76
77function sanitizePayload(value, depth = 0) {
78 if (value === undefined) {

Callers 2

sanitizePayloadFunction · 0.85
sanitizeSnippetFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected