kafka/internal
Franz Kafka ebeaeeef21 feat: add CORS and rate limiting middleware
CORS:
- Configurable allowed origins (wildcard "*" or specific domains)
- Handles OPTIONS preflight with configurable methods, headers, max-age
- Exposed headers support for browser API access
- Env override: CORS_ALLOWED_ORIGINS

Rate Limiting:
- In-memory per-IP sliding window counter
- Configurable request limit and time window
- Background goroutine cleans up stale IP entries
- HTTP 429 with Retry-After header when exceeded
- Extracts real IP from X-Forwarded-For and X-Real-IP (proxy-aware)
- Env overrides: RATE_LIMIT_REQUESTS, RATE_LIMIT_WINDOW, RATE_LIMIT_CLEANUP_INTERVAL
- Set requests=0 in config to disable

Both wired into main.go as middleware chain: rate_limit → cors → handler.
Config example updated with [cors] and [rate_limit] sections.
Full test coverage for both middleware packages.
2026-03-21 15:54:52 +00:00
..
cache feat: Valkey cache for search results 2026-03-21 15:43:47 +00:00
config feat: add CORS and rate limiting middleware 2026-03-21 15:54:52 +00:00
contracts feat: build Go-based SearXNG-compatible search service 2026-03-20 20:34:08 +01:00
engines feat: build Go-based SearXNG-compatible search service 2026-03-20 20:34:08 +01:00
httpapi feat: build Go-based SearXNG-compatible search service 2026-03-20 20:34:08 +01:00
middleware feat: add CORS and rate limiting middleware 2026-03-21 15:54:52 +00:00
search feat: Valkey cache for search results 2026-03-21 15:43:47 +00:00
upstream feat: build Go-based SearXNG-compatible search service 2026-03-20 20:34:08 +01:00