A production-grade, defense-in-depth intake architecture designed to verify trust before allowing any external event into the system. It enforces Header Auth credentials, CORS origin whitelisting, cryptographic HMAC-SHA256 integrity, and strict timestamp freshness (±300s window to eliminate replay attacks) while failing closed on any deviation.
// Ready to inspect dispatch result...
Blocks unauthenticated callers at the edge before n8n spends compute resources. Restricts browser origins to prevent CSRF cross-origin injections.
Hashes the combined timestamp + payload using a shared secret. Guarantees that neither the body parameters nor the event metadata were tampered with in flight.
Prevents attackers from recording valid transmissions and repeating them. Any request older or newer than 5 minutes is rejected with HTTP 403.
Missing headers, corrupt JSON, or signature mismatches trigger immediate termination. Unverified events never propagate downstream to business workflows.