semi implemented and features implemented save checkpoint

This commit is contained in:
master
2026-02-08 18:00:49 +02:00
parent 04360dff63
commit 1bf6bbf395
20895 changed files with 716795 additions and 64 deletions

View File

@@ -0,0 +1,23 @@
# Gateway Connection Lifecycle Management
## Module
Gateway
## Status
IMPLEMENTED
## Description
HELLO frame processing for microservice registration, connection lifecycle management with cleanup on disconnect, and `ConnectionManager` hosted service for monitoring active connections.
## Implementation Details
- **Gateway hosted service**: `src/Gateway/StellaOps.Gateway.WebService/Services/GatewayHostedService.cs` -- connection lifecycle management background service
- **Health monitoring**: `src/Gateway/StellaOps.Gateway.WebService/Services/GatewayHealthMonitorService.cs` -- monitors active connections, detects stale instances
- **Metrics**: `src/Gateway/StellaOps.Gateway.WebService/Services/GatewayMetrics.cs` -- connection metrics tracking
- **Configuration**: `src/Gateway/StellaOps.Gateway.WebService/Configuration/GatewayOptions.cs`, `GatewayOptionsValidator.cs`
- **Source**: batch_51/file_22.md
## E2E Test Plan
- [ ] Verify HELLO frame processing registers new microservice connections
- [ ] Test connection cleanup on client disconnect
- [ ] Verify GatewayHealthMonitorService detects stale connections
- [ ] Verify edge cases and error handling

View File

@@ -0,0 +1,31 @@
# Gateway HTTP Middleware Pipeline
## Module
Gateway
## Status
IMPLEMENTED
## Description
Full HTTP middleware pipeline for the Gateway WebService including endpoint resolution, authorization with claims propagation, routing decision, transport dispatch, correlation ID tracking, tenant isolation, health checks, and global error handling.
## Implementation Details
- **Authorization**: `src/Gateway/StellaOps.Gateway.WebService/Authorization/AuthorizationMiddleware.cs` -- endpoint authorization
- **Claims propagation**: `src/Gateway/StellaOps.Gateway.WebService/Middleware/ClaimsPropagationMiddleware.cs` -- propagates authenticated claims to downstream services
- **Correlation ID**: `src/Gateway/StellaOps.Gateway.WebService/Middleware/CorrelationIdMiddleware.cs` -- request correlation tracking
- **Routing**: `src/Gateway/StellaOps.Gateway.WebService/Middleware/RequestRoutingMiddleware.cs` -- route resolution and dispatch
- **Routes**: `src/Gateway/StellaOps.Gateway.WebService/Middleware/GatewayRoutes.cs` -- route definitions
- **Health checks**: `src/Gateway/StellaOps.Gateway.WebService/Middleware/HealthCheckMiddleware.cs`
- **Identity header policy**: `src/Gateway/StellaOps.Gateway.WebService/Middleware/IdentityHeaderPolicyMiddleware.cs` -- identity header enforcement
- **Sender constraints**: `src/Gateway/StellaOps.Gateway.WebService/Middleware/SenderConstraintMiddleware.cs`
- **Tenant isolation**: `src/Gateway/StellaOps.Gateway.WebService/Middleware/TenantMiddleware.cs`
- **Context keys**: `src/Gateway/StellaOps.Gateway.WebService/Middleware/GatewayContextKeys.cs`
- **Security**: `src/Gateway/StellaOps.Gateway.WebService/Security/AllowAllAuthenticationHandler.cs`
- **Source**: batch_51/file_21.md
## E2E Test Plan
- [ ] Verify middleware pipeline executes in correct order
- [ ] Test authorization middleware blocks unauthorized requests
- [ ] Verify correlation IDs propagate through gateway to downstream services
- [ ] Test tenant isolation prevents cross-tenant access
- [ ] Verify edge cases and error handling

View File

@@ -0,0 +1,24 @@
# Gateway Identity Header Strip-and-Overwrite Policy Middleware
## Module
Gateway
## Status
IMPLEMENTED
## Description
Security middleware that enforces identity header integrity at the Gateway/Router level. Strips incoming identity headers from external requests and overwrites them with verified claims from the authenticated session, preventing header spoofing attacks in service-to-service communication.
## Implementation Details
- **Identity header middleware**: `src/Gateway/StellaOps.Gateway.WebService/Middleware/IdentityHeaderPolicyMiddleware.cs` -- strips incoming identity headers and overwrites with verified claims
- **Claims store**: `src/Gateway/StellaOps.Gateway.WebService/Authorization/EffectiveClaimsStore.cs`, `IEffectiveClaimsStore.cs` -- manages effective claims after header processing
- **Authorization middleware**: `src/Gateway/StellaOps.Gateway.WebService/Authorization/AuthorizationMiddleware.cs` -- enforces authorization after identity header processing
- **Sender constraints**: `src/Gateway/StellaOps.Gateway.WebService/Middleware/SenderConstraintMiddleware.cs` -- validates sender identity
- **Source**: SPRINT_8100_0011_0002_gateway_identity_header_hardening.md
## E2E Test Plan
- [ ] Verify incoming identity headers are stripped from external requests
- [ ] Test verified claims replace stripped headers correctly
- [ ] Verify header spoofing attempts are blocked
- [ ] Test service-to-service communication uses verified identity headers
- [ ] Verify edge cases and error handling

