From c583bcd1473205104a1e1af812ed4976d30c7baa Mon Sep 17 00:00:00 2001 From: mo khan Date: Fri, 2 May 2025 14:29:41 -0600 Subject: refactor: remove anything unrelated to the authz daemon --- pkg/app/app.go | 25 ------------------------- pkg/app/routes.go | 18 ------------------ 2 files changed, 43 deletions(-) delete mode 100644 pkg/app/app.go delete mode 100644 pkg/app/routes.go (limited to 'pkg/app') diff --git a/pkg/app/app.go b/pkg/app/app.go deleted file mode 100644 index 89a2bd34..00000000 --- a/pkg/app/app.go +++ /dev/null @@ -1,25 +0,0 @@ -package app - -import ( - "os" - - "github.com/xlgmokha/x/pkg/log" - "gitlab.com/mokhax/spike/pkg/authz" - "gitlab.com/mokhax/spike/pkg/cfg" - "gitlab.com/mokhax/spike/pkg/srv" -) - -func Start(bindAddr string) error { - logger := log.New(os.Stdout, log.Fields{"app": "gtwy"}) - mux := authz.HTTP(authz.WithCasbin(), Routes()) - return srv.Run(cfg.New( - bindAddr, - cfg.WithMux(log.HTTP(logger)(mux)), - cfg.WithTLS([]string{ - "api.example.com", - "authzd.example.com", - "idp.example.com", - "ui.example.com", - }), - )) -} diff --git a/pkg/app/routes.go b/pkg/app/routes.go deleted file mode 100644 index ff1291c2..00000000 --- a/pkg/app/routes.go +++ /dev/null @@ -1,18 +0,0 @@ -package app - -import ( - "net/http" - - "gitlab.com/mokhax/spike/pkg/prxy" -) - -func Routes() http.Handler { - mux := http.NewServeMux() - mux.Handle("/", prxy.New(map[string]string{ - "api.example.com": "http://localhost:8284", - "authzd.example.com": "http://localhost:50051", - "idp.example.com": "http://localhost:8282", - "ui.example.com": "http://localhost:8283", - })) - return mux -} -- cgit v1.2.3