1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-07-17 13:46:47 +02: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 Clean up old errors (#3633) 2023-05-11 11:10:57 +02:00
anonymise.test.ts test: add anonymise unit tests (#3722) 2023-05-09 14:20:39 +01:00
anonymise.ts fix: anonymise PII fields in user access if flag is set (#3773) 2023-05-15 14:12:03 +02:00
anyEventEmitter.test.ts
anyEventEmitter.ts feat: shared event emitter (#3241) 2023-03-02 09:52:19 +01:00
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 feat: postgres lock (#3443) 2023-04-04 13:28:17 +02:00
ensureArray.ts feat: Advanced playground table (#3978) 2023-06-15 09:29:31 +00:00
ensureStringValue.test.ts
ensureStringValue.ts
escape-regex.ts Fix crashing search bars (#2765) 2022-12-28 12:35:27 +02:00
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 fix: properly handle flag resolver variants (#3808) 2023-05-18 17:04:55 +01:00
flag-resolver.ts fix: properly handle flag resolver variants (#3808) 2023-05-18 17:04:55 +01:00
format-base-uri.test.ts
format-base-uri.ts chore: drop event hook (#3565) 2023-04-21 09:44:18 +02:00
generateImageUrl.ts
get-prop-from-string.ts Clean up old errors (#3633) 2023-05-11 11:10:57 +02:00
graceful-shutdown.ts
index.ts refactor: playground in feature oriented architecture (#3942) 2023-06-09 12:55:54 +02:00
is-email.test.ts chore: add linter rules for regexp (#3500) 2023-04-17 07:11:22 +00:00
is-email.ts fix: some security vulnerabilities (#4143) 2023-07-05 11:51:27 +02:00
isDefined.test.ts
isDefined.ts
isEmpty.ts Poc: calculate etag based on query and latest revison id (#3062) 2023-03-17 14:10:21 +01:00
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 chore: drop event hook (#3565) 2023-04-21 09:44:18 +02:00
random-id.ts
rewriteHTML.test.ts task: Add Unit test result check task (#3695) 2023-05-25 11:03:54 +00:00
rewriteHTML.ts task: Add Unit test result check task (#3695) 2023-05-25 11:03:54 +00:00
segments.ts chore: expand default segment limits to 1000 (#3710) 2023-05-08 14:44:48 +02:00
semver.test.ts
semver.ts refactor: avoid inlining segments for supported clients (#1640) 2022-06-02 14:07:46 +02:00
snakeCase.test.ts
snakeCase.ts
time-utils.test.ts
time-utils.ts
timer.test.ts
timer.ts
unique.test.ts feat: expose project members (#3310) 2023-03-14 16:27:57 +01:00
unique.ts feat: expose project members (#3310) 2023-03-14 16:27:57 +01:00
validateJsonString.test.ts
validateJsonString.ts
validateOrigin.test.ts
validateOrigin.ts
version.ts