Skip to content

Commit ba817b9

Browse files
committed
fix(webapp): keep public API keys on separate rate-limit buckets
1 parent 47f01ab commit ba817b9

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

apps/webapp/app/services/apiRateLimit.server.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ export const apiRateLimiter = authorizationRateLimitMiddleware({
7474

7575
return {
7676
config: authenticatedEnv.environment.organization.apiRateLimiterConfig,
77-
identifier: authenticatedEnv.environment.id,
77+
// Public keys are browser-distributed, so keep them on per-key buckets.
78+
identifier: authenticatedEnv.type === "PRIVATE" ? authenticatedEnv.environment.id : undefined,
7879
};
7980
},
8081
pathMatchers: [/^\/api/],

0 commit comments

Comments
 (0)