diff --git a/go.mod b/go.mod index 4de2bdde1..9885697ff 100644 --- a/go.mod +++ b/go.mod @@ -3,7 +3,7 @@ module github.com/labstack/echo/v4 go 1.17 require ( - github.com/golang-jwt/jwt v3.2.2+incompatible + github.com/golang-jwt/jwt/v4 v4.4.1 github.com/labstack/gommon v0.3.1 github.com/stretchr/testify v1.7.0 github.com/valyala/fasttemplate v1.2.1 diff --git a/go.sum b/go.sum index f66734243..ff04f6b34 100644 --- a/go.sum +++ b/go.sum @@ -1,8 +1,8 @@ github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= -github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY= -github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +github.com/golang-jwt/jwt/v4 v4.4.1 h1:pC5DB52sCeK48Wlb9oPcdhnjkz1TKt1D/P7WKJ0kUcQ= +github.com/golang-jwt/jwt/v4 v4.4.1/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= github.com/labstack/gommon v0.3.1 h1:OomWaJXm7xR6L1HmEtGyQf26TEn7V6X88mktX9kee9o= github.com/labstack/gommon v0.3.1/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM= github.com/mattn/go-colorable v0.1.11 h1:nQ+aFkoE2TMGc0b68U2OKSexC+eq46+XwZzWXHRmPYs= diff --git a/middleware/jwt.go b/middleware/jwt.go index bec5167e2..60edb5de3 100644 --- a/middleware/jwt.go +++ b/middleware/jwt.go @@ -6,10 +6,11 @@ package middleware import ( "errors" "fmt" - "github.com/golang-jwt/jwt" - "github.com/labstack/echo/v4" "net/http" "reflect" + + "github.com/golang-jwt/jwt/v4" + "github.com/labstack/echo/v4" ) type ( @@ -107,7 +108,7 @@ type ( // ParseTokenFunc defines a user-defined function that parses token from given auth. Returns an error when token // parsing fails or parsed token is invalid. - // Defaults to implementation using `github.com/golang-jwt/jwt` as JWT implementation library + // Defaults to implementation using `github.com/golang-jwt/jwt/v4` as JWT implementation library ParseTokenFunc func(auth string, c echo.Context) (interface{}, error) } diff --git a/middleware/jwt_test.go b/middleware/jwt_test.go index eee9df966..51a7526cd 100644 --- a/middleware/jwt_test.go +++ b/middleware/jwt_test.go @@ -12,7 +12,7 @@ import ( "strings" "testing" - "github.com/golang-jwt/jwt" + "github.com/golang-jwt/jwt/v4" "github.com/labstack/echo/v4" "github.com/stretchr/testify/assert" ) @@ -25,7 +25,7 @@ type jwtCustomInfo struct { // jwtCustomClaims are custom claims expanding default ones. type jwtCustomClaims struct { - *jwt.StandardClaims + *jwt.RegisteredClaims jwtCustomInfo }