From 64680468fd712d7365781f4519d1b8e8de5f1b7f Mon Sep 17 00:00:00 2001 From: Simone Gotti Date: Fri, 10 Sep 2021 12:33:59 +0200 Subject: [PATCH] *: migrate to golang-jwt/jwt Migrate to the new community maintained version of github.com/dgrijalva/jwt-go --- go.mod | 2 +- go.sum | 2 ++ internal/services/common/jwt.go | 2 +- internal/services/gateway/action/user.go | 2 +- internal/services/gateway/gateway.go | 2 +- internal/services/gateway/handlers/auth.go | 4 ++-- 6 files changed, 8 insertions(+), 6 deletions(-) diff --git a/go.mod b/go.mod index 1caa952..fa2ebc9 100644 --- a/go.mod +++ b/go.mod @@ -8,11 +8,11 @@ require ( github.com/Microsoft/hcsshim v0.8.7 // indirect github.com/bmatcuk/doublestar v1.2.2 github.com/containerd/continuity v0.0.0-20200107194136-26c1120b8d41 // indirect - github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/docker/docker v1.13.1 github.com/elazarl/go-bindata-assetfs v1.0.0 github.com/ghodss/yaml v1.0.0 github.com/go-bindata/go-bindata v1.0.0 + github.com/golang-jwt/jwt/v4 v4.0.0 github.com/google/go-cmp v0.4.0 github.com/google/go-containerregistry v0.0.0-20200212224832-c629a66d7231 github.com/google/go-github/v29 v29.0.3 diff --git a/go.sum b/go.sum index b54996e..eeb1ad5 100644 --- a/go.sum +++ b/go.sum @@ -158,6 +158,8 @@ github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7a github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d h1:3PaI8p3seN09VjbTYC/QWlUZdZ1qS1zGjy7LH2Wt07I= github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/golang-jwt/jwt/v4 v4.0.0 h1:RAqyYixv1p7uEnocuy8P1nru5wprCh/MH2BIlW5z5/o= +github.com/golang-jwt/jwt/v4 v4.0.0/go.mod h1:/xlHOz8bRuivTWchD4jCa+NbatV+wEUSzwAxVc6locg= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20160516000752-02826c3e7903 h1:LbsanbbD6LieFkXbj9YNNBupiGHJgFeLpO0j0Fza1h8= diff --git a/internal/services/common/jwt.go b/internal/services/common/jwt.go index c2ee0c9..2f538a5 100644 --- a/internal/services/common/jwt.go +++ b/internal/services/common/jwt.go @@ -19,7 +19,7 @@ import ( "encoding/json" "time" - jwt "github.com/dgrijalva/jwt-go" + "github.com/golang-jwt/jwt/v4" errors "golang.org/x/xerrors" ) diff --git a/internal/services/gateway/action/user.go b/internal/services/gateway/action/user.go index 9fd88c7..3c7695a 100644 --- a/internal/services/gateway/action/user.go +++ b/internal/services/gateway/action/user.go @@ -30,7 +30,7 @@ import ( csapitypes "agola.io/agola/services/configstore/api/types" cstypes "agola.io/agola/services/configstore/types" - jwt "github.com/dgrijalva/jwt-go" + "github.com/golang-jwt/jwt/v4" errors "golang.org/x/xerrors" ) diff --git a/internal/services/gateway/gateway.go b/internal/services/gateway/gateway.go index c1048e2..f37552c 100644 --- a/internal/services/gateway/gateway.go +++ b/internal/services/gateway/gateway.go @@ -32,7 +32,7 @@ import ( csclient "agola.io/agola/services/configstore/client" rsclient "agola.io/agola/services/runservice/client" - jwt "github.com/dgrijalva/jwt-go" + "github.com/golang-jwt/jwt/v4" ghandlers "github.com/gorilla/handlers" "github.com/gorilla/mux" "go.uber.org/zap" diff --git a/internal/services/gateway/handlers/auth.go b/internal/services/gateway/handlers/auth.go index 072f566..1d4c331 100644 --- a/internal/services/gateway/handlers/auth.go +++ b/internal/services/gateway/handlers/auth.go @@ -22,8 +22,8 @@ import ( "agola.io/agola/internal/services/common" csclient "agola.io/agola/services/configstore/client" - jwt "github.com/dgrijalva/jwt-go" - jwtrequest "github.com/dgrijalva/jwt-go/request" + "github.com/golang-jwt/jwt/v4" + jwtrequest "github.com/golang-jwt/jwt/v4/request" "go.uber.org/zap" errors "golang.org/x/xerrors" )