From 3e4a9017f478af85770c7960c9d2a42af8cc51e9 Mon Sep 17 00:00:00 2001 From: Jamie Strandboge Date: Thu, 22 Jul 2021 17:12:43 -0500 Subject: [PATCH] chore: use community maintained golang-jwt The dgrijalva/jwt-go project is no longer maintained[1] and they have transferred ownership to golang-jwt/jwt[2][3][4]. The following was performed: 1. update services/httpd/handler*.go to import golang-jwt/jwt 2. revert testcase string comparison changes from 225bcecd (back to v3) 2. go mod edit -require github.com/golang-jwt/jwt@v3.2.1+incompatible 3. go mod edit -droprequire github.com/dgrijalva/jwt-go 4. go mod tidy 5. go clean ./... && go build ./... 6. go test ./... References: [1] dgrijalva/jwt-go#462 [2] dgrijalva/jwt-go#463 [3] https://github.com/dgrijalva/jwt-go/blob/master/README.md [4] https://github.com/golang-jwt/jwt --- DEPENDENCIES.md | 2 +- go.mod | 2 +- go.sum | 5 ++--- services/httpd/handler.go | 2 +- services/httpd/handler_test.go | 2 +- 5 files changed, 6 insertions(+), 7 deletions(-) diff --git a/DEPENDENCIES.md b/DEPENDENCIES.md index 227268d106e..df0c844e9cb 100644 --- a/DEPENDENCIES.md +++ b/DEPENDENCIES.md @@ -9,11 +9,11 @@ - github.com/cespare/xxhash [MIT LICENSE](https://github.com/cespare/xxhash/blob/master/LICENSE.txt) - github.com/clarkduvall/hyperloglog [MIT LICENSE](https://github.com/clarkduvall/hyperloglog/blob/master/LICENSE) - github.com/davecgh/go-spew/spew [ISC LICENSE](https://github.com/davecgh/go-spew/blob/master/LICENSE) -- github.com/dgrijalva/jwt-go [MIT LICENSE](https://github.com/dgrijalva/jwt-go/blob/master/LICENSE) - github.com/dgryski/go-bits [MIT LICENSE](https://github.com/dgryski/go-bits/blob/master/LICENSE) - github.com/dgryski/go-bitstream [MIT LICENSE](https://github.com/dgryski/go-bitstream/blob/master/LICENSE) - github.com/glycerine/go-unsnap-stream [MIT LICENSE](https://github.com/glycerine/go-unsnap-stream/blob/master/LICENSE) - github.com/gogo/protobuf/proto [BSD LICENSE](https://github.com/gogo/protobuf/blob/master/LICENSE) +- github.com/golang-jwt/jwt [MIT LICENSE](https://github.com/golang-jwt/jwt/blob/master/LICENSE) - github.com/golang/protobuf [BSD LICENSE](https://github.com/golang/protobuf/blob/master/LICENSE) - github.com/golang/snappy [BSD LICENSE](https://github.com/golang/snappy/blob/master/LICENSE) - github.com/google/go-cmp [BSD LICENSE](https://github.com/google/go-cmp/blob/master/LICENSE) diff --git a/go.mod b/go.mod index 10de30830bd..da69955c401 100644 --- a/go.mod +++ b/go.mod @@ -10,9 +10,9 @@ require ( github.com/boltdb/bolt v1.3.1 github.com/cespare/xxhash v1.1.0 github.com/davecgh/go-spew v1.1.1 - github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1 github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8 github.com/gogo/protobuf v1.3.1 + github.com/golang-jwt/jwt v3.2.1+incompatible github.com/golang/snappy v0.0.1 github.com/google/go-cmp v0.5.0 github.com/influxdata/flux v0.65.0 diff --git a/go.sum b/go.sum index df3a6fb6d6e..f0c38cf830f 100644 --- a/go.sum +++ b/go.sum @@ -131,10 +131,7 @@ github.com/dave/jennifer v1.2.0/go.mod h1:fIb+770HOpJ2fmN9EPPKOqm1vMGhB+TwXKMZhr 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/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM= github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ= -github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1 h1:CaO/zOnF8VvUfEbhRatPcwKVWamvbYd8tQGRWacE9kU= -github.com/dgrijalva/jwt-go/v4 v4.0.0-preview1/go.mod h1:+hnT3ywWDTAFrW5aE+u2Sa/wT555ZqwoCS+pk3p6ry4= github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8 h1:akOQj8IVgoeFfBTzGOEQakCYshWD6RNo1M5pivFXt70= github.com/dgryski/go-bitstream v0.0.0-20180413035011-3522498ce2c8/go.mod h1:VMaSuZ+SZcx/wljOQKvp5srsbCiKDEb6K2wC4+PiBmQ= github.com/dgryski/go-sip13 v0.0.0-20190329191031-25c5027a8c7b/go.mod h1:vAd38F8PWV+bWy6jNmig1y/TA+kYO4g3RSRF0IAv0no= @@ -276,6 +273,8 @@ github.com/gogo/protobuf v1.2.2-0.20190723190241-65acae22fc9d/go.mod h1:SlYgWuQ5 github.com/gogo/protobuf v1.2.2-0.20190730201129-28a6bbf47e48/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= github.com/gogo/protobuf v1.3.1 h1:DqDEcV5aeaTmdFBePNpYsp3FlcVH/2ISVVM9Qf8PSls= github.com/gogo/protobuf v1.3.1/go.mod h1:SlYgWuQ5SjCEi6WLHjHCa1yvBfUnHcTbrrZtXPKa29o= +github.com/golang-jwt/jwt v3.2.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= +github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/geo v0.0.0-20190916061304-5b978397cfec h1:lJwO/92dFXWeXOZdoGXgptLmNLwynMSHUmU6besqtiw= github.com/golang/geo v0.0.0-20190916061304-5b978397cfec/go.mod h1:QZ0nwyI2jOfgRAoBvP+ab5aRr7c9x7lhGEJrKvBwjWI= diff --git a/services/httpd/handler.go b/services/httpd/handler.go index f2a73791136..2ce3c0925b9 100644 --- a/services/httpd/handler.go +++ b/services/httpd/handler.go @@ -23,8 +23,8 @@ import ( httppprof "net/http/pprof" "github.com/bmizerany/pat" - "github.com/dgrijalva/jwt-go/v4" "github.com/gogo/protobuf/proto" + "github.com/golang-jwt/jwt" "github.com/golang/snappy" "github.com/influxdata/flux" "github.com/influxdata/flux/lang" diff --git a/services/httpd/handler_test.go b/services/httpd/handler_test.go index 3fe61355490..06e8d0d18f6 100644 --- a/services/httpd/handler_test.go +++ b/services/httpd/handler_test.go @@ -21,8 +21,8 @@ import ( "testing" "time" - "github.com/dgrijalva/jwt-go/v4" "github.com/gogo/protobuf/proto" + "github.com/golang-jwt/jwt" "github.com/golang/snappy" "github.com/google/go-cmp/cmp" "github.com/influxdata/flux"