@suluk/hono - v0.1.5
    Preparing search index...

    Interface EnforceRateLimitConfig

    interface EnforceRateLimitConfig {
        operationOf: (c: Context) => string | undefined;
        rateLimitOf: (operation: string) => SulukRateLimit | undefined;
        store?: RateLimitStore;
        keyOf?: (c: Context, facet: SulukRateLimit) => string;
        now?: () => number;
        defaultFacet?: SulukRateLimit;
    }
    Index

    Properties

    operationOf: (c: Context) => string | undefined

    Resolve the contract operation for a request (undefined ⇒ a non-contract path, passed through).

    rateLimitOf: (operation: string) => SulukRateLimit | undefined

    The declared rate budget for an operation (e.g. read off the document's x-suluk-ratelimit).

    The durable counter (default: a per-instance MemoryRateLimitStore — DEV ONLY).

    keyOf?: (c: Context, facet: SulukRateLimit) => string

    Derive the caller key from a request + facet (default: client IP from x-forwarded-for / x-real-ip).

    now?: () => number

    The clock (default: Date.now) — the single source of now.

    defaultFacet?: SulukRateLimit

    A blanket budget applied to operations that declare none (escape hatch; default: unmetered).