diff options
| author | mo khan <mo@mokhan.ca> | 2025-05-24 00:36:41 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-05-24 00:36:41 -0600 |
| commit | 245d770d914719f6fad496e98fb2d1ddfb029b96 (patch) | |
| tree | 0be505ca4679611943eb878c65e9cfb1eddfb784 /app/controllers | |
| parent | 23327d0ce3e641afd1316a112e1c7f9b443abe13 (diff) | |
feat: connect rpc client to inversion of control container
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/sparkles/controller.go | 4 |
1 files changed, 3 insertions, 1 deletions
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 |
