Kiến trúc
Gateway và Identity
Phân biệt trách nhiệm của API Gateway và Identity Service.
Gateway và Identity là hai runtime authority riêng.
API Gateway
- Route request từ client.
- Validate branch-scoped token cho protected business API.
- Chuyển public auth request tới Identity.
- Inject trusted headers sau validation.
- Propagate
X-Request-IdvàX-Correlation-Id.
Identity Service
- Authenticate account.
- Issue account-scoped token và branch-scoped token.
- Sở hữu refresh/session rotation.
- Publish JWKS.
- Resolve branch selection.
Rule
Identity issue token. Gateway validate token ở edge và chuyển token claims thành internal trusted headers.