()
| 118 | const generator = buildKeyGenerator(); |
| 119 | |
| 120 | return rateLimit({ |
| 121 | max: env.RATE_LIMIT_MAX, |
| 122 | duration: env.RATE_LIMIT_WINDOW_MS, |
| 123 | ...(context !== undefined && { context }), |
| 124 | ...(generator !== undefined && { generator }), |
| 125 | }); |
| 126 | }; |
| 127 | |
| 128 | export const buildAuthRateLimit = () => { |
| 129 | const context = buildRateLimitContext("credential"); |
| 130 | const generator = buildKeyGenerator(); |
| 131 | |
| 132 | return rateLimit({ |
| 133 | max: env.AUTH_RATE_LIMIT_MAX, |
| 134 | duration: env.AUTH_RATE_LIMIT_WINDOW_MS, |
| 135 | scoping: "scoped", |
no test coverage detected