* Strip connection strings, credentials, and other secrets from error messages * before forwarding to Slack.
(msg: string)
| 214 | * before forwarding to Slack. |
| 215 | */ |
| 216 | function sanitizeForSlack(msg: string): string { |
| 217 | return msg |
| 218 | .replace(/\b\w+:\/\/[^\s]+@[^\s]+/g, '[REDACTED_URL]') |
| 219 | .replace(/password[=:]\s*\S+/gi, 'password=[REDACTED]') |
| 220 | .replace(/\b(sk|pk|api[_-]?key|secret|token)[_-]?\w*[=:]\s*\S+/gi, '$1=[REDACTED]'); |
| 221 | } |
| 222 | |
| 223 | /** |
| 224 | * Bridge logger.error() to the #aao-errors Slack channel via notifySystemError. |
no outgoing calls
no test coverage detected