From 4e4fee53bfedff8cd27fc5614774aa77c7964fbc Mon Sep 17 00:00:00 2001 From: James Tombleson Date: Fri, 5 Apr 2024 17:50:29 -0700 Subject: [PATCH] module updates --- api/handlers/v1/demo.go | 5 +++-- api/handlers/v1/handler.go | 9 +++++---- api/handlers/v1/jwt.go | 3 ++- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/api/handlers/v1/demo.go b/api/handlers/v1/demo.go index d8bfcdc..9c888d3 100644 --- a/api/handlers/v1/demo.go +++ b/api/handlers/v1/demo.go @@ -2,9 +2,10 @@ package v1 import ( "fmt" - "go-cook/api/domain" "net/http" + "git.jamestombleson.com/jtom38/go-cook/api/domain" + "github.com/labstack/echo/v4" ) @@ -45,7 +46,7 @@ func (h *Handler) ProtectedRoute(c echo.Context) error { h.ReturnUnauthorizedResponse(c, err.Error()) } - err = token.IsValid(domain.ScopeRecipeRead) + err = token.IsValid(domain.ScopeRecipeRead) if err != nil { h.ReturnUnauthorizedResponse(c, ErrJwtScopeMissing) } diff --git a/api/handlers/v1/handler.go b/api/handlers/v1/handler.go index 8904920..4428740 100644 --- a/api/handlers/v1/handler.go +++ b/api/handlers/v1/handler.go @@ -2,11 +2,12 @@ package v1 import ( "database/sql" - "go-cook/api/domain" - "go-cook/api/repositories" - "go-cook/api/services" "net/http" + "git.jamestombleson.com/jtom38/go-cook/api/repositories" + "git.jamestombleson.com/jtom38/go-cook/api/services" + "git.jamestombleson.com/jtom38/go-cook/api/domain" + "github.com/golang-jwt/jwt/v5" echojwt "github.com/labstack/echo-jwt/v4" "github.com/labstack/echo/v4" @@ -43,7 +44,7 @@ func (h *Handler) Register(v1 *echo.Group) { auth.Use(echojwt.WithConfig(jwtConfig)) auth.POST("/scopes/add", h.AddScopes) auth.POST("/scopes/remove", h.RemoveScopes) - + demo := v1.Group("/demo") demo.GET("/hello", h.DemoHello) demo.GET("/hello/:who", h.HelloWho) diff --git a/api/handlers/v1/jwt.go b/api/handlers/v1/jwt.go index 88da586..6bf9530 100644 --- a/api/handlers/v1/jwt.go +++ b/api/handlers/v1/jwt.go @@ -2,10 +2,11 @@ package v1 import ( "errors" - "go-cook/api/domain" "strings" "time" + "git.jamestombleson.com/jtom38/go-cook/api/domain" + "github.com/golang-jwt/jwt/v5" )