Skip to content

Commit

Permalink
Update to github.com/go-jose/go-jose/v4
Browse files Browse the repository at this point in the history
There's a CVE reported in go-jose.v2, and it's also an archived repository now. Time to move on.

Signed-off-by: Matthias Loibl <[email protected]>
  • Loading branch information
metalmatze committed Mar 7, 2024
1 parent 8652a7c commit 3720b21
Show file tree
Hide file tree
Showing 20 changed files with 24 additions and 23 deletions.
2 changes: 1 addition & 1 deletion connector/oauth/oauth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ import (
"sort"
"testing"

"github.com/go-jose/go-jose/v4"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/assert"
jose "gopkg.in/square/go-jose.v2"

"github.com/dexidp/dex/connector"
)
Expand Down
2 changes: 1 addition & 1 deletion connector/oidc/oidc_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import (
"testing"
"time"

"github.com/go-jose/go-jose/v4"
"github.com/sirupsen/logrus"
"gopkg.in/square/go-jose.v2"

"github.com/dexidp/dex/connector"
)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ require (
github.com/felixge/httpsnoop v1.0.4
github.com/fsnotify/fsnotify v1.7.0
github.com/ghodss/yaml v1.0.0
github.com/go-jose/go-jose/v4 v4.0.0
github.com/go-ldap/ldap/v3 v3.4.6
github.com/go-sql-driver/mysql v1.7.1
github.com/gorilla/handlers v1.5.2
Expand All @@ -38,7 +39,6 @@ require (
google.golang.org/api v0.167.0
google.golang.org/grpc v1.62.0
google.golang.org/protobuf v1.32.0
gopkg.in/square/go-jose.v2 v2.6.0
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,8 @@ github.com/go-asn1-ber/asn1-ber v1.5.5 h1:MNHlNMBDgEKD4TcKr36vQN68BA00aDfjIt3/bD
github.com/go-asn1-ber/asn1-ber v1.5.5/go.mod h1:hEBeB/ic+5LoWskz+yKT7vGhhPYkProFKoKdwZRWMe0=
github.com/go-jose/go-jose/v3 v3.0.1 h1:pWmKFVtt+Jl0vBZTIpz/eAKwsm6LkIxDVVbFHKkchhA=
github.com/go-jose/go-jose/v3 v3.0.1/go.mod h1:RNkWWRld676jZEYoV3+XK8L2ZnNSvIsxFMht0mSX+u8=
github.com/go-jose/go-jose/v4 v4.0.0 h1:gHOVQyfrqsagdy/Yj9PTz5HMYzr3UpYh1CcFpktmRoY=
github.com/go-jose/go-jose/v4 v4.0.0/go.mod h1:WVf9LFMHh/QVrmqrOfqun0C45tMe3RoiKJMPvgWwLfY=
github.com/go-ldap/ldap/v3 v3.4.6 h1:ert95MdbiG7aWo/oPYp9btL3KJlMPKnP58r09rI8T+A=
github.com/go-ldap/ldap/v3 v3.4.6/go.mod h1:IGMQANNtxpsOzj7uUAMjpGBaOVTC4DYyIy8VsTdxmtc=
github.com/go-logr/logr v1.2.2/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A=
Expand Down Expand Up @@ -384,8 +386,6 @@ gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
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/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
gopkg.in/yaml.v2 v2.3.0/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
Expand Down
2 changes: 1 addition & 1 deletion server/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import (
"time"

"github.com/coreos/go-oidc/v3/oidc"
"github.com/go-jose/go-jose/v4"
"github.com/gorilla/mux"
jose "gopkg.in/square/go-jose.v2"

"github.com/dexidp/dex/connector"
"github.com/dexidp/dex/server/internal"
Expand Down
4 changes: 2 additions & 2 deletions server/oauth2.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import (
"strings"
"time"

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

"github.com/dexidp/dex/connector"
"github.com/dexidp/dex/server/internal"
Expand Down Expand Up @@ -669,7 +669,7 @@ type storageKeySet struct {
}

func (s *storageKeySet) VerifySignature(_ context.Context, jwt string) (payload []byte, err error) {
jws, err := jose.ParseSigned(jwt)
jws, err := jose.ParseSigned(jwt, []jose.SignatureAlgorithm{jose.RS256, jose.RS384, jose.RS512, jose.ES256, jose.ES384, jose.ES512})
if err != nil {
return nil, err
}
Expand Down
2 changes: 1 addition & 1 deletion server/oauth2_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"strings"
"testing"

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

"github.com/dexidp/dex/storage"
"github.com/dexidp/dex/storage/memory"
Expand Down
2 changes: 1 addition & 1 deletion server/rotation.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"io"
"time"

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

"github.com/dexidp/dex/pkg/log"
"github.com/dexidp/dex/storage"
Expand Down
2 changes: 1 addition & 1 deletion server/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,13 @@ import (

gosundheit "github.com/AppsFlyer/go-sundheit"
"github.com/coreos/go-oidc/v3/oidc"
"github.com/go-jose/go-jose/v4"
"github.com/kylelemons/godebug/pretty"
"github.com/prometheus/client_golang/prometheus"
"github.com/sirupsen/logrus"
"github.com/stretchr/testify/require"
"golang.org/x/crypto/bcrypt"
"golang.org/x/oauth2"
jose "gopkg.in/square/go-jose.v2"

"github.com/dexidp/dex/connector"
"github.com/dexidp/dex/connector/mock"
Expand Down
2 changes: 1 addition & 1 deletion storage/conformance/conformance.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,10 @@ import (
"testing"
"time"

jose "github.com/go-jose/go-jose/v4"
"github.com/kylelemons/godebug/pretty"
"github.com/stretchr/testify/require"
"golang.org/x/crypto/bcrypt"
jose "gopkg.in/square/go-jose.v2"

"github.com/dexidp/dex/storage"
)
Expand Down
5 changes: 3 additions & 2 deletions storage/conformance/gen_jwks.go
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
//go:build ignore
// +build ignore

// This file is used to generate static JWKs for tests.
Expand All @@ -16,7 +17,7 @@ import (
"os"
"text/template"

jose "gopkg.in/square/go-jose.v2"
"github.com/go-jose/go-jose/v4"
)

func newUUID() string {
Expand All @@ -36,7 +37,7 @@ var tmpl = template.Must(template.New("jwks.go").Parse(`
package conformance
import jose "gopkg.in/square/go-jose.v2"
import jose "github.com/go-jose/go-jose/v4"
type keyPair struct {
Public *jose.JSONWebKey
Expand Down
2 changes: 1 addition & 1 deletion storage/conformance/jwks.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

package conformance

import jose "gopkg.in/square/go-jose.v2"
import "github.com/go-jose/go-jose/v4"

type keyPair struct {
Public *jose.JSONWebKey
Expand Down
2 changes: 1 addition & 1 deletion storage/ent/db/keys.go

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

2 changes: 1 addition & 1 deletion storage/ent/db/keys_create.go

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

2 changes: 1 addition & 1 deletion storage/ent/db/keys_update.go

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

2 changes: 1 addition & 1 deletion storage/ent/db/mutation.go

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

2 changes: 1 addition & 1 deletion storage/ent/schema/keys.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package schema
import (
"entgo.io/ent"
"entgo.io/ent/schema/field"
"gopkg.in/square/go-jose.v2"
"github.com/go-jose/go-jose/v4"

"github.com/dexidp/dex/storage"
)
Expand Down
2 changes: 1 addition & 1 deletion storage/etcd/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ package etcd
import (
"time"

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

"github.com/dexidp/dex/storage"
)
Expand Down
2 changes: 1 addition & 1 deletion storage/kubernetes/types.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import (
"strings"
"time"

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

"github.com/dexidp/dex/storage"
"github.com/dexidp/dex/storage/kubernetes/k8sapi"
Expand Down
2 changes: 1 addition & 1 deletion storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import (
"strings"
"time"

jose "gopkg.in/square/go-jose.v2"
"github.com/go-jose/go-jose/v4"
)

var (
Expand Down

0 comments on commit 3720b21

Please sign in to comment.