Current State Gateway - PlutoGr/TravelAgency GitHub Wiki
Gateway
Обновлено: 2026-05-23
Назначение
Gateway — внешняя точка входа:
- YARP reverse proxy до внутренних сервисов
- route-level auth policies
- cookie-to-bearer адаптация
- auth request/response transforms
- rate limiting, CORS, security headers, aggregated health checks
Ключевые маршруты
Сводка вынесена в API-карту.
Техническое поведение
Middleware pipeline
- Forwarded headers
- Security headers (
X-Content-Type-Options,X-Frame-Options, CSP и др.) - Serilog request logging
- CorrelationId middleware
- Global exception middleware
- CORS
- Rate limiting
- Cookie → Authorization header middleware
- Authentication / Authorization
- Auth request middleware (refresh/logout body adaptation)
- Health endpoints + YARP mapping
Cookie/Auth flow
- Входящий
access_tokencookie конвертируется вAuthorization: Bearer .... - Для
refreshиlogoutпри пустом body может быть подставлен refresh token из cookie. - Для login/register/refresh ответы трансформируются: выставляются httpOnly cookies.
Health endpoints
| Method | Route |
|---|---|
| GET | /health/live |
| GET | /health/ready |
/health/ready проверяет доступность downstream сервисов по настроенным URL.
Конфигурация
Ключевые секции:
ReverseProxy(routes/clusters)JwtSettingsCookieRateLimitingCorsHealthCheckEndpointsOtel
Security
- Route-level authorization policies из shared contracts
- JWT validation (issuer/audience/signature/lifetime)
- Базовые secure headers
- CORS whitelist
- Rate limiting
Observability
- Serilog (structured logs + correlation id)
- OpenTelemetry tracing (OTLP endpoint configurable)
- Health checks
Важный интеграционный нюанс
Realtime Chat Hub path требует согласования end-to-end маршрутизации через Gateway и frontend hub URL.