View File

@@ -0,0 +1,23 @@
# Router Authority Claims Integration
## Module
Gateway
## Status
IMPLEMENTED
## Description
`IAuthorityClaimsProvider` integration enabling centralized Authority service to override endpoint claim requirements. Three-tier precedence: Code attributes < YAML config < Authority overrides. EffectiveClaimsStore caches resolved claims.
## Implementation Details
- **Effective claims store**: `src/Gateway/StellaOps.Gateway.WebService/Authorization/EffectiveClaimsStore.cs`, `IEffectiveClaimsStore.cs` -- caches resolved claims with three-tier precedence
- **Authorization middleware**: `src/Gateway/StellaOps.Gateway.WebService/Authorization/AuthorizationMiddleware.cs` -- enforces Authority-provided claim requirements
- **Claims propagation**: `src/Gateway/StellaOps.Gateway.WebService/Middleware/ClaimsPropagationMiddleware.cs` -- propagates resolved claims downstream
- **Gateway value parser**: `src/Gateway/StellaOps.Gateway.WebService/Configuration/GatewayValueParser.cs` -- parses configuration values for claims
- **Source**: batch_52/file_09.md
## E2E Test Plan
- [ ] Verify three-tier precedence: code attributes < YAML config < Authority overrides
- [ ] Test EffectiveClaimsStore caching behaves correctly
- [ ] Verify Authority-provided claim overrides take highest priority
- [ ] Test claims propagation to downstream services

View File

@@ -0,0 +1,24 @@
# Router Heartbeat and Health Monitoring
## Module
Gateway
## Status
IMPLEMENTED
## Description
Heartbeat protocol with configurable intervals, `HealthMonitorService` for stale instance detection, ping latency tracking with exponential moving average, Draining health status for graceful shutdown, and automatic instance removal on missed heartbeats.
## Implementation Details
- **Health monitor service**: `src/Gateway/StellaOps.Gateway.WebService/Services/GatewayHealthMonitorService.cs` -- stale instance detection, heartbeat tracking
- **Health check middleware**: `src/Gateway/StellaOps.Gateway.WebService/Middleware/HealthCheckMiddleware.cs` -- health endpoint processing
- **Gateway metrics**: `src/Gateway/StellaOps.Gateway.WebService/Services/GatewayMetrics.cs` -- latency tracking, connection metrics
- **Gateway hosted service**: `src/Gateway/StellaOps.Gateway.WebService/Services/GatewayHostedService.cs` -- connection lifecycle management
- **Options**: `src/Gateway/StellaOps.Gateway.WebService/Configuration/GatewayOptions.cs` -- configurable heartbeat intervals
- **Source**: batch_51/file_23.md
## E2E Test Plan
- [ ] Verify heartbeat protocol detects stale instances
- [ ] Test configurable heartbeat intervals
- [ ] Verify Draining status for graceful shutdown
- [ ] Test automatic instance removal on missed heartbeats

View File

@@ -0,0 +1,23 @@
# Router Payload Size Enforcement
## Module
Gateway
## Status
IMPLEMENTED
## Description
PayloadLimitsMiddleware with per-request, per-connection, and aggregate byte limits using `ByteCountingStream`. Returns HTTP 413 (payload too large), 429 (rate limited), or 503 (service unavailable) with configurable thresholds.
## Implementation Details
- **Gateway options**: `src/Gateway/StellaOps.Gateway.WebService/Configuration/GatewayOptions.cs` -- configurable payload size thresholds
- **Options validator**: `src/Gateway/StellaOps.Gateway.WebService/Configuration/GatewayOptionsValidator.cs` -- validates payload limit configuration
- **Routing middleware**: `src/Gateway/StellaOps.Gateway.WebService/Middleware/RequestRoutingMiddleware.cs` -- request routing with size checks
- **Sender constraints**: `src/Gateway/StellaOps.Gateway.WebService/Middleware/SenderConstraintMiddleware.cs` -- sender-level enforcement
- **Source**: batch_52/file_02.md
## E2E Test Plan
- [ ] Verify HTTP 413 returned for oversized payloads
- [ ] Test per-request, per-connection, and aggregate limits independently
- [ ] Verify configurable thresholds are respected
- [ ] Test HTTP 429 and 503 responses for rate limiting and service unavailability