MCPcopy Create free account
hub / github.com/boringstack-xyz/boringstack / buildRateLimit

Function buildRateLimit

apps/api/src/config/security/security.ts:108–118  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

106 * This app-level limit is the second line of defence.
107 */
108export const buildRateLimit = () => {
109 const context = buildRateLimitContext();
110 const generator = buildKeyGenerator();
111
112 return rateLimit({
113 max: env.RATE_LIMIT_MAX,
114 duration: env.RATE_LIMIT_WINDOW_MS,
115 ...(context !== undefined && { context }),
116 ...(generator !== undefined && { generator }),
117 });
118};
119
120export const buildAuthRateLimit = () => {
121 const context = buildRateLimitContext();

Callers 1

createAppFunction · 0.90

Calls 2

buildRateLimitContextFunction · 0.85
buildKeyGeneratorFunction · 0.85

Tested by

no test coverage detected