/** * Rate Limiting Middleware * Prevents API abuse by limiting requests per identity. * Uses authenticated keyId when available, otherwise request IP. * * Two backends are supported: * - memory (default): in-process Map. Resets on restart; not shared across instances. * - db: Postgres-backed via iranti_rate_limits table. Shared across all instances, * survives restarts. Activate with IRANTI_RATE_LIMIT_BACKEND=db. */ import { NextFunction, Request, Response } from 'express'; interface CheckResult { allowed: boolean; remaining: number; resetAt: number; } interface RateLimiterBackend { check(identity: string): CheckResult | Promise; readonly limit: number; } export declare const rateLimiter: RateLimiterBackend; export declare function rateLimitMiddleware(req: Request, res: Response, next: NextFunction): void; export {}; //# sourceMappingURL=rateLimit.d.ts.map