WeKnora/internal/router
wizardchen 234110b540 refactor(router): split the 2390-line router.go by domain and dedupe the file proxies
router.go now holds only engine assembly (RouterParams / NewRouter /
trustedProxies, 300 lines); the Register* functions move to domain files —
routes_auth_tenant.go, routes_knowledge.go, routes_chat.go, routes_agent.go,
routes_infra.go — and the five file-proxy surfaces (/files, KB-scoped files,
presigned, presigned-preview, /r/:token grants) move to files.go with the
frontend SPA server in static.go. Pure moves; every route, guard chain and
API-key policy declaration is unchanged, as verified by the existing route
tests and the startup policy self-check.

files.go additionally consolidates the plumbing the four handlers each
hand-rolled: LOCAL_STORAGE_BASE_DIR resolution (localStorageAbsDir),
backend-ID/provider parsing (parseStorageTarget), file_path query validation
(requireFilePathQuery), resource-catalog tenancy mapping
(resolveCatalogResource), tenant-storage resolution with and without the
global-service fallback, and the shared success response including HEAD
short-circuit (streamStoredFile).

Also reattaches the RegisterMCPServiceRoutes doc comment that had been
stranded on top of RegisterSystemAdminRoutes, drops the swagger blank import
duplicated into every split file, and documents why AllowCredentials is
inert under the wildcard CORS origin.
2026-07-27 11:25:23 +08:00
..
files.go refactor(router): split the 2390-line router.go by domain and dedupe the file proxies 2026-07-27 11:25:23 +08:00
rbac.go feat(api-keys): add platform-scoped API keys for control-plane automation 2026-07-21 17:21:35 +08:00
rbac_selfcheck_test.go Refine scoped API key capabilities 2026-07-07 12:00:13 +08:00
router.go refactor(router): split the 2390-line router.go by domain and dedupe the file proxies 2026-07-27 11:25:23 +08:00
router_api_key_capabilities_test.go fix(knowledge): restrict source file download to Editor and above 2026-07-23 22:19:39 +08:00
router_api_key_management_test.go Refine scoped API key capabilities 2026-07-07 12:00:13 +08:00
router_files_test.go fix(api-keys): allow scoped file serve and ingest batch routes 2026-07-20 19:52:13 +08:00
router_knowledge_download_test.go fix(knowledge): restrict source file download to Editor and above 2026-07-23 22:19:39 +08:00
router_presigned_test.go refactor(api-keys): remove API key reset endpoint and update documentation 2026-07-07 12:00:13 +08:00
router_static_test.go feat(resource): add stable resource registry with LLM-context alias compaction 2026-07-15 17:02:43 +08:00
router_wiki_test.go Refine scoped API key capabilities 2026-07-07 12:00:13 +08:00
routes_agent.go refactor(router): split the 2390-line router.go by domain and dedupe the file proxies 2026-07-27 11:25:23 +08:00
routes_auth_tenant.go refactor(router): split the 2390-line router.go by domain and dedupe the file proxies 2026-07-27 11:25:23 +08:00
routes_chat.go refactor(router): split the 2390-line router.go by domain and dedupe the file proxies 2026-07-27 11:25:23 +08:00
routes_infra.go refactor(router): split the 2390-line router.go by domain and dedupe the file proxies 2026-07-27 11:25:23 +08:00
routes_knowledge.go refactor(router): split the 2390-line router.go by domain and dedupe the file proxies 2026-07-27 11:25:23 +08:00
static.go refactor(router): split the 2390-line router.go by domain and dedupe the file proxies 2026-07-27 11:25:23 +08:00
sync_task.go feat(chat): add session-scoped temporary attachments with async parsing 2026-07-16 17:41:27 +08:00
task.go feat(chat): add session-scoped temporary attachments with async parsing 2026-07-16 17:41:27 +08:00
task_inspector.go feat(runtime): add bulk purge for archived queue tasks and chat_attachment i18n 2026-07-23 16:52:35 +08:00
task_inspector_errors.go fix(task-inspector): handle lazy queue not found errors 2026-07-23 14:24:21 +08:00
task_inspector_errors_test.go fix(task-inspector): handle lazy queue not found errors 2026-07-23 14:24:21 +08:00
task_inspector_kb_cancel_test.go fix(tasks): dequeue work for deleted knowledge bases 2026-07-23 12:17:14 +08:00
task_inspector_runtime_test.go fix(task-inspector): handle lazy queue not found errors 2026-07-23 14:24:21 +08:00