ShortURL: Fix tests and small refactor (#108871)

This commit is contained in:
Ezequiel Victorero
2025-07-30 10:31:11 -03:00
committed by GitHub
parent bb45dc88ac
commit 006ea8e1b9
3 changed files with 40 additions and 9 deletions
+3 -4
View File
@@ -176,7 +176,6 @@ func (hs *HTTPServer) registerRoutes() {
r.Get("/import/dashboard", reqSignedIn, hs.Index)
r.Get("/dashboards/", reqSignedIn, hs.Index)
r.Get("/dashboards/*", reqSignedIn, hs.Index)
r.Get("/goto/:uid", reqSignedIn, hs.redirectFromShortURL, hs.Index)
if hs.Cfg.PublicDashboardsEnabled {
// list public dashboards
@@ -264,6 +263,9 @@ func (hs *HTTPServer) registerRoutes() {
providerParam := ac.Parameter(":provider")
r.Get("/admin/authentication/:provider", authorize(ac.EvalPermission(ac.ActionSettingsRead, ac.ScopeSettingsOAuth(providerParam))), hs.Index)
// ShortURL API
hs.registerShortURLAPI(r)
// authed api
r.Group("/api", func(apiRoute routing.RouteRegister) {
// user (signed in)
@@ -549,9 +551,6 @@ func (hs *HTTPServer) registerRoutes() {
// Some channels may have info
liveRoute.Get("/info/*", routing.Wrap(hs.Live.HandleInfoHTTP))
}, requestmeta.SetSLOGroup(requestmeta.SLOGroupNone))
// short urls
apiRoute.Post("/short-urls", routing.Wrap(hs.createShortURL))
}, reqSignedIn)
// admin api