From 245d770d914719f6fad496e98fb2d1ddfb029b96 Mon Sep 17 00:00:00 2001 From: mo khan Date: Sat, 24 May 2025 00:36:41 -0600 Subject: feat: connect rpc client to inversion of control container --- app/controllers/sparkles/controller.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'app/controllers') diff --git a/app/controllers/sparkles/controller.go b/app/controllers/sparkles/controller.go index bd7264e..ccf68b1 100644 --- a/app/controllers/sparkles/controller.go +++ b/app/controllers/sparkles/controller.go @@ -3,10 +3,12 @@ package sparkles import ( "net/http" + "github.com/xlgmokha/x/pkg/ioc" "github.com/xlgmokha/x/pkg/log" "github.com/xlgmokha/x/pkg/mapper" "github.com/xlgmokha/x/pkg/serde" "github.com/xlgmokha/x/pkg/x" + "gitlab.com/gitlab-org/software-supply-chain-security/authorization/authzd.git/pkg/rpc" "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/domain" "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/app/middleware" "gitlab.com/gitlab-org/software-supply-chain-security/authorization/sparkled/pkg/pls" @@ -25,7 +27,7 @@ func (c *Controller) MountTo(mux *http.ServeMux) { mux.Handle("POST /sparkles", x.Middleware[http.Handler]( http.HandlerFunc(c.Create), middleware.RequireUser(), - // middleware.RequirePermission("create_sparkle", nil), + middleware.RequirePermission("create_sparkle", ioc.MustResolve[rpc.Ability](ioc.Default)), )) // This is a temporary endpoint to restore a backup -- cgit v1.2.3