@suluk/core - v0.1.13
    Preparing search index...

    Interface SulukRateLimit

    RATE-LIMIT facet shape (saastarter-parity Phase 0): the per-operation rate budget an operation DECLARES. Orthogonal to the NORMATIVE spec, which holds rate-limiting out-of-scope (C012 / frontier #43, ceiling 0.74): like x-suluk-cost/access/source this is a vendor extension in the x-suluk-* namespace, never a normative OAS construct. Advisory only — the facet declares the budget; the middleware enforces it.

    windowMs + maxRequests are the fixed-window budget, ported from saastarter's checkRateLimit opts (src/lib/effect/rate-limit.ts:16-19). key is the declared key STRATEGY the runtime resolves a concrete key from: only "ip" is saastarter-faithful (it keys by a resolved IP); "principal"/"api-key"/"global" are ORIGINATED extensions (honestly-low ceiling — "principal" keying is gated on the Principal-model decision, roadmap Open-Decision #5, so the Phase-0 middleware implements only "ip" + a caller-supplied override).

    interface SulukRateLimit {
        windowMs: number;
        maxRequests: number;
        key: "ip" | "principal" | "api-key" | "global";
        scope?: string;
        description?: string;
    }
    Index

    Properties

    windowMs: number

    fixed window length, milliseconds.

    maxRequests: number

    max requests permitted per resolved key within the window.

    key: "ip" | "principal" | "api-key" | "global"

    the key STRATEGY (the runtime derives the concrete key). "ip" is the faithful default.

    scope?: string

    optional sub-bucket name — lets two operations share or separate a budget (advisory).

    description?: string