Skip to main content

Interface: RateLimitOptions

Defined in: service-core/src/decorators/RouteDecorators.ts:336

Configuration options for RateLimiter, read from the rateLimit path of the application configuration.

Extends​

Properties​

id?​

optional id?: string

Defined in: service-core/src/decorators/RouteDecorators.ts:337


ip?​

optional ip?: IPRateLimitConfig

Defined in: service-core/src/RateLimiter.ts:56

Configuration for the additional, independent per-source-IP counter.

Inherited from​

RateLimitConfig.ip


maxAttempts?​

optional maxAttempts?: number

Defined in: service-core/src/RateLimiter.ts:52

The maximum number of attempts allowed within windowSeconds before being rejected. Default is 100. Note that when driven by the @RateLimit decorator without perUser, this counts attempts against the identifier <method>|<path> (see RouteUtils.checkRateLimiter()), i.e. combined across every caller of that route, not per-caller - the default is set well above the per-IP default below for that reason. With perUser the identifier is scoped to the user's uid, or to the client IP for anonymous callers.

Inherited from​

RateLimitConfig.maxAttempts


perUser?​

optional perUser?: boolean

Defined in: service-core/src/decorators/RouteDecorators.ts:338


windowSeconds?​

optional windowSeconds?: number

Defined in: service-core/src/RateLimiter.ts:54

The length of the sliding window, in seconds, that maxAttempts applies to. Default is 60.

Inherited from​

RateLimitConfig.windowSeconds