From a3d4def0894f114f9ce26153571589c5f087f792 Mon Sep 17 00:00:00 2001 From: "Volodymyr Shcherbinin (vovin)" Date: Tue, 27 Jul 2021 18:47:29 +0300 Subject: [PATCH 1/3] Switch to github.com/golang-jwt/jwt --- auth/jwt/README.md | 6 +++--- auth/jwt/middleware.go | 2 +- auth/jwt/middleware_test.go | 2 +- go.mod | 2 +- go.sum | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/auth/jwt/README.md b/auth/jwt/README.md index 8cf823c3f..47f4f6eda 100644 --- a/auth/jwt/README.md +++ b/auth/jwt/README.md @@ -12,7 +12,7 @@ will be added to the context via the `jwt.JWTClaimsContextKey`. ```go import ( - stdjwt "github.com/dgrijalva/jwt-go" + stdjwt "github.com/golang-jwt/jwt" "github.com/go-kit/kit/auth/jwt" "github.com/go-kit/kit/endpoint" @@ -34,7 +34,7 @@ the token string and add it to the context via the `jwt.JWTContextKey`. ```go import ( - stdjwt "github.com/dgrijalva/jwt-go" + stdjwt "github.com/golang-jwt/jwt" "github.com/go-kit/kit/auth/jwt" "github.com/go-kit/kit/endpoint" @@ -65,7 +65,7 @@ Example of use in a client: ```go import ( - stdjwt "github.com/dgrijalva/jwt-go" + stdjwt "github.com/golang-jwt/jwt" grpctransport "github.com/go-kit/kit/transport/grpc" "github.com/go-kit/kit/auth/jwt" diff --git a/auth/jwt/middleware.go b/auth/jwt/middleware.go index b1c75a6d6..10188b358 100644 --- a/auth/jwt/middleware.go +++ b/auth/jwt/middleware.go @@ -4,7 +4,7 @@ import ( "context" "errors" - jwt "github.com/dgrijalva/jwt-go" + jwt "github.com/golang-jwt/jwt" "github.com/go-kit/kit/endpoint" ) diff --git a/auth/jwt/middleware_test.go b/auth/jwt/middleware_test.go index fc7032f1e..77bddd45b 100644 --- a/auth/jwt/middleware_test.go +++ b/auth/jwt/middleware_test.go @@ -8,8 +8,8 @@ import ( "crypto/subtle" - jwt "github.com/dgrijalva/jwt-go" "github.com/go-kit/kit/endpoint" + jwt "github.com/golang-jwt/jwt" ) type customClaims struct { diff --git a/go.mod b/go.mod index ca4014e71..5de5d78f2 100644 --- a/go.mod +++ b/go.mod @@ -12,13 +12,13 @@ require ( github.com/cenkalti/backoff v2.2.1+incompatible // indirect github.com/clbanning/x2j v0.0.0-20191024224557-825249438eec // indirect github.com/codahale/hdrhistogram v0.0.0-20161010025455-3a0bb77429bd // indirect - github.com/dgrijalva/jwt-go v3.2.0+incompatible github.com/edsrzf/mmap-go v1.0.0 // indirect github.com/franela/goblin v0.0.0-20200105215937-c9ffbefa60db // indirect github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8 // indirect github.com/go-logfmt/logfmt v0.5.0 github.com/go-stack/stack v1.8.0 github.com/go-zookeeper/zk v1.0.2 + github.com/golang-jwt/jwt v3.2.1+incompatible github.com/hashicorp/consul/api v1.8.1 github.com/hudl/fargo v1.3.0 github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab diff --git a/go.sum b/go.sum index d8ab70750..02d8b3a38 100644 --- a/go.sum +++ b/go.sum @@ -54,8 +54,6 @@ github.com/coreos/go-systemd/v22 v22.3.2/go.mod h1:Y58oyj3AT4RCenI/lSvhwexgC+NSV 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/dustin/go-humanize v1.0.0/go.mod h1:HtrtbFcZ19U5GC7JDqmcUSB87Iq5E25KnS6fMYU6eOk= github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs= github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU= @@ -92,6 +90,8 @@ github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= 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.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= +github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc= From c883b3a493f61fbe3569ad808b4ddd91e95fb2c9 Mon Sep 17 00:00:00 2001 From: "Volodymyr Shcherbinin (vovin)" Date: Wed, 28 Jul 2021 17:26:02 +0300 Subject: [PATCH 2/3] Remove redundant alias --- auth/jwt/middleware.go | 3 +-- auth/jwt/middleware_test.go | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/auth/jwt/middleware.go b/auth/jwt/middleware.go index 10188b358..1a108cee1 100644 --- a/auth/jwt/middleware.go +++ b/auth/jwt/middleware.go @@ -4,9 +4,8 @@ import ( "context" "errors" - jwt "github.com/golang-jwt/jwt" - "github.com/go-kit/kit/endpoint" + "github.com/golang-jwt/jwt" ) type contextKey string diff --git a/auth/jwt/middleware_test.go b/auth/jwt/middleware_test.go index 77bddd45b..8ba44f24b 100644 --- a/auth/jwt/middleware_test.go +++ b/auth/jwt/middleware_test.go @@ -9,7 +9,7 @@ import ( "crypto/subtle" "github.com/go-kit/kit/endpoint" - jwt "github.com/golang-jwt/jwt" + "github.com/golang-jwt/jwt" ) type customClaims struct { From e413157276369f92d1d320ab933a88a0f93e52f3 Mon Sep 17 00:00:00 2001 From: "Volodymyr Shcherbinin (vovin)" Date: Thu, 19 Aug 2021 14:23:24 +0300 Subject: [PATCH 3/3] Update github.com/golang-jwt/jwt to v4 --- auth/jwt/README.md | 6 +++--- auth/jwt/middleware.go | 2 +- auth/jwt/middleware_test.go | 2 +- go.mod | 2 +- go.sum | 4 ++-- 5 files changed, 8 insertions(+), 8 deletions(-) diff --git a/auth/jwt/README.md b/auth/jwt/README.md index 6184069de..58b7d912b 100644 --- a/auth/jwt/README.md +++ b/auth/jwt/README.md @@ -12,7 +12,7 @@ will be added to the context via the `jwt.JWTClaimsContextKey`. ```go import ( - stdjwt "github.com/golang-jwt/jwt" + stdjwt "github.com/golang-jwt/jwt/v4" "github.com/go-kit/kit/auth/jwt" "github.com/go-kit/kit/endpoint" @@ -34,7 +34,7 @@ the token string and add it to the context via the `jwt.JWTContextKey`. ```go import ( - stdjwt "github.com/golang-jwt/jwt" + stdjwt "github.com/golang-jwt/jwt/v4" "github.com/go-kit/kit/auth/jwt" "github.com/go-kit/kit/endpoint" @@ -65,7 +65,7 @@ Example of use in a client: ```go import ( - stdjwt "github.com/golang-jwt/jwt" + stdjwt "github.com/golang-jwt/jwt/v4" grpctransport "github.com/go-kit/kit/transport/grpc" "github.com/go-kit/kit/auth/jwt" diff --git a/auth/jwt/middleware.go b/auth/jwt/middleware.go index 1a108cee1..b7c89ceb8 100644 --- a/auth/jwt/middleware.go +++ b/auth/jwt/middleware.go @@ -5,7 +5,7 @@ import ( "errors" "github.com/go-kit/kit/endpoint" - "github.com/golang-jwt/jwt" + "github.com/golang-jwt/jwt/v4" ) type contextKey string diff --git a/auth/jwt/middleware_test.go b/auth/jwt/middleware_test.go index 8ba44f24b..32538c1a1 100644 --- a/auth/jwt/middleware_test.go +++ b/auth/jwt/middleware_test.go @@ -9,7 +9,7 @@ import ( "crypto/subtle" "github.com/go-kit/kit/endpoint" - "github.com/golang-jwt/jwt" + "github.com/golang-jwt/jwt/v4" ) type customClaims struct { diff --git a/go.mod b/go.mod index 3cd892159..9bf43e046 100644 --- a/go.mod +++ b/go.mod @@ -17,7 +17,7 @@ require ( github.com/franela/goreq v0.0.0-20171204163338-bcd34c9993f8 // indirect github.com/go-kit/log v0.1.0 github.com/go-zookeeper/zk v1.0.2 - github.com/golang-jwt/jwt v3.2.1+incompatible + github.com/golang-jwt/jwt/v4 v4.0.0 github.com/hashicorp/consul/api v1.8.1 github.com/hudl/fargo v1.3.0 github.com/influxdata/influxdb1-client v0.0.0-20200827194710-b269163b24ab diff --git a/go.sum b/go.sum index 9900c7935..d1345a602 100644 --- a/go.sum +++ b/go.sum @@ -91,8 +91,8 @@ github.com/godbus/dbus/v5 v5.0.4/go.mod h1:xhWf0FNVPg57R7Z0UbKHbJfkEywrmjJnf7w5x github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= 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.1+incompatible h1:73Z+4BJcrTC+KczS6WvTPvRGOp1WmfEP4Q1lOd9Z/+c= -github.com/golang-jwt/jwt v3.2.1+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I= +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/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e h1:1r7pUrabqp18hOBcwBwiTsbnFeTZHV9eER/QT5JVZxY= github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=