UNPKG

@aikidosec/firewall

Version:

Zen by Aikido is an embedded Application Firewall that autonomously protects Node.js apps against common and critical attacks, provides rate limiting, detects malicious traffic (including bots), and more.

32 lines (31 loc) 804 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ReportingAPIForTesting = void 0; class ReportingAPIForTesting { constructor(result = { success: true, endpoints: [], configUpdatedAt: 0, heartbeatIntervalInMS: 10 * 60 * 1000, blockedUserIds: [], allowedIPAddresses: [], }) { this.result = result; this.events = []; } setResult(result) { this.result = result; } // oxlint-disable-next-line require-await async report(token, event, timeoutInMS) { this.events.push(event); return this.result; } clear() { this.events = []; } getEvents() { return this.events; } } exports.ReportingAPIForTesting = ReportingAPIForTesting;