Skip to content

Commit

Permalink
fix(deps): update go-jose to new updated repo due to migration (#630)
Browse files Browse the repository at this point in the history
* updates go-jose to new updated repo due to migration

- updated from /square/go-jose to /go-jose/go-jose
- updates to v2.6.3
- addresses CVE-2016-9123 and CVE-2016-9121
- fixes tests that were adjusting for a 1s delay

* revert 299>300 in op_test.go
  • Loading branch information
andrewpmartinez authored Aug 27, 2024
1 parent e8769ce commit 2308e2f
Show file tree
Hide file tree
Showing 32 changed files with 33 additions and 33 deletions.
2 changes: 1 addition & 1 deletion example/server/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"time"

"github.com/google/uuid"
"gopkg.in/square/go-jose.v2"
"gopkg.in/go-jose/go-jose.v2"

"github.com/zitadel/oidc/v2/pkg/oidc"
"github.com/zitadel/oidc/v2/pkg/op"
Expand Down
2 changes: 1 addition & 1 deletion example/server/storage/storage_dynamic.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"time"

"gopkg.in/square/go-jose.v2"
"gopkg.in/go-jose/go-jose.v2"

"github.com/zitadel/oidc/v2/pkg/oidc"
"github.com/zitadel/oidc/v2/pkg/op"
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ require (
go.opentelemetry.io/otel/trace v1.24.0
golang.org/x/oauth2 v0.20.0
golang.org/x/text v0.15.0
gopkg.in/square/go-jose.v2 v2.6.0
gopkg.in/go-jose/go-jose.v2 v2.6.3
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ golang.org/x/xerrors v0.0.0-20200804184101-5ec99f83aff1/go.mod h1:I/5z698sn9Ka8T
google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/square/go-jose.v2 v2.6.0 h1:NGk74WTnPKBNUhNzQX7PYcTLUjoq7mzKk2OKbvwk2iI=
gopkg.in/square/go-jose.v2 v2.6.0/go.mod h1:M9dMgbHiYLoDGQrXy7OpJDJWiKiU//h+vD76mk0e1AI=
gopkg.in/go-jose/go-jose.v2 v2.6.3 h1:nt80fvSDlhKWQgSWyHyy5CfmlQr+asih51R8PTWNKKs=
gopkg.in/go-jose/go-jose.v2 v2.6.3/go.mod h1:zzZDPkNNw/c9IE7Z9jr11mBZQhKQTMzoEEIoEdZlFBI=
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
2 changes: 1 addition & 1 deletion internal/testutil/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"time"

"github.com/zitadel/oidc/v2/pkg/oidc"
"gopkg.in/square/go-jose.v2"
"gopkg.in/go-jose/go-jose.v2"
)

// KeySet implements oidc.Keys
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"time"

"golang.org/x/oauth2"
"gopkg.in/square/go-jose.v2"
"gopkg.in/go-jose/go-jose.v2"

"github.com/zitadel/oidc/v2/pkg/crypto"
httphelper "github.com/zitadel/oidc/v2/pkg/http"
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/profile/jwt_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"time"

"golang.org/x/oauth2"
"gopkg.in/square/go-jose.v2"
"gopkg.in/go-jose/go-jose.v2"

"github.com/zitadel/oidc/v2/pkg/client"
"github.com/zitadel/oidc/v2/pkg/oidc"
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/rp/jwks.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"net/http"
"sync"

"gopkg.in/square/go-jose.v2"
"gopkg.in/go-jose/go-jose.v2"

httphelper "github.com/zitadel/oidc/v2/pkg/http"
"github.com/zitadel/oidc/v2/pkg/oidc"
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/rp/relying_party.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (

"github.com/google/uuid"
"golang.org/x/oauth2"
"gopkg.in/square/go-jose.v2"
"gopkg.in/go-jose/go-jose.v2"

"github.com/zitadel/oidc/v2/pkg/client"
httphelper "github.com/zitadel/oidc/v2/pkg/http"
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/rp/verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"time"

"gopkg.in/square/go-jose.v2"
"gopkg.in/go-jose/go-jose.v2"

"github.com/zitadel/oidc/v2/pkg/oidc"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/client/rp/verifier_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/stretchr/testify/require"
tu "github.com/zitadel/oidc/v2/internal/testutil"
"github.com/zitadel/oidc/v2/pkg/oidc"
"gopkg.in/square/go-jose.v2"
"gopkg.in/go-jose/go-jose.v2"
)

func TestVerifyTokens(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/crypto/hash.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"fmt"
"hash"

"gopkg.in/square/go-jose.v2"
"gopkg.in/go-jose/go-jose.v2"
)

var ErrUnsupportedAlgorithm = errors.New("unsupported signing algorithm")
Expand Down
2 changes: 1 addition & 1 deletion pkg/crypto/sign.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"encoding/json"
"errors"

"gopkg.in/square/go-jose.v2"
"gopkg.in/go-jose/go-jose.v2"
)

