From c6d5fa02d121dbb8ed3472f7470b9f3e945b354a Mon Sep 17 00:00:00 2001 From: Alexey Date: Wed, 17 Dec 2025 14:24:07 +0200 Subject: [PATCH] add base for auth package --- api/auth/handle.go | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 api/auth/handle.go diff --git a/api/auth/handle.go b/api/auth/handle.go new file mode 100644 index 0000000..6011d6f --- /dev/null +++ b/api/auth/handle.go @@ -0,0 +1,32 @@ +package auth + +import ( + "net/http" + + "git.oblat.lv/alex/triggerssmith/internal/config" + "github.com/go-chi/chi/v5" +) + +type authHandler struct { + cfg *config.Config +} + +func Route(config *config.Config) func(chi.Router) { + h := &authHandler{ + cfg: config, + } + return func(r chi.Router) { + r.Get("/login", h.handleLogin) + r.Get("/logout", h.handleLogout) + r.Get("/me", h.handleMe) + r.Get("/revoke", h.handleRevoke) + } +} + +func (h *authHandler) handleLogin(w http.ResponseWriter, r *http.Request) {} + +func (h *authHandler) handleLogout(w http.ResponseWriter, r *http.Request) {} + +func (h *authHandler) handleMe(w http.ResponseWriter, r *http.Request) {} + +func (h *authHandler) handleRevoke(w http.ResponseWriter, r *http.Request) {} \ No newline at end of file