mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-02-06 05:23:08 +00:00
feat(telemetry): capture error messages with security hardening
## Summary Enhanced telemetry system to capture actual error messages for debugging while implementing comprehensive security hardening to protect sensitive data. ## Changes - Added optional errorMessage parameter to trackError() method - Implemented sanitizeErrorMessage() with 7-layer security protection - Updated all production and test call sites (atomic change) - Added 18 new security-focused tests ## Security Fixes - ReDoS Prevention: Early truncation + simplified regex patterns - Full URL Redaction: Changed [URL]/path → [URL] to prevent leakage - Credential Detection: AWS keys, GitHub tokens, JWT, Bearer tokens - Correct Sanitization Order: URLs → credentials → emails → generic - Error Handling: Try-catch wrapper with [SANITIZATION_FAILED] fallback ## Impact - Resolves 272+ weekly errors with no error messages - Protects against ReDoS attacks - Prevents API structure and credential leakage - 90.75% test coverage, 269 tests passing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -233,12 +233,13 @@ describe('TelemetryManager', () => {
|
||||
});
|
||||
|
||||
it('should track errors', () => {
|
||||
manager.trackError('ValidationError', 'Node configuration invalid', 'httpRequest');
|
||||
manager.trackError('ValidationError', 'Node configuration invalid', 'httpRequest', 'Required field "url" is missing');
|
||||
|
||||
expect(mockEventTracker.trackError).toHaveBeenCalledWith(
|
||||
'ValidationError',
|
||||
'Node configuration invalid',
|
||||
'httpRequest'
|
||||
'httpRequest',
|
||||
'Required field "url" is missing'
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user