1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-01-31 00:16:47 +01:00
unleash.unleash/src/lib/util
Christopher Kolstad b06613d1b0
feat: Adds rate limiting to metric POST endpoints (#5075)
### What
The heaviest requests we serve are the register and metrics POSTs from
our SDKs/clients.
This PR adds ratelimiting to /api/client/register, /api/client/metrics,
/api/frontend/register and /api/frontend/metrics with a default set to
6000 requests per minute (or 100 rps) for each of the endpoints.

It will be overrideable by the environment variables documented.

### Points of discussion
@kwasniew already suggested using featuretoggles with variants to
control the rate per clientId. I struggled to see if we could
dynamically update the middleware after initialisation, so this attempt
will need a restart of the pod to update the request limit.
2023-10-18 13:00:44 +02:00
..
validators
anonymise.test.ts
anonymise.ts
anyEventEmitter.test.ts
anyEventEmitter.ts
arraysHaveSameItems.test.ts
arraysHaveSameItems.ts
collapseHourlyMetrics.test.ts fix: fix variant metrics (#3947) 2023-06-09 12:48:32 +00:00
collapseHourlyMetrics.ts fix: fix variant metrics (#3947) 2023-06-09 12:48:32 +00:00
collect-ids.ts
constants.ts feat: roles unification (#3999) 2023-06-19 09:41:40 +01:00
constantTimeCompare.test.ts
constantTimeCompare.ts
db-lock.test.ts feat: Adds rate limiting to metric POST endpoints (#5075) 2023-10-18 13:00:44 +02:00
db-lock.ts
ensureArray.ts feat: Advanced playground table (#3978) 2023-06-15 09:29:31 +00:00
ensureStringValue.test.ts
ensureStringValue.ts
escape-regex.ts
extract-user.test.ts fix: extract username from user should not return undefined (#5061) 2023-10-17 09:18:44 +01:00
extract-user.ts fix: extract username from user should not return undefined (#5061) 2023-10-17 09:18:44 +01:00
findDuplicates.test.ts feat: import service validate duplicates (#4558) 2023-08-24 10:05:21 +02:00
findDuplicates.ts feat: biome lint (#4853) 2023-09-29 14:18:21 +02:00
findPublicFolder.ts
flag-resolver.test.ts
flag-resolver.ts
format-base-uri.test.ts
format-base-uri.ts
generateImageUrl.ts
get-prop-from-string.ts
graceful-shutdown.ts
index.ts
is-email.test.ts
is-email.ts fix: some security vulnerabilities (#4143) 2023-07-05 11:51:27 +02:00
isDefined.test.ts
isDefined.ts
isEmpty.ts
load-index-html.ts fix: correct escaping of ui flags for plausible (#3907) 2023-07-07 17:40:37 +02:00
map-values.test.ts
map-values.ts
metrics-helper.ts
omit-keys.test.ts
omit-keys.ts
parseEnvVar.test.ts
parseEnvVar.ts
random-id.ts
rewriteHTML.test.ts
rewriteHTML.ts
segments.ts
semver.test.ts
semver.ts
snakeCase.test.ts
snakeCase.ts
time-utils.test.ts
time-utils.ts
timer.test.ts
timer.ts
unique.test.ts
unique.ts
validateJsonString.test.ts
validateJsonString.ts
validateOrigin.test.ts
validateOrigin.ts
version.ts