func Sign(object any, signer jose.Signer) (string, error) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/oidc/keyset.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"crypto/rsa"
"errors"

"gopkg.in/square/go-jose.v2"
"gopkg.in/go-jose/go-jose.v2"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion pkg/oidc/keyset_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import (
"reflect"
"testing"

"gopkg.in/square/go-jose.v2"
"gopkg.in/go-jose/go-jose.v2"
)

func TestFindKey(t *testing.T) {
Expand Down
2 changes: 1 addition & 1 deletion pkg/oidc/token.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"time"

"golang.org/x/oauth2"
"gopkg.in/square/go-jose.v2"
"gopkg.in/go-jose/go-jose.v2"

"github.com/muhlemmer/gu"
"github.com/zitadel/oidc/v2/pkg/crypto"
Expand Down
2 changes: 1 addition & 1 deletion pkg/oidc/token_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"fmt"
"time"

"gopkg.in/square/go-jose.v2"
"gopkg.in/go-jose/go-jose.v2"
)

const (
Expand Down
2 changes: 1 addition & 1 deletion pkg/oidc/token_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/stretchr/testify/assert"
"golang.org/x/text/language"
"gopkg.in/square/go-jose.v2"
"gopkg.in/go-jose/go-jose.v2"
)

var (
Expand Down
2 changes: 1 addition & 1 deletion pkg/oidc/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"github.com/gorilla/schema"
"github.com/muhlemmer/gu"
"golang.org/x/text/language"
"gopkg.in/square/go-jose.v2"
"gopkg.in/go-jose/go-jose.v2"
)

type Audience []string
Expand Down
2 changes: 1 addition & 1 deletion pkg/oidc/verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"
"time"

"gopkg.in/square/go-jose.v2"
"gopkg.in/go-jose/go-jose.v2"

str "github.com/zitadel/oidc/v2/pkg/strings"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/op/discovery.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"net/http"

"gopkg.in/square/go-jose.v2"
"gopkg.in/go-jose/go-jose.v2"

httphelper "github.com/zitadel/oidc/v2/pkg/http"
"github.com/zitadel/oidc/v2/pkg/oidc"
Expand Down
2 changes: 1 addition & 1 deletion pkg/op/discovery_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"gopkg.in/square/go-jose.v2"
"gopkg.in/go-jose/go-jose.v2"

"github.com/zitadel/oidc/v2/pkg/oidc"
"github.com/zitadel/oidc/v2/pkg/op"
Expand Down
2 changes: 1 addition & 1 deletion pkg/op/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"context"
"net/http"

"gopkg.in/square/go-jose.v2"
"gopkg.in/go-jose/go-jose.v2"

httphelper "github.com/zitadel/oidc/v2/pkg/http"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/op/keys_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/golang/mock/gomock"
"github.com/stretchr/testify/assert"
"gopkg.in/square/go-jose.v2"
"gopkg.in/go-jose/go-jose.v2"

"github.com/zitadel/oidc/v2/pkg/oidc"
"github.com/zitadel/oidc/v2/pkg/op"
Expand Down
2 changes: 1 addition & 1 deletion pkg/op/mock/authorizer.mock.impl.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (

"github.com/golang/mock/gomock"
"github.com/gorilla/schema"
"gopkg.in/square/go-jose.v2"
"gopkg.in/go-jose/go-jose.v2"

"github.com/zitadel/oidc/v2/pkg/oidc"
"github.com/zitadel/oidc/v2/pkg/op"
Expand Down
2 changes: 1 addition & 1 deletion pkg/op/mock/discovery.mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/op/mock/signer.mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/op/mock/storage.mock.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pkg/op/op.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import (
"go.opentelemetry.io/otel"
"go.opentelemetry.io/otel/trace"
"golang.org/x/text/language"
"gopkg.in/square/go-jose.v2"
"gopkg.in/go-jose/go-jose.v2"

httphelper "github.com/zitadel/oidc/v2/pkg/http"
"github.com/zitadel/oidc/v2/pkg/oidc"
Expand Down
2 changes: 1 addition & 1 deletion pkg/op/signer.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package op
import (
"errors"

"gopkg.in/square/go-jose.v2"
"gopkg.in/go-jose/go-jose.v2"
)

var ErrSignerCreationFailed = errors.New("signer creation failed")
Expand Down
2 changes: 1 addition & 1 deletion pkg/op/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import (
"errors"
"time"

"gopkg.in/square/go-jose.v2"
"gopkg.in/go-jose/go-jose.v2"

"github.com/zitadel/oidc/v2/pkg/oidc"
)
Expand Down
2 changes: 1 addition & 1 deletion pkg/op/verifier_jwt_profile.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"fmt"
"time"

"gopkg.in/square/go-jose.v2"
"gopkg.in/go-jose/go-jose.v2"

"github.com/zitadel/oidc/v2/pkg/oidc"
)
Expand Down

0 comments on commit 2308e2f

Please sign in to comment.