fix: address critical code review issues

Fix security and reliability issues identified in code review:

1. Security: Remove non-null assertions in credentials.ts
   - Add proper validation before returning credentials
   - Throw early with clear error messages showing which vars are missing
   - Prevents runtime failures with cryptic undefined errors

2. Reliability: Add pagination safety limits
   - Add MAX_PAGES limit (1000) to all pagination loops
   - Prevents infinite loops if API returns same cursor repeatedly
   - Applies to: cleanupOrphanedWorkflows, cleanupOldExecutions, cleanupExecutionsByWorkflow

Changes ensure safer credential handling and prevent potential infinite loops
in cleanup operations.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
czlonkowski
2025-10-03 13:22:10 +02:00
parent 2305aaab9e
commit 1728495146
4 changed files with 59 additions and 11 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "n8n-mcp-runtime",
"version": "2.15.0",
"version": "2.15.1",
"description": "n8n MCP Server Runtime Dependencies Only",
"private": true,
"dependencies": {