My App
ServiceAPI Gateway

Routes API Gateway

Route map hiện tại của Go API Gateway cho auth và current-context.

Routes API Gateway

Route map đã dùng trong checkpoint

PathMethodRoute idService nameTargetTrạng thái
/healthzGETlocalGatewaylocal handlerĐã đóng
/api/auth/loginPOSTidentity-authidentity-serviceIdentity ServiceĐã đóng
/api/auth/refreshPOSTidentity-authidentity-serviceIdentity ServiceĐã đóng
/api/auth/select-branchPOSTidentity-authidentity-serviceIdentity ServiceĐã đóng
/api/workspaces/current-contextGETentitlement-workspacesentitlement-serviceEntitlement ServiceReachable, Entitlement chưa đóng

Source route registry:

Route idPatternService name
identity-auth/api/auth/*identity-service
entitlement-workspaces/api/workspaces/*entitlement-service

Auth routes

Gateway proxy auth routes tới Identity Service.

  • POST /api/auth/login là public route.
  • POST /api/auth/refresh là public route.
  • POST /api/auth/select-branch cần account context theo route guard.

accountAccessToken dùng cho select branch, không dùng cho normal business APIs.

Current-context

GET /api/workspaces/current-context match route family:

/api/workspaces/*
→ route_id=entitlement-workspaces
→ service_name=entitlement-service

Trạng thái: route reachable qua Gateway, nhưng Entitlement Service chưa đóng.

CORS

  • OPTIONS là public request.
  • Preflight hợp lệ được xử lý local bởi Gateway.
  • Preflight hợp lệ trả 204.
  • Preflight không proxy xuống downstream service.

Không document là closed

Gateway code có nhiều route patterns khác trong registry. Docs này không đánh dấu các route đó là closed nếu chưa có checkpoint/validation tương ứng.

TODO

  • Chưa đóng: Gateway -> Entitlement E2E cho GET /api/workspaces/current-context.
  • Chưa đóng: route docs cho các service khác sau khi có validation.

On this page