multi-party-computation-controller-api
    Preparing search index...

    Rate-limiting guard that keys each throttle bucket on the combination of the client IP address and Bearer token.

    Using both dimensions means:

    • Different IPs with the same token are counted separately (IP-level limit).
    • The same IP using different tokens is also counted separately (token-level limit).

    If no token is present the key degrades gracefully to <ip>: so that unauthenticated probing is also throttled.

    Hierarchy

    • ThrottlerGuard
      • IpBearerThrottlerGuard
    Index

    Constructors

    • Parameters

      • options: ThrottlerModuleOptions
      • storageService: ThrottlerStorage
      • reflector: Reflector

      Returns IpBearerThrottlerGuard

    Properties

    commonOptions: Pick<
        ThrottlerOptions,
        "skipIf"
        | "ignoreUserAgents"
        | "getTracker"
        | "generateKey"
        | "setHeaders",
    >
    errorMessage: string
    headerPrefix: string
    options: ThrottlerModuleOptions
    reflector: Reflector
    storageService: ThrottlerStorage
    throttlers: ThrottlerOptions[]

    Methods

    • Parameters

      • context: ExecutionContext

        Current execution context. Provides access to details about the current request pipeline.

      Returns Promise<boolean>

      Value indicating whether or not the current request is allowed to proceed.

    • Parameters

      • context: ExecutionContext
      • suffix: string
      • name: string

      Returns string

    • Parameters

      • context: ExecutionContext
      • throttlerLimitDetail: ThrottlerLimitDetail

      Returns Promise<string>

    • Parameters

      • context: ExecutionContext

      Returns { req: Record<string, any>; res: Record<string, any> }

    • Builds the throttle storage key for the incoming request.

      Parameters

      • request: Request

        The raw Express request object.

      Returns Promise<string>

      A string key of the form <ip>:<token>.

    • Parameters

      • requestProps: ThrottlerRequest

      Returns Promise<boolean>

    • Returns Promise<void>

    • Parameters

      • _context: ExecutionContext

      Returns Promise<boolean>

    • Parameters

      • context: ExecutionContext
      • throttlerLimitDetail: ThrottlerLimitDetail

      Returns Promise<void>