Identity, Access, and Scope Isolation
Identity, Access, and Scope Isolation
หัวข้อที่มีชื่อว่า “Identity, Access, and Scope Isolation”Security Objectives
หัวข้อที่มีชื่อว่า “Security Objectives”- ป้องกัน cross-project และ cross-scope data leakage
- ให้ทุก write path มี owner ชัดเจนและตรวจสิทธิ์ก่อนเสมอ
- ทำให้ deterministic ว่า request ใดควรถูกปฏิเสธ
Enforcement Layers
หัวข้อที่มีชื่อว่า “Enforcement Layers”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)]
Layer-by-Layer Controls
หัวข้อที่มีชื่อว่า “Layer-by-Layer Controls”| Layer | Control |
|---|---|
| Browser/UI | ส่งเฉพาะ scope ตามโหมดและ context ที่ใช้งานจริง |
| Client services | normalize payload ก่อนยิง endpoint |
BFF /api/ai/* | field allowlist + metadata whitelist + scope resolution |
BFF /api/chat/* | thread/message/history scope checks |
| Internal routes | trusted claims required + claim/query mismatch deny |
Scope Isolation Matrix
หัวข้อที่มีชื่อว่า “Scope Isolation Matrix”| Resource | Isolation key |
|---|---|
| Chat thread/message | projectId + threadId |
| Idea/Strategy workspace | projectId + boardId |
| Maps workspace/realtime | projectId + mapId |
| Analytics dashboard | projectId + dashboardId |
| Shared access | shareSessionId + role claims |
Non-Negotiable Rules
หัวข้อที่มีชื่อว่า “Non-Negotiable Rules”- ห้าม bypass BFF เพื่อเรียก inference โดยตรงจาก browser
- ห้าม trust scope จาก client โดยไม่ cross-check กับ persisted mapping
- internal endpoints ต้องตอบ denial ทันทีเมื่อ claims ไม่ตรง
- ต้องบันทึก error ที่เกี่ยวข้องกับ scope mismatch เพื่อ audit และ deprecation planning