diff --git a/credentials/signer.go b/credentials/signer.go index b5451376a3..7c691bbee8 100644 --- a/credentials/signer.go +++ b/credentials/signer.go @@ -7,7 +7,7 @@ import ( "context" "net/url" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" ) type Signer interface { diff --git a/credentials/signer_default.go b/credentials/signer_default.go index ab6d4eda55..d75b92b8f2 100644 --- a/credentials/signer_default.go +++ b/credentials/signer_default.go @@ -10,7 +10,7 @@ import ( "net/url" "reflect" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "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 0dedea2eb1..c4ec694577 100644 --- a/credentials/signer_default_integration_test.go +++ b/credentials/signer_default_integration_test.go @@ -9,7 +9,7 @@ import ( "testing" "time" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "github.com/ory/oathkeeper/internal" ) diff --git a/credentials/signer_default_test.go b/credentials/signer_default_test.go index 3593c249e6..7f30411473 100644 --- a/credentials/signer_default_test.go +++ b/credentials/signer_default_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "github.com/pkg/errors" "github.com/stretchr/testify/require" diff --git a/credentials/verifier.go b/credentials/verifier.go index f644821f6d..387f590f81 100644 --- a/credentials/verifier.go +++ b/credentials/verifier.go @@ -7,7 +7,7 @@ import ( "context" "net/url" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "github.com/ory/fosite" ) diff --git a/credentials/verifier_default.go b/credentials/verifier_default.go index c80a8ac70b..4924198c56 100644 --- a/credentials/verifier_default.go +++ b/credentials/verifier_default.go @@ -10,7 +10,7 @@ import ( "fmt" "strings" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "github.com/pkg/errors" "github.com/ory/fosite" @@ -84,13 +84,6 @@ func (v *VerifierDefault) Verify( return nil, errors.WithStack(herodot.ErrBadRequest.WithReasonf(`The signing key algorithm does not match the algorithm from the token header.`)) }) if err != nil { - if e, ok := errors.Cause(err).(*jwt.ValidationError); ok { - if _, ok := errors.Cause(e.Inner).(*herodot.DefaultError); !ok { - return nil, herodot.ErrInternalServerError.WithErrorf(e.Error()).WithTrace(err) - } - - return nil, e.Inner - } return nil, err } else if !t.Valid { return nil, errors.WithStack(fosite.ErrInactiveToken) diff --git a/credentials/verifier_default_test.go b/credentials/verifier_default_test.go index 6701923877..e59d744253 100644 --- a/credentials/verifier_default_test.go +++ b/credentials/verifier_default_test.go @@ -10,7 +10,7 @@ import ( "testing" "time" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "github.com/pkg/errors" "github.com/stretchr/testify/assert" "github.com/stretchr/testify/require" diff --git a/go.mod b/go.mod index 2d68b65a3f..48c265b175 100644 --- a/go.mod +++ b/go.mod @@ -24,7 +24,7 @@ require ( github.com/go-swagger/go-swagger v0.30.0 github.com/gobuffalo/httptest v1.5.2 github.com/gobwas/glob v0.2.3 - github.com/golang-jwt/jwt/v4 v4.4.3 + github.com/golang-jwt/jwt/v5 v5.2.1 github.com/golang/gddo v0.0.0-20190904175337-72a348e765d2 github.com/golang/mock v1.6.0 github.com/google/go-replayers/httpreplay v1.1.1 diff --git a/go.sum b/go.sum index 5ab8874bba..1ac081d57c 100644 --- a/go.sum +++ b/go.sum @@ -410,8 +410,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.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q= github.com/gogo/protobuf v1.3.2/go.mod h1:P1XiOD3dCwIKUDQYPy72D8LYyHL2YPYrpS2s69NZV8Q= -github.com/golang-jwt/jwt/v4 v4.4.3 h1:Hxl6lhQFj4AnOX6MLrsCb/+7tCj7DxP7VA+2rDIq5AU= -github.com/golang-jwt/jwt/v4 v4.4.3/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0= +github.com/golang-jwt/jwt/v5 v5.2.1 h1:OuVbFODueb089Lh128TAcimifWaLhJwVflnrgM17wHk= +github.com/golang-jwt/jwt/v5 v5.2.1/go.mod h1:pqrtFR0X4osieyHYxtmOUWsAWrfe1Q5UVIyoH402zdk= github.com/golang/gddo v0.0.0-20190904175337-72a348e765d2 h1:xisWqjiKEff2B0KfFYGpCqc3M3zdTz+OHQHRc09FeYk= github.com/golang/gddo v0.0.0-20190904175337-72a348e765d2/go.mod h1:xEhNfoBDX1hzLm2Nf80qUvZ2sVwoMZ8d6IE2SrsQfh4= github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q= diff --git a/pipeline/authn/authenticator_jwt.go b/pipeline/authn/authenticator_jwt.go index 8852efc0d4..1fa014c0b4 100644 --- a/pipeline/authn/authenticator_jwt.go +++ b/pipeline/authn/authenticator_jwt.go @@ -9,7 +9,7 @@ import ( "net/http" "strings" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "github.com/pkg/errors" "go.opentelemetry.io/otel/trace" diff --git a/pipeline/authn/authenticator_jwt_test.go b/pipeline/authn/authenticator_jwt_test.go index 51ec496350..1279481f06 100644 --- a/pipeline/authn/authenticator_jwt_test.go +++ b/pipeline/authn/authenticator_jwt_test.go @@ -12,7 +12,7 @@ import ( "testing" "time" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "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 476e9a4c63..6715eb6048 100644 --- a/pipeline/mutate/mutator_id_token.go +++ b/pipeline/mutate/mutator_id_token.go @@ -15,7 +15,7 @@ import ( "github.com/dgraph-io/ristretto" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "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 2666961307..92ab117213 100644 --- a/pipeline/mutate/mutator_id_token_test.go +++ b/pipeline/mutate/mutator_id_token_test.go @@ -22,7 +22,7 @@ import ( "github.com/ory/oathkeeper/x" "github.com/ory/x/configx" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "github.com/ory/oathkeeper/credentials" "github.com/ory/oathkeeper/driver/configuration" diff --git a/test/e2e/okclient/main.go b/test/e2e/okclient/main.go index c8324fdc90..83d2db7578 100644 --- a/test/e2e/okclient/main.go +++ b/test/e2e/okclient/main.go @@ -12,7 +12,7 @@ import ( "os" "time" - "github.com/golang-jwt/jwt/v4" + "github.com/golang-jwt/jwt/v5" "github.com/square/go-jose" "github.com/ory/oathkeeper/x"