1.2 KiB
1.2 KiB
Task logs - 2025-12-04 12:45
-
Actions:
- Audited codebase for tenant handling, header usage, webui state, ingestion endpoints and tests.
- Updated
specs/001-spec-improvementswith a Reality Check section and normalized header names toX-Tenant-IDandX-KB-IDthroughout. - Added pragmatic next steps and concrete file pointers for frontend and backend changes (no implementation performed).
-
Key findings:
- Frontend already injects
X-Tenant-ID/X-KB-IDheaders using an axios interceptor (lightrag_webui/src/api/client.ts), driven bylocalStoragekeysSELECTED_TENANTandSELECTED_KB. - Backend has existing tenant dependency helpers (
lightrag/api/dependencies.py) that readX-Tenant-IDand provide fallback logic. - e2e tests and scripts already exercise multi-tenant behavior with header usage.
- Frontend already injects
-
Next steps:
- (If asked) Implement
tenantStateManagerin the WebUI and integrate with the existing interceptor. - (If asked) Add server-side snapshot/share-token endpoints and tests.
- (If asked) Implement
-
Notes and recommendations:
- Keep tenant IDs out of URLs and ensure server-side validation.
- Keep tenant identifiers opaque (UUID/numeric internal) and avoid storing secrets in client storage.