Add improvements 2
This commit is contained in:
@@ -352,6 +352,25 @@ headers = {
|
||||
- **Caching**: Gateway caches validated service tokens for 5 minutes
|
||||
- **No Additional HTTP Calls**: Service auth happens locally at gateway
|
||||
|
||||
### Unified Header Management System
|
||||
|
||||
The gateway uses a **centralized HeaderManager** for consistent header handling across all middleware and proxy layers.
|
||||
|
||||
**Key Features:**
|
||||
- Standardized header names and conventions
|
||||
- Automatic header sanitization to prevent spoofing
|
||||
- Unified header injection and forwarding
|
||||
- Cross-middleware header access via `request.state.injected_headers`
|
||||
- Consistent logging and error handling
|
||||
|
||||
**Standard Headers:**
|
||||
- `x-user-id`, `x-user-email`, `x-user-role`, `x-user-type`
|
||||
- `x-service-name`, `x-tenant-id`
|
||||
- `x-subscription-tier`, `x-subscription-status`
|
||||
- `x-is-demo`, `x-demo-session-id`, `x-demo-account-type`
|
||||
- `x-tenant-access-type`, `x-can-view-children`, `x-parent-tenant-id`
|
||||
- `x-forwarded-by`, `x-request-id`
|
||||
|
||||
### Context Header Injection
|
||||
|
||||
When a service token is validated, the gateway injects these headers for downstream services:
|
||||
|
||||
Reference in New Issue
Block a user