From 238c1177660b3a1be6f327e1923bed99d596e476 Mon Sep 17 00:00:00 2001 From: ecktom Date: Tue, 7 Sep 2021 20:14:15 +0200 Subject: [PATCH] feat(jwt): replace jwt module --- credentials/signer.go | 2 +- credentials/signer_default.go | 2 +- credentials/signer_default_integration_test.go | 2 +- credentials/signer_default_test.go | 2 +- credentials/verifier.go | 2 +- credentials/verifier_default.go | 2 +- credentials/verifier_default_test.go | 2 +- go.mod | 1 + go.sum | 2 ++ pipeline/authn/authenticator_jwt.go | 2 +- pipeline/authn/authenticator_jwt_test.go | 2 +- pipeline/mutate/mutator_id_token.go | 2 +- pipeline/mutate/mutator_id_token_test.go | 2 +- test/e2e/okclient/main.go | 2 +- 14 files changed, 15 insertions(+), 12 deletions(-) diff --git a/credentials/signer.go b/credentials/signer.go index ac42048136..62f0eaa09c 100644 --- a/credentials/signer.go +++ b/credentials/signer.go @@ -4,7 +4,7 @@ import ( "context" "net/url" - "github.com/form3tech-oss/jwt-go" + "github.com/golang-jwt/jwt/v4" ) type Signer interface { diff --git a/credentials/signer_default.go b/credentials/signer_default.go index 97a615cf3d..6b8153010e 100644 --- a/credentials/signer_default.go +++ b/credentials/signer_default.go @@ -7,7 +7,7 @@ import ( "net/url" "reflect" - "github.com/form3tech-oss/jwt-go" + "github.com/golang-jwt/jwt/v4" "github.com/pkg/errors" "golang.org/x/crypto/ed25519" "gopkg.in/square/go-jose.v2" diff --git a/credentials/signer_default_integration_test.go b/credentials/signer_default_integration_test.go index 0812e3fd3c..c5d256070c 100644 --- a/credentials/signer_default_integration_test.go +++ b/credentials/signer_default_integration_test.go @@ -6,7 +6,7 @@ import ( "testing" "time" - "github.com/form3tech-oss/jwt-go" + "github.com/golang-jwt/jwt/v4" "github.com/ory/oathkeeper/internal" ) diff --git a/credentials/signer_default_test.go b/credentials/signer_default_test.go index 274d4c1d23..f84f189d24 100644 --- a/credentials/signer_default_test.go +++ b/credentials/signer_default_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/form3tech-oss/jwt-go" + "github.com/golang-jwt/jwt/v4" "github.com/pkg/errors" "github.com/stretchr/testify/require" diff --git a/credentials/verifier.go b/credentials/verifier.go index af8b80ce89..acaf264560 100644 --- a/credentials/verifier.go +++ b/credentials/verifier.go @@ -4,7 +4,7 @@ import ( "context" "net/url" - "github.com/form3tech-oss/jwt-go" + "github.com/golang-jwt/jwt/v4" "github.com/ory/fosite" ) diff --git a/credentials/verifier_default.go b/credentials/verifier_default.go index d0f8cbd770..b78c6c0f2c 100644 --- a/credentials/verifier_default.go +++ b/credentials/verifier_default.go @@ -6,7 +6,7 @@ import ( "crypto/rsa" "fmt" - "github.com/form3tech-oss/jwt-go" + "github.com/golang-jwt/jwt/v4" "github.com/pkg/errors" "github.com/ory/fosite" diff --git a/credentials/verifier_default_test.go b/credentials/verifier_default_test.go index 5735cd0d29..dbf3d9c83e 100644 --- a/credentials/verifier_default_test.go +++ b/credentials/verifier_default_test.go @@ -7,7 +7,7 @@ import ( "testing" "time" - "github.com/form3tech-oss/jwt-go" + "github.com/golang-jwt/jwt/v4" "github.com/pkg/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/go.mod b/go.mod index 40876969cb..9071fec33b 100644 --- a/go.mod +++ b/go.mod @@ -29,6 +29,7 @@ require ( github.com/gobuffalo/httptest v1.0.2 github.com/gobuffalo/packr/v2 v2.8.0 github.com/gobwas/glob v0.2.3 + github.com/golang-jwt/jwt/v4 v4.0.0 github.com/golang/gddo v0.0.0-20190904175337-72a348e765d2 github.com/golang/mock v1.4.3 github.com/google/go-replayers/httpreplay v0.1.0 diff --git a/go.sum b/go.sum index 3d4d19a564..3ee0e7516e 100644 --- a/go.sum +++ b/go.sum @@ -618,6 +618,8 @@ github.com/gogo/googleapis v1.1.0/go.mod h1:gf4bu3Q80BeJ6H1S1vYPm8/ELATdvryBaNFG github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ= github.com/gogo/protobuf v1.2.1/go.mod h1:hp+jE20tsWTFYpLwKvXlhS1hjn+gTNwPg2I6zVXpSg4= +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/freetype v0.0.0-20170609003504-e2365dfdc4a0/go.mod h1:E/TSTwGwJL78qG/PmXZO1EjYhfJinVAhrmmHX6Z8B9k= github.com/golang/gddo v0.0.0-20180828051604-96d2a289f41e/go.mod h1:xEhNfoBDX1hzLm2Nf80qUvZ2sVwoMZ8d6IE2SrsQfh4= github.com/golang/gddo v0.0.0-20190904175337-72a348e765d2 h1:xisWqjiKEff2B0KfFYGpCqc3M3zdTz+OHQHRc09FeYk= diff --git a/pipeline/authn/authenticator_jwt.go b/pipeline/authn/authenticator_jwt.go index fa3e0e7958..8d1e9828ea 100644 --- a/pipeline/authn/authenticator_jwt.go +++ b/pipeline/authn/authenticator_jwt.go @@ -5,7 +5,7 @@ import ( "fmt" "net/http" - "github.com/form3tech-oss/jwt-go" + "github.com/golang-jwt/jwt/v4" "github.com/pkg/errors" "github.com/ory/go-convenience/jwtx" diff --git a/pipeline/authn/authenticator_jwt_test.go b/pipeline/authn/authenticator_jwt_test.go index 218e82ccec..749099fb3a 100644 --- a/pipeline/authn/authenticator_jwt_test.go +++ b/pipeline/authn/authenticator_jwt_test.go @@ -28,7 +28,7 @@ import ( "testing" "time" - "github.com/form3tech-oss/jwt-go" + "github.com/golang-jwt/jwt/v4" "github.com/tidwall/sjson" "github.com/ory/herodot" diff --git a/pipeline/mutate/mutator_id_token.go b/pipeline/mutate/mutator_id_token.go index 9bc8cbc8ae..7c22752d8e 100644 --- a/pipeline/mutate/mutator_id_token.go +++ b/pipeline/mutate/mutator_id_token.go @@ -32,7 +32,7 @@ import ( "github.com/dgraph-io/ristretto" - "github.com/form3tech-oss/jwt-go" + "github.com/golang-jwt/jwt/v4" "github.com/pborman/uuid" "github.com/pkg/errors" diff --git a/pipeline/mutate/mutator_id_token_test.go b/pipeline/mutate/mutator_id_token_test.go index 75f752966f..556e4b8d09 100644 --- a/pipeline/mutate/mutator_id_token_test.go +++ b/pipeline/mutate/mutator_id_token_test.go @@ -38,7 +38,7 @@ import ( "github.com/ory/oathkeeper/rule" "github.com/ory/oathkeeper/x" - "github.com/form3tech-oss/jwt-go" + "github.com/golang-jwt/jwt/v4" "github.com/ory/viper" diff --git a/test/e2e/okclient/main.go b/test/e2e/okclient/main.go index 69e7987fd6..9e26163a55 100644 --- a/test/e2e/okclient/main.go +++ b/test/e2e/okclient/main.go @@ -9,7 +9,7 @@ import ( "os" "time" - "github.com/form3tech-oss/jwt-go" + "github.com/golang-jwt/jwt/v4" "github.com/square/go-jose" "github.com/ory/oathkeeper/x"