@@ -52,16 +52,6 @@ export const RateLimiterConfig = z.discriminatedUnion("type", [
5252
5353export type RateLimiterConfig = z . infer < typeof RateLimiterConfig > ;
5454
55- /**
56- * Result of an override lookup for a given Authorization header.
57- *
58- * - `config`: the rate limiter configuration to apply (bucket size). When
59- * absent, the default limiter is used.
60- * - `identifier`: the value to key the rate limit bucket on. When absent, the
61- * hashed Authorization header is used (the legacy per-key behavior). Supply a
62- * stable value (e.g. an environment id) so multiple credentials that should
63- * share a bucket collapse onto one. Never a secret: it lands in Redis keys.
64- */
6555type RateLimitOverride = {
6656 config ?: unknown ;
6757 identifier ?: string ;
@@ -136,8 +126,6 @@ async function resolveRateLimit(
136126 return { config : defaultLimiter } satisfies ResolvedRateLimit ;
137127 }
138128
139- // The identifier (if any) is trusted through even when the config falls back
140- // to the default: bucketing and bucket size are independent concerns.
141129 const identifier = override . identifier ;
142130
143131 if ( ! override . config ) {
@@ -309,9 +297,6 @@ export function authorizationRateLimitMiddleware({
309297 limiterConfigOverride
310298 ) ;
311299
312- // Bucket key: an override-supplied identifier (e.g. environment id, so all
313- // additional API keys for an environment share one bucket) or, by default,
314- // the hashed Authorization header (legacy per-key behavior).
315300 const rateLimitIdentifier = identifier ?? hashedAuthorizationValue ;
316301
317302 const limiter = createLimiterFromConfig ( limiterConfig ) ;
0 commit comments