Use caseGateway
Public auth routing
Use case Gateway để route public authentication request tới Identity.
Use case: Public auth routing
Trạng thái
Đã validate.
Service sở hữu
API Gateway.
Endpoint
POST /api/auth/login
Yêu cầu xác thực
Public.
Mục tiêu
Route public authentication request tới Identity mà không cần bearer token.
Luồng request
Client -> API Gateway -> Identity Service -> Identity database -> Response
Hành vi token và header
Client gửi:
- Authorization:
- Cookie:
Gateway inject:
- X-Account-Id
- X-Workspace-Id
- X-Member-Id
- X-Active-Branch-Id
- X-Branch-Ids
- X-Roles
- X-Token-Scope
- X-Request-Id
- X-Correlation-Id
Contract API
Request
{}Response thành công
{}Response lỗi
- TODO
Hành vi database
Đọc:
- TODO
Ghi:
- TODO
Quy tắc quan trọng:
- Không trust workspaceId từ request body nếu context đã có trong token/header.
- Dùng Gateway trusted headers cho downstream context.
- Enforce isolation workspace/member.
Log và observability
Log kỳ vọng:
- Gateway access log
- Owner service access log
- propagation request_id/correlation_id
Tiêu chí nghiệm thu
- Happy path chạy.
- Case token không hợp lệ chạy.
- Case workspace/member bị disabled chạy khi áp dụng.
- Format lỗi theo convention CenterOS.
- Log có request_id/correlation_id.
- Bruno/local smoke test pass.
Bằng chứng test
# TODOCâu hỏi mở
- TODO