summaryrefslogtreecommitdiff
path: root/app/controllers/dashboard
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2025-05-26 10:08:55 -0600
committermo khan <mo@mokhan.ca>2025-05-26 10:08:55 -0600
commitb54998f78dc2229e5500f6ac22ef24869a3dac0a (patch)
treeddf4bc22cda1d64e17e0b845edaa4b796f7638e2 /app/controllers/dashboard
parent3d6cdf0b3d6fa23509208e2355a7b7d26400a8ea (diff)
parentf5011f9b32b33ef78405e624d223194ff4b0bd7f (diff)
Merge branch 'envoy-authn-header' into 'main'
Improve startup, logging, and authorization integration See merge request gitlab-org/software-supply-chain-security/authorization/sparkled!11
Diffstat (limited to 'app/controllers/dashboard')
-rw-r--r--app/controllers/dashboard/controller.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/controllers/dashboard/controller.go b/app/controllers/dashboard/controller.go
index 097834f..04a7ed1 100644
--- a/app/controllers/dashboard/controller.go
+++ b/app/controllers/dashboard/controller.go
@@ -3,6 +3,7 @@ package dashboard
import (
"net/http"
+ "github.com/xlgmokha/x/pkg/x"
"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/cfg"
"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/middleware"
"gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/views"
@@ -17,9 +18,11 @@ func New() *Controller {
}
func (c *Controller) MountTo(mux *http.ServeMux) {
- requireUser := middleware.RequireUser()
+ mux.Handle("GET /dashboard", x.Middleware[http.Handler](
+ http.HandlerFunc(c.Show),
+ middleware.RequireUser(),
+ ))
- mux.Handle("GET /dashboard", requireUser(http.HandlerFunc(c.Show)))
mux.Handle("GET /dashboard/nav", http.HandlerFunc(c.Navigation))
}