import type { NextFunction, Request, Response } from 'express'; /** * Per-client-IP rate limits. Hardcoded on purpose (not operator-configurable): * they are a capacity safety net, tuned to shed single-source floods while * staying generous for real users — including many sharing one NAT/corporate * IP. Values are per IP, per window. Note a per-IP limit only stops * single-source floods; a distributed flood needs an edge WAF. */ declare const RULES: { readonly page: { readonly windowMs: 60000; readonly limit: 300; }; readonly api: { readonly windowMs: 60000; readonly limit: 120; }; readonly auth: { readonly windowMs: number; readonly limit: 8; }; }; type Tier = keyof typeof RULES; /** * Decide which limit tier a request falls under. This runs before route * matching, so it classifies on method + path only. Pure — unit-tested in * isolation. */ export declare function classifyRequest(method: string, path: string): Tier | 'exempt'; /** * Site-wide rate limiter. Mounted early (before session/locale/DB work) so * abusive floods are shed with a 429 before they consume a database connection. * Dispatches each request to the matching tier's limiter. */ export declare function rateLimiter(request: Request, response: Response, next: NextFunction): void; export {};