(value)
| 64 | } |
| 65 | |
| 66 | function 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 | |
| 77 | function sanitizePayload(value, depth = 0) { |
| 78 | if (value === undefined) { |
no outgoing calls
no test coverage detected