Use caseEntitlement
Setup start
Use case setup-start của Entitlement đang chờ validation.
Use case: Setup start
Trạng thái
Đang draft.
Service sở hữu
Entitlement Service.
Endpoint
POST /api/setup/start
Yêu cầu xác thực
branch-scoped token.
Mục tiêu
Bắt đầu hoặc resume initial setup cho context workspace/member hiện tại.
Luồng request
Client -> API Gateway -> Entitlement Service -> Entitlement database/Internal dependency -> 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