iya-sts
    Preparing search index...
    attempt: (
        what: string,
        req: any,
        identity?: unknown,
        limit?: NamedLimit,
    ) => LimitAnswer = ...

    Type Declaration

      • (what: string, req: any, identity?: unknown, limit?: NamedLimit): LimitAnswer
      • Counts one attempt in this process's buckets and says whether it is allowed.

        Two buckets are counted, by identity (when one is given) and by address, in a fixed window of security.rateLimitWindowS. A refusal is logged and names the bucket that refused.

        Parameters

        • what: string

          the door being limited, part of each bucket's key

        • req: any

          the express request, for the address

        • Optionalidentity: unknown

          optional; the identity attempted

        • Optionallimit: NamedLimit

          optional; a ceiling for both buckets, or { identity, address }, overriding the settings

        Returns LimitAnswer

        { ok: true }, or { ok: false, kind, limit, retryAfterS, detail }