Files
worldmonitor/server/_shared
Elie Habib e48162e9c0 fix(rate-limit): add per-endpoint rate limits for summarize endpoints (#1161)
Cache lookups (summarize-article-cache) shared the global 600/60s IP
rate limit with expensive LLM calls (summarize-article), causing users
to burn rate limit budget on cheap Redis reads.

- Add ENDPOINT_RATE_POLICIES map with per-endpoint limits
- summarize-article POST: 20 req/60s (protect LLM quota)
- summarize-article-cache GET: 3000 req/60s (generous for browsing)
- Two-phase gateway check: endpoint-specific first, global fallback
- Endpoints with specific policy skip global limiter entirely
- Path normalization prevents trailing-slash bypass
2026-03-07 08:51:45 +04:00
..