1
0
mirror of https://github.com/Unleash/unleash.git synced 2025-11-10 01:19:53 +01:00
unleash.unleash/src/lib/middleware
Gastón Fournier 7ea0c9ca9b
feat: support different etags per environment (#10512)
## About the changes
This PR introduces environment-specific etags. This way clients will not
react by updating features when there are changes in environments the
SDK doesn't care about.

## Details
There's a bit of scouting work (please don't make me split this 🙏)
and other details are in comments, but the most relevant for the lazy
ones:
- Important **decision** on how we detect changes, unifying polling and
delta:
https://github.com/Unleash/unleash/pull/10512#discussion_r2285677129
- **Decision** on how we update revision id per environment:
https://github.com/Unleash/unleash/pull/10512#discussion_r2291888401
- and how we do initial fetch on the read path:
https://github.com/Unleash/unleash/pull/10512#discussion_r2291884777
- The singleton pattern that gave me **nightmares**:
https://github.com/Unleash/unleash/pull/10512#discussion_r2291848934
- **Do we still have ALL_ENVS tokens?**
https://github.com/Unleash/unleash/pull/10512#discussion_r2291913249

## Feature flag
To control the rollout introduced `etagByEnv` feature:
[0da567d](0da567dd9b)
2025-08-22 10:35:17 -03:00
..
api-token-middleware.test.ts feat: incorporate backend as a valid api token type replacing client (#10500) 2025-08-21 09:43:54 -03:00
api-token-middleware.ts feat: support different etags per environment (#10512) 2025-08-22 10:35:17 -03:00
audit-middleware.test.ts feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
audit-middleware.ts feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
authorization-middleware.ts feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
bearer-token-middleware.test.ts task: migrate tests to vitest 2025-05-16 11:19:10 +02:00
bearer-token-middleware.ts feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
catch-all-error-handler.ts feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
conditional-middleware.ts chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00
content_type_checker.test.ts task: migrate tests to vitest 2025-05-16 11:19:10 +02:00
content_type_checker.ts feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
cors-origin-middleware.test.ts chore!: remove deprecated POST ui-config endpoint (#10027) 2025-05-26 10:22:16 +01:00
cors-origin-middleware.ts feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
demo-authentication.e2e.test.ts feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
demo-authentication.ts feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
index.ts feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
integration-headers.test.ts feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
integration-headers.ts feat: resolve useragent source and add as source label to metrics (#7883) 2024-08-15 13:25:42 +02:00
no-authentication.test.ts feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
no-authentication.ts feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
origin-middleware.test.ts task: migrate tests to vitest 2025-05-16 11:19:10 +02:00
origin-middleware.ts feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
oss-authentication.test.ts feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
oss-authentication.ts feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
pat-middleware.test.ts task: migrate tests to vitest 2025-05-16 11:19:10 +02:00
pat-middleware.ts feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
rbac-middleware.test.ts feat: incorporate backend as a valid api token type replacing client (#10500) 2025-08-21 09:43:54 -03:00
rbac-middleware.ts feat: support different etags per environment (#10512) 2025-08-22 10:35:17 -03:00
request-logger.ts feat: decouple error impact metrics from logger (#10311) 2025-07-04 13:41:19 +02:00
response-time-metrics.test.ts task: migrate tests to vitest 2025-05-16 11:19:10 +02:00
response-time-metrics.ts feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
secure-headers.ts feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
session-db.ts feat: Unleash v7 ESM migration (#9877) 2025-05-14 09:47:12 +02:00
unless-middleware.ts chore: Bump biome and configure husky (#6589) 2024-03-18 13:58:05 +01:00