Logos DX
    Preparing search index...

    Class RateLimitPolicy<S, H, P>

    Rate limit policy for controlling request rate.

    Uses token bucket algorithm to enforce rate limits. Each unique key (generated by the serializer) gets its own bucket, allowing per-endpoint or per-user rate limiting.

    Uses endpoint-scoped serialization by default (method + path), meaning all requests to the same endpoint share a rate limit bucket regardless of their parameters or payload.

    Type Parameters

    • S = unknown

      Instance state type

    • H = unknown

      Headers type

    • P = unknown

      Params type

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    config: RateLimitConfig<S, H, P> | null = null
    state: RateLimitPolicyState<S, H, P> | null = null

    Extended state with rate limit-specific fields.

    Accessors

    Methods

    • Compute rule configuration for a method+path combination.

      This is the expensive O(n) operation that gets memoized. Finds matching rule and merges with policy defaults.

      Parameters

      • method: string

        HTTP method (uppercase)

      • path: string

        Request path

      Returns RateLimitRule<S, H, P> | null

      Computed rule or null if disabled