From c3dd15c7437ef765cdf84a42fe63539c38355a89 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Wed, 20 May 2026 23:06:31 +0000 Subject: [PATCH] docs(routes): mark test mirror handlers as keep-in-sync with production The newTestAuthApp helper duplicates production route handlers inline because it cannot use RegisterAuthRoutes (which requires a *application.Application). Naming the source path on each mirror makes the drift contract explicit for future maintainers. Refs: #9862 Signed-off-by: Ettore Di Giacinto --- core/http/routes/auth_test.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/http/routes/auth_test.go b/core/http/routes/auth_test.go index 3e0e6ef23..561d3fde9 100644 --- a/core/http/routes/auth_test.go +++ b/core/http/routes/auth_test.go @@ -286,7 +286,9 @@ func newTestAuthApp(db *gorm.DB, appConfig *config.ApplicationConfig) *echo.Echo return c.JSON(http.StatusOK, map[string]string{"message": "user deleted"}) }, adminMw) - // GET /api/auth/usage/sources - mirror of production handler + // Mirror of production handler in routes/auth.go GET /api/auth/usage/sources. + // Keep this body in sync with the real handler; this test app cannot call + // RegisterAuthRoutes because it needs a *application.Application. e.GET("/api/auth/usage/sources", func(c echo.Context) error { user := auth.GetUser(c) if user == nil { @@ -305,7 +307,8 @@ func newTestAuthApp(db *gorm.DB, appConfig *config.ApplicationConfig) *echo.Echo }) }) - // GET /api/auth/admin/usage/sources - mirror of production handler + // Mirror of production handler in routes/auth.go GET /api/auth/admin/usage/sources. + // Keep this body in sync with the real handler. e.GET("/api/auth/admin/usage/sources", func(c echo.Context) error { period := c.QueryParam("period") if period == "" {