Skip to content

Commit 401ad58

Browse files
committed
chore: upgrade to jose v4 library
1 parent 869a37c commit 401ad58

25 files changed

+96
-70
lines changed

authorize_request_handler.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ import (
1010
"net/http"
1111
"strings"
1212

13-
"github.com/go-jose/go-jose/v3"
13+
"github.com/go-jose/go-jose/v4"
1414
"go.opentelemetry.io/otel/trace"
1515

1616
"github.com/ory/fosite/i18n"

authorize_request_handler_oidc_request_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616

1717
"github.com/pkg/errors"
1818

19-
"github.com/go-jose/go-jose/v3"
19+
"github.com/go-jose/go-jose/v4"
2020
"github.com/stretchr/testify/assert"
2121
"github.com/stretchr/testify/require"
2222

client.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
package fosite
55

66
import (
7-
"github.com/go-jose/go-jose/v3"
7+
"github.com/go-jose/go-jose/v4"
88
)
99

1010
// Client represents a client or an app.

client_authentication.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import (
1616

1717
"github.com/ory/x/errorsx"
1818

19-
"github.com/go-jose/go-jose/v3"
19+
"github.com/go-jose/go-jose/v4"
2020
"github.com/pkg/errors"
2121

2222
"github.com/ory/fosite/token/jwt"

client_authentication_jwks_strategy.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313

1414
"github.com/ory/x/errorsx"
1515

16-
"github.com/go-jose/go-jose/v3"
16+
"github.com/go-jose/go-jose/v4"
1717
)
1818

1919
const defaultJWKSFetcherStrategyCachePrefix = "github.com/ory/fosite.DefaultJWKSFetcherStrategy:"

client_authentication_jwks_strategy_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ import (
1717

1818
"github.com/ory/fosite/internal/gen"
1919

20-
"github.com/go-jose/go-jose/v3"
20+
"github.com/go-jose/go-jose/v4"
2121
"github.com/stretchr/testify/assert"
2222
"github.com/stretchr/testify/require"
2323
)

client_authentication_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ import (
2020

2121
"github.com/ory/fosite/internal/gen"
2222

23-
"github.com/go-jose/go-jose/v3"
23+
"github.com/go-jose/go-jose/v4"
2424
"github.com/pkg/errors"
2525
"github.com/stretchr/testify/assert"
2626
"github.com/stretchr/testify/require"

go.mod

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ require (
1010
github.com/asaskevich/govalidator v0.0.0-20230301143203-a9d515a09cc2
1111
github.com/cristalhq/jwt/v4 v4.0.2
1212
github.com/dgraph-io/ristretto v0.1.1
13-
github.com/go-jose/go-jose/v3 v3.0.3
13+
github.com/go-jose/go-jose/v4 v4.0.4
1414
github.com/golang/mock v1.6.0
1515
github.com/google/uuid v1.3.0
1616
github.com/gorilla/mux v1.8.0
@@ -25,13 +25,13 @@ require (
2525
github.com/ory/x v0.0.575
2626
github.com/parnurzeal/gorequest v0.2.15
2727
github.com/pkg/errors v0.9.1
28-
github.com/stretchr/testify v1.8.4
28+
github.com/stretchr/testify v1.9.0
2929
github.com/tidwall/gjson v1.14.3
3030
go.opentelemetry.io/otel/trace v1.16.0
31-
golang.org/x/crypto v0.21.0
32-
golang.org/x/net v0.23.0
31+
golang.org/x/crypto v0.25.0
32+
golang.org/x/net v0.25.0
3333
golang.org/x/oauth2 v0.10.0
34-
golang.org/x/text v0.14.0
34+
golang.org/x/text v0.16.0
3535
)
3636

3737
require (
@@ -83,9 +83,9 @@ require (
8383
go.opentelemetry.io/otel/metric v1.16.0 // indirect
8484
go.opentelemetry.io/otel/sdk v1.16.0 // indirect
8585
go.opentelemetry.io/proto/otlp v1.0.0 // indirect
86-
golang.org/x/mod v0.12.0 // indirect
87-
golang.org/x/sys v0.20.0 // indirect
88-
golang.org/x/tools v0.11.1 // indirect
86+
golang.org/x/mod v0.17.0 // indirect
87+
golang.org/x/sys v0.22.0 // indirect
88+
golang.org/x/tools v0.21.1-0.20240508182429-e35e4ccd0d2d // indirect
8989
google.golang.org/appengine v1.6.7 // indirect
9090
google.golang.org/genproto v0.0.0-20230731193218-e0aa005b6bdf // indirect
9191
google.golang.org/genproto/googleapis/api v0.0.0-20230731193218-e0aa005b6bdf // indirect
@@ -96,4 +96,6 @@ require (
9696
gopkg.in/yaml.v3 v3.0.1 // indirect
9797
)
9898

99-
go 1.20
99+
go 1.21
100+
101+
toolchain go1.23.1

go.sum

Lines changed: 42 additions & 25 deletions
Large diffs are not rendered by default.

handler/rfc7523/handler.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,11 @@ import (
1010

1111
"github.com/ory/fosite/handler/oauth2"
1212

13-
"github.com/go-jose/go-jose/v3"
14-
"github.com/go-jose/go-jose/v3/jwt"
13+
"github.com/go-jose/go-jose/v4"
14+
"github.com/go-jose/go-jose/v4/jwt"
1515

1616
"github.com/ory/fosite"
17+
fositeJWT "github.com/ory/fosite/token/jwt"
1718
"github.com/ory/x/errorsx"
1819
)
1920

@@ -51,7 +52,7 @@ func (c *Handler) HandleTokenEndpointRequest(ctx context.Context, request fosite
5152
return errorsx.WithStack(fosite.ErrInvalidRequest.WithHintf("The assertion request parameter must be set when using grant_type of '%s'.", grantTypeJWTBearer))
5253
}
5354

54-
token, err := jwt.ParseSigned(assertion)
55+
token, err := jwt.ParseSigned(assertion, fositeJWT.SupportedSignatureAlgorithms)
5556
if err != nil {
5657
return errorsx.WithStack(fosite.ErrInvalidGrant.
5758
WithHint("Unable to parse JSON Web Token passed in \"assertion\" request parameter.").

0 commit comments

Comments
 (0)