mirror of
https://github.com/czlonkowski/n8n-mcp.git
synced 2026-03-20 09:23:07 +00:00
feat: implement Phase 2 validation improvements
Phase 2 Professional Validation Features: 1. Validation Profiles: - minimal: Only required fields - runtime: Critical errors + security warnings - ai-friendly: Balanced (default) - strict: All checks + best practices 2. New Node Validators: - Webhook: Path validation, response modes, auth warnings - PostgreSQL: SQL injection detection, query safety - MySQL: Similar to Postgres with MySQL-specific checks 3. New Tools: - validate_node_minimal: Lightning-fast required field checking - Updated validate_node_operation with profile support 4. SQL Safety Features: - Detects template expressions vulnerable to injection - Warns about DELETE/UPDATE without WHERE - Catches dangerous operations (DROP, TRUNCATE) - Suggests parameterized queries 5. Enhanced Coverage: - Now supports 7+ major nodes with specific validators - Flexible validation based on use case - Professional-grade safety checks This completes the major validation system overhaul from the original plan. 🤖 Generated with Claude Code Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -304,28 +304,7 @@ export class ConfigValidator {
|
||||
warnings: ValidationWarning[],
|
||||
suggestions: string[]
|
||||
): void {
|
||||
// Path validation
|
||||
if (config.path) {
|
||||
if (config.path.startsWith('/')) {
|
||||
warnings.push({
|
||||
type: 'inefficient',
|
||||
property: 'path',
|
||||
message: 'Webhook path should not start with /',
|
||||
suggestion: 'Remove the leading / from the path'
|
||||
});
|
||||
}
|
||||
|
||||
if (config.path.includes(' ')) {
|
||||
warnings.push({
|
||||
type: 'inefficient',
|
||||
property: 'path',
|
||||
message: 'Webhook path contains spaces',
|
||||
suggestion: 'Use hyphens or underscores instead of spaces'
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Response mode suggestions
|
||||
// Basic webhook validation - moved detailed validation to NodeSpecificValidators
|
||||
if (config.responseMode === 'responseNode' && !config.responseData) {
|
||||
suggestions.push('When using responseMode=responseNode, add a "Respond to Webhook" node to send custom responses');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user