droboticflow/internal/api/routes_acceptance.go
d-robotics 994fa59982 ♻️ Split API route registration into per-domain routes_*.go files
routes.go keeps only the global middleware chain, the shared business-role
sets, and one mount call per domain: system, dashboard, acceptance, human
loop, annotation, projects, organization, workflows, runs, delivery, data
platform, and object sync. Role-only groups become withRoles/With on the
routes they guard, so each route's permission sits next to it instead of in
a role-shaped group far from the rest of its domain.

No route, handler, or access change: testdata/routes.golden (generated from
the pre-split router) is byte-identical, the Go known-failure gate passes,
and a live API smoke against a throwaway DB matched the access matrix for
every parameter-free GET route across six identities.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-18 18:50:40 +08:00

11 lines
466 B
Go

package api
import "github.com/go-chi/chi/v5"
// mountAcceptanceRoutes registers POC acceptance evidence import and the
// readiness report.
func (server *server) mountAcceptanceRoutes(router chi.Router) {
router.With(server.requirePocAcceptanceImportAccess).Post("/api/acceptance/poc-operator-result", server.handlePocAcceptanceImport)
router.With(server.requireAdminMonitoringAccess).Get("/api/acceptance/poc-readiness", server.handlePocAcceptanceReadiness)
}