ข้ามไปยังเนื้อหา

Identity, Access, and Scope Isolation

  • ป้องกัน cross-project และ cross-scope data leakage
  • ให้ทุก write path มี owner ชัดเจนและตรวจสิทธิ์ก่อนเสมอ
  • ทำให้ deterministic ว่า request ใดควรถูกปฏิเสธ
flowchart TB
  U[User Session/Auth] --> R[Route + Client Context]
  R --> B[BFF Auth + Scope Validation]
  B --> I[Internal Trusted Claims Validation]
  I --> D[(Scoped Data Access)]
LayerControl
Browser/UIส่งเฉพาะ scope ตามโหมดและ context ที่ใช้งานจริง
Client servicesnormalize payload ก่อนยิง endpoint
BFF /api/ai/*field allowlist + metadata whitelist + scope resolution
BFF /api/chat/*thread/message/history scope checks
Internal routestrusted claims required + claim/query mismatch deny
ResourceIsolation key
Chat thread/messageprojectId + threadId
Idea/Strategy workspaceprojectId + boardId
Maps workspace/realtimeprojectId + mapId
Analytics dashboardprojectId + dashboardId
Shared accessshareSessionId + role claims
  1. ห้าม bypass BFF เพื่อเรียก inference โดยตรงจาก browser
  2. ห้าม trust scope จาก client โดยไม่ cross-check กับ persisted mapping
  3. internal endpoints ต้องตอบ denial ทันทีเมื่อ claims ไม่ตรง
  4. ต้องบันทึก error ที่เกี่ยวข้องกับ scope mismatch เพื่อ audit และ deprecation planning