From 1100a2bd283a684f9a8cc39e222b2ac192a9270e Mon Sep 17 00:00:00 2001 From: Dmitry Salakhov Date: Thu, 20 Oct 2022 10:26:11 +1300 Subject: [PATCH] feat: move jwt lib to v4 (#7773) --- api/go.mod | 2 +- api/go.sum | 4 ++-- api/jwt/jwt.go | 2 +- api/jwt/jwt_kubeconfig_test.go | 2 +- api/jwt/jwt_test.go | 5 ++--- api/oauth/oauth.go | 2 +- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/api/go.mod b/api/go.mod index 14a893825..43803a565 100644 --- a/api/go.mod +++ b/api/go.mod @@ -19,7 +19,7 @@ require ( github.com/go-ldap/ldap/v3 v3.1.8 github.com/go-playground/validator/v10 v10.10.1 github.com/gofrs/uuid v4.0.0+incompatible - github.com/golang-jwt/jwt v3.2.2+incompatible + github.com/golang-jwt/jwt/v4 v4.2.0 github.com/google/go-cmp v0.5.8 github.com/gorilla/handlers v1.5.1 github.com/gorilla/mux v1.7.3 diff --git a/api/go.sum b/api/go.sum index caa5ebd84..bd392a791 100644 --- a/api/go.sum +++ b/api/go.sum @@ -173,8 +173,8 @@ github.com/gofrs/uuid v4.0.0+incompatible h1:1SD/1F5pU8p29ybwgQSwpQk+mwdRrXCYuPh github.com/gofrs/uuid v4.0.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM= github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -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.2.0 h1:besgBTC8w8HjP6NzQdxwKH9Z5oQMZ24ThTrHp3cZ8eU= +github.com/golang-jwt/jwt/v4 v4.2.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= diff --git a/api/jwt/jwt.go b/api/jwt/jwt.go index ec727e7e1..905cbfeee 100644 --- a/api/jwt/jwt.go +++ b/api/jwt/jwt.go @@ -9,7 +9,7 @@ import ( portainer "github.com/portainer/portainer/api" "github.com/portainer/portainer/api/dataservices" - "github.com/golang-jwt/jwt" + "github.com/golang-jwt/jwt/v4" "github.com/gorilla/securecookie" "github.com/rs/zerolog/log" ) diff --git a/api/jwt/jwt_kubeconfig_test.go b/api/jwt/jwt_kubeconfig_test.go index 107f27730..b3796b129 100644 --- a/api/jwt/jwt_kubeconfig_test.go +++ b/api/jwt/jwt_kubeconfig_test.go @@ -3,7 +3,7 @@ package jwt import ( "testing" - "github.com/golang-jwt/jwt" + "github.com/golang-jwt/jwt/v4" portainer "github.com/portainer/portainer/api" "github.com/portainer/portainer/api/dataservices" i "github.com/portainer/portainer/api/internal/testhelpers" diff --git a/api/jwt/jwt_test.go b/api/jwt/jwt_test.go index 82e559aed..e98731eb2 100644 --- a/api/jwt/jwt_test.go +++ b/api/jwt/jwt_test.go @@ -4,10 +4,9 @@ import ( "testing" "time" - i "github.com/portainer/portainer/api/internal/testhelpers" - - "github.com/golang-jwt/jwt" + "github.com/golang-jwt/jwt/v4" portainer "github.com/portainer/portainer/api" + i "github.com/portainer/portainer/api/internal/testhelpers" "github.com/stretchr/testify/assert" ) diff --git a/api/oauth/oauth.go b/api/oauth/oauth.go index 59b960d45..9843258b2 100644 --- a/api/oauth/oauth.go +++ b/api/oauth/oauth.go @@ -11,7 +11,7 @@ import ( portainer "github.com/portainer/portainer/api" - "github.com/golang-jwt/jwt" + "github.com/golang-jwt/jwt/v4" "github.com/pkg/errors" "github.com/rs/zerolog/log" "golang.org/x/oauth2"