Gateway Trust Model: Protect Internal Services and Service-Level Data #5

Closed
opened 2026-03-29 08:35:00 -05:00 by yusiboyz · 2 comments
Owner

This issue covers gateway trust boundaries and internal service authentication.

Problems:

  • Gateway still treats inventory, budget, reader, books, and music as service-level backends
  • Inventory and Budget are still unauthenticated services
  • Gateway dashboard still pulls global data from those services for any authenticated platform user
  • Service token validation for some services still uses weak health-check semantics

Files:

  • gateway/server.py
  • gateway/dashboard.py
  • services/inventory/server.js
  • services/budget/server.js

Acceptance criteria:

  • Inventory and Budget are protected by an auth layer, even on internal networks
  • Gateway no longer exposes service-global data to arbitrary platform users
  • Dashboard widgets only return data the current user is authorized to see
  • Service trust model is documented and enforced consistently
This issue covers gateway trust boundaries and internal service authentication. Problems: - Gateway still treats inventory, budget, reader, books, and music as service-level backends - Inventory and Budget are still unauthenticated services - Gateway dashboard still pulls global data from those services for any authenticated platform user - Service token validation for some services still uses weak health-check semantics Files: - gateway/server.py - gateway/dashboard.py - services/inventory/server.js - services/budget/server.js Acceptance criteria: - Inventory and Budget are protected by an auth layer, even on internal networks - Gateway no longer exposes service-global data to arbitrary platform users - Dashboard widgets only return data the current user is authorized to see - Service trust model is documented and enforced consistently
yusiboyz added this to the Immediate milestone 2026-03-29 08:43:50 -05:00
Author
Owner

Partial fix in commit fcb9383

Changes:

  • services/inventory/server.js: Added X-API-Key middleware, rejects 401 without key
  • services/budget/server.js: Added X-API-Key middleware, rejects 401 without key
  • gateway/server.py: Proxy injects INVENTORY_SERVICE_API_KEY and BUDGET_SERVICE_API_KEY
  • gateway/dashboard.py: Dashboard fetchers inject API keys
  • gateway/config.py: Added INVENTORY_SERVICE_API_KEY, BUDGET_SERVICE_API_KEY
  • docker-compose.yml: SERVICE_API_KEY env vars for both services + gateway

Verified:

  • Inventory without key: 401 Unauthorized
  • Inventory with key: 200 (data returned)
  • Budget without key: 401 Unauthorized
  • Budget with key: 200 (data returned)
  • Dashboard aggregation works with keys
  • Frontend proxy chain works end-to-end

Remaining:

  • Document trust model
  • Validate service token semantics for fitness/trips
**Partial fix in commit fcb9383** Changes: - `services/inventory/server.js`: Added X-API-Key middleware, rejects 401 without key - `services/budget/server.js`: Added X-API-Key middleware, rejects 401 without key - `gateway/server.py`: Proxy injects INVENTORY_SERVICE_API_KEY and BUDGET_SERVICE_API_KEY - `gateway/dashboard.py`: Dashboard fetchers inject API keys - `gateway/config.py`: Added INVENTORY_SERVICE_API_KEY, BUDGET_SERVICE_API_KEY - `docker-compose.yml`: SERVICE_API_KEY env vars for both services + gateway Verified: - Inventory without key: 401 Unauthorized - Inventory with key: 200 (data returned) - Budget without key: 401 Unauthorized - Budget with key: 200 (data returned) - Dashboard aggregation works with keys - Frontend proxy chain works end-to-end Remaining: - Document trust model - Validate service token semantics for fitness/trips
Author
Owner

Fixed in 4ecd233 — Token validation uses protected endpoints. Trust model documented in docs/trust-model.md. Unknown services rejected.

**Fixed in 4ecd233** — Token validation uses protected endpoints. Trust model documented in docs/trust-model.md. Unknown services rejected.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: yusiboyz/platform#5