UNPKG

@aikidosec/firewall

Version:

Zen by Aikido is an embedded Web Application Firewall that autonomously protects Node.js apps against common and critical attacks

32 lines (31 loc) 902 B
import type { ExecutionArgs } from "graphql/execution/execute"; import { FieldNode } from "graphql"; import { Agent } from "../../agent/Agent"; import { Context } from "../../agent/Context"; import type { Endpoint } from "../../agent/Config"; type Result = { block: false; } | { block: true; field: FieldNode; source: "ip"; remoteAddress: string; operationType: "query" | "mutation"; endpoint: Endpoint; } | { block: true; field: FieldNode; source: "user"; userId: string; operationType: "query" | "mutation"; endpoint: Endpoint; } | { block: true; field: FieldNode; source: "group"; groupId: string; operationType: "query" | "mutation"; endpoint: Endpoint; }; export declare function shouldRateLimitOperation(agent: Agent, context: Context, executeArgs: Pick<ExecutionArgs, "document" | "operationName">): Result; export {};