Setu-TS
    Preparing search index...

    Interface RateLimitOptions

    Options for rate limiting middleware.

    interface RateLimitOptions {
        exclude?: readonly PathPattern[];
        keyGenerator?: (ctx: IRequestContext) => string;
        max: number;
        message?: string;
        standardHeaders?: boolean;
        store?: RateLimitStore;
        windowMs: number;
    }
    Index
    exclude?: readonly PathPattern[]

    Paths exempted from the limiter, matched against IRequest.path. A string is an EXACT match; a RegExp is tested against the path.

    Omitted, this is DEFAULT_RATE_LIMIT_EXCLUDED_PATHS — the six operational paths the framework's own plugins serve. That default exists because the limiter is documented as a global middleware and the CLI scaffolds Kubernetes probes pointing at /live and /ready: without it, an exhausted bucket answers the liveness probe 429 and the kubelet restarts a container whose only fault is that it is under load.

    Pass [] to exempt nothing, which is the pre-0.5.0 behaviour.

    0.5.0

    keyGenerator?: (ctx: IRequestContext) => string

    Key generator function. Defaults to defaultRateLimitKey, which prefers the authenticated principal, then the client IP published by ipSecurityMiddleware, then IRequest.ip, and only then 'anonymous'.

    Supply your own when none of those identify a caller in your deployment — an 'anonymous' key makes the limiter a single GLOBAL counter (see the note on defaultRateLimitKey).

    max: number

    Max requests per window per key.

    message?: string

    Message returned in the 429 body.

    standardHeaders?: boolean

    Emit standard RateLimit-* headers (default: true).

    Custom store implementation. If omitted, a MemoryRateLimitStore is built lazily.

    windowMs: number

    Time window in milliseconds.