Skip to content

Commit

Permalink
Switch to github.com/golang-jwt/jwt (#1172)
Browse files Browse the repository at this point in the history
* Switch to github.com/golang-jwt/jwt

* Remove redundant alias

* Update github.com/golang-jwt/jwt to v4
  • Loading branch information
vovinacci committed Aug 19, 2021
1 parent 801da84 commit fd3754b
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
6 changes: 3 additions & 3 deletions auth/jwt/README.md
Expand Up @@ -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/v4"

"github.com/go-kit/kit/auth/jwt"
"github.com/go-kit/kit/endpoint"
Expand All @@ -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/v4"

"github.com/go-kit/kit/auth/jwt"
"github.com/go-kit/kit/endpoint"
Expand Down Expand Up @@ -65,7 +65,7 @@ Example of use in a client:

```go
import (
stdjwt "github.com/dgrijalva/jwt-go"
stdjwt "github.com/golang-jwt/jwt/v4"

grpctransport "github.com/go-kit/kit/transport/grpc"
"github.com/go-kit/kit/auth/jwt"
Expand Down
3 changes: 1 addition & 2 deletions auth/jwt/middleware.go
Expand Up @@ -4,9 +4,8 @@ import (
"context"
"errors"

jwt "github.com/dgrijalva/jwt-go"

"github.com/go-kit/kit/endpoint"
"github.com/golang-jwt/jwt/v4"
)

type contextKey string
Expand Down
2 changes: 1 addition & 1 deletion auth/jwt/middleware_test.go
Expand Up @@ -8,8 +8,8 @@ import (

"crypto/subtle"

jwt "github.com/dgrijalva/jwt-go"
"github.com/go-kit/kit/endpoint"
"github.com/golang-jwt/jwt/v4"
)

type customClaims struct {
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -12,12 +12,12 @@ 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-kit/log v0.1.0
github.com/go-zookeeper/zk v1.0.2
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
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Expand Up @@ -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=
Expand Down Expand Up @@ -93,6 +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/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=
Expand Down

0 comments on commit fd3754b

Please sign in to comment.