Skip to content

Commit

Permalink
replace gopkg.in/square/go-jose.v2 to github.com/go-jose/go-jose/v4 (#…
Browse files Browse the repository at this point in the history
…1686)

Signed-off-by: cpanato <ctadeu@gmail.com>
  • Loading branch information
cpanato authored Jun 24, 2024
1 parent 0367b02 commit 14ca3dc
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 45 deletions.
3 changes: 1 addition & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ require (
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d
github.com/coreos/go-oidc/v3 v3.10.0
github.com/fsnotify/fsnotify v1.7.0
github.com/go-jose/go-jose/v4 v4.0.2
github.com/goadesign/goa v2.2.5+incompatible
github.com/golang/protobuf v1.5.4
github.com/google/certificate-transparency-go v1.2.1
Expand Down Expand Up @@ -39,7 +40,6 @@ require (
google.golang.org/genproto/googleapis/api v0.0.0-20240610135401-a8a62080eff3
google.golang.org/grpc v1.64.0
google.golang.org/protobuf v1.34.2
gopkg.in/square/go-jose.v2 v2.6.0
gopkg.in/yaml.v3 v3.0.1
sigs.k8s.io/release-utils v0.8.2
)
Expand Down Expand Up @@ -83,7 +83,6 @@ require (
github.com/common-nighthawk/go-figure v0.0.0-20210622060536-734e95fb86be // indirect
github.com/felixge/httpsnoop v1.0.4 // indirect
github.com/go-jose/go-jose/v3 v3.0.3 // indirect
github.com/go-jose/go-jose/v4 v4.0.2 // indirect
github.com/go-logr/logr v1.4.1 // indirect
github.com/go-logr/stdr v1.2.2 // indirect
github.com/golang-jwt/jwt/v5 v5.2.1 // indirect
Expand Down
2 changes: 0 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -528,8 +528,6 @@ gopkg.in/go-jose/go-jose.v2 v2.6.3 h1:nt80fvSDlhKWQgSWyHyy5CfmlQr+asih51R8PTWNKK
gopkg.in/go-jose/go-jose.v2 v2.6.3/go.mod h1:zzZDPkNNw/c9IE7Z9jr11mBZQhKQTMzoEEIoEdZlFBI=
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
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.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
Expand Down
9 changes: 5 additions & 4 deletions pkg/server/grpc_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,13 @@ import (
"errors"
"fmt"

ctclient "github.com/google/certificate-transparency-go/client"
health "google.golang.org/grpc/health/grpc_health_v1"

ctclient "github.com/google/certificate-transparency-go/client"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"

certauth "github.com/sigstore/fulcio/pkg/ca"
"github.com/sigstore/fulcio/pkg/challenges"
"github.com/sigstore/fulcio/pkg/config"
Expand All @@ -33,9 +37,6 @@ import (
"github.com/sigstore/fulcio/pkg/identity"
"github.com/sigstore/fulcio/pkg/log"
"github.com/sigstore/sigstore/pkg/cryptoutils"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
)

type GRPCCAServer interface {
Expand Down
76 changes: 39 additions & 37 deletions pkg/server/grpc_server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -39,22 +39,24 @@ import (
"testing"
"time"

"github.com/go-jose/go-jose/v4"
"github.com/go-jose/go-jose/v4/jwt"
ctclient "github.com/google/certificate-transparency-go/client"
"github.com/google/certificate-transparency-go/jsonclient"

"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/status"
"google.golang.org/grpc/test/bufconn"

"github.com/sigstore/fulcio/pkg/ca"
"github.com/sigstore/fulcio/pkg/ca/ephemeralca"
"github.com/sigstore/fulcio/pkg/config"
"github.com/sigstore/fulcio/pkg/generated/protobuf"
"github.com/sigstore/fulcio/pkg/identity"
"github.com/sigstore/sigstore/pkg/cryptoutils"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/credentials/insecure"
"google.golang.org/grpc/resolver"
"google.golang.org/grpc/status"
"google.golang.org/grpc/test/bufconn"
"gopkg.in/square/go-jose.v2"
"gopkg.in/square/go-jose.v2/jwt"
)

const (
Expand Down Expand Up @@ -521,9 +523,9 @@ func TestAPIWithEmail(t *testing.T) {
Expiry: jwt.NewNumericDate(time.Now().Add(30 * time.Minute)),
Subject: c.Subject,
Audience: jwt.Audience{"sigstore"},
}).Claims(customClaims{Email: c.Subject, EmailVerified: true}).CompactSerialize()
}).Claims(customClaims{Email: c.Subject, EmailVerified: true}).Serialize()
if err != nil {
t.Fatalf("CompactSerialize() = %v", err)
t.Fatalf("Serialize() = %v", err)
}

ctClient, eca := createCA(cfg, t)
Expand Down Expand Up @@ -610,9 +612,9 @@ func TestAPIWithUsername(t *testing.T) {
Expiry: jwt.NewNumericDate(time.Now().Add(30 * time.Minute)),
Subject: c.Subject,
Audience: jwt.Audience{"sigstore"},
}).Claims(customClaims{Email: c.Subject, EmailVerified: true}).CompactSerialize()
}).Claims(customClaims{Email: c.Subject, EmailVerified: true}).Serialize()
if err != nil {
t.Fatalf("CompactSerialize() = %v", err)
t.Fatalf("Serialize() = %v", err)
}

ctClient, eca := createCA(cfg, t)
Expand Down Expand Up @@ -708,9 +710,9 @@ func TestAPIWithUriSubject(t *testing.T) {
Expiry: jwt.NewNumericDate(time.Now().Add(30 * time.Minute)),
Subject: c.Subject,
Audience: jwt.Audience{"sigstore"},
}).CompactSerialize()
}).Serialize()
if err != nil {
t.Fatalf("CompactSerialize() = %v", err)
t.Fatalf("Serialize() = %v", err)
}

ctClient, eca := createCA(cfg, t)
Expand Down Expand Up @@ -801,9 +803,9 @@ func TestAPIWithKubernetes(t *testing.T) {
Expiry: jwt.NewNumericDate(time.Now().Add(30 * time.Minute)),
Subject: k8sSubject,
Audience: jwt.Audience{"sigstore"},
}).Claims(&claims).CompactSerialize()
}).Claims(&claims).Serialize()
if err != nil {
t.Fatalf("CompactSerialize() = %v", err)
t.Fatalf("Serialize() = %v", err)
}

ctClient, eca := createCA(cfg, t)
Expand Down Expand Up @@ -890,9 +892,9 @@ func TestAPIWithBuildkite(t *testing.T) {
Expiry: jwt.NewNumericDate(time.Now().Add(30 * time.Minute)),
Subject: buildkiteSubject,
Audience: jwt.Audience{"sigstore"},
}).Claims(&claims).CompactSerialize()
}).Claims(&claims).Serialize()
if err != nil {
t.Fatalf("CompactSerialize() = %v", err)
t.Fatalf("Serialize() = %v", err)
}

ctClient, eca := createCA(cfg, t)
Expand Down Expand Up @@ -1008,9 +1010,9 @@ func TestAPIWithGitHub(t *testing.T) {
Expiry: jwt.NewNumericDate(time.Now().Add(30 * time.Minute)),
Subject: githubSubject,
Audience: jwt.Audience{"sigstore"},
}).Claims(&claims).CompactSerialize()
}).Claims(&claims).Serialize()
if err != nil {
t.Fatalf("CompactSerialize() = %v", err)
t.Fatalf("Serialize() = %v", err)
}

ctClient, eca := createCA(cfg, t)
Expand Down Expand Up @@ -1176,9 +1178,9 @@ func TestAPIWithGitLab(t *testing.T) {
Expiry: jwt.NewNumericDate(time.Now().Add(30 * time.Minute)),
Subject: gitLabSubject,
Audience: jwt.Audience{"sigstore"},
}).Claims(&claims).CompactSerialize()
}).Claims(&claims).Serialize()
if err != nil {
t.Fatalf("CompactSerialize() = %v", err)
t.Fatalf("Serialize() = %v", err)
}

ctClient, eca := createCA(cfg, t)
Expand Down Expand Up @@ -1319,9 +1321,9 @@ func TestAPIWithCodefresh(t *testing.T) {
Expiry: jwt.NewNumericDate(time.Now().Add(30 * time.Minute)),
Subject: codefreshSubject,
Audience: jwt.Audience{"sigstore"},
}).Claims(&claims).CompactSerialize()
}).Claims(&claims).Serialize()
if err != nil {
t.Fatalf("CompactSerialize() = %v", err)
t.Fatalf("Serialize() = %v", err)
}

ctClient, eca := createCA(cfg, t)
Expand Down Expand Up @@ -1427,9 +1429,9 @@ func TestAPIWithIssuerClaimConfig(t *testing.T) {
Expiry: jwt.NewNumericDate(time.Now().Add(30 * time.Minute)),
Subject: emailSubject,
Audience: jwt.Audience{"sigstore"},
}).Claims(customClaims{Email: emailSubject, EmailVerified: true, OtherIssuer: otherIssuerVal}).CompactSerialize()
}).Claims(customClaims{Email: emailSubject, EmailVerified: true, OtherIssuer: otherIssuerVal}).Serialize()
if err != nil {
t.Fatalf("CompactSerialize() = %v", err)
t.Fatalf("Serialize() = %v", err)
}

ctClient, eca := createCA(cfg, t)
Expand Down Expand Up @@ -1503,9 +1505,9 @@ func TestAPIWithCSRChallenge(t *testing.T) {
Expiry: jwt.NewNumericDate(time.Now().Add(30 * time.Minute)),
Subject: emailSubject,
Audience: jwt.Audience{"sigstore"},
}).Claims(customClaims{Email: emailSubject, EmailVerified: true}).CompactSerialize()
}).Claims(customClaims{Email: emailSubject, EmailVerified: true}).Serialize()
if err != nil {
t.Fatalf("CompactSerialize() = %v", err)
t.Fatalf("Serialize() = %v", err)
}

ctClient, eca := createCA(cfg, t)
Expand Down Expand Up @@ -1585,9 +1587,9 @@ func TestAPIWithInsecurePublicKey(t *testing.T) {
Expiry: jwt.NewNumericDate(time.Now().Add(30 * time.Minute)),
Subject: emailSubject,
Audience: jwt.Audience{"sigstore"},
}).Claims(customClaims{Email: emailSubject, EmailVerified: true}).CompactSerialize()
}).Claims(customClaims{Email: emailSubject, EmailVerified: true}).Serialize()
if err != nil {
t.Fatalf("CompactSerialize() = %v", err)
t.Fatalf("Serialize() = %v", err)
}

ctClient, eca := createCA(cfg, t)
Expand Down Expand Up @@ -1660,9 +1662,9 @@ func TestAPIWithoutPublicKey(t *testing.T) {
Expiry: jwt.NewNumericDate(time.Now().Add(30 * time.Minute)),
Subject: emailSubject,
Audience: jwt.Audience{"sigstore"},
}).Claims(customClaims{Email: emailSubject, EmailVerified: true}).CompactSerialize()
}).Claims(customClaims{Email: emailSubject, EmailVerified: true}).Serialize()
if err != nil {
t.Fatalf("CompactSerialize() = %v", err)
t.Fatalf("Serialize() = %v", err)
}

ctClient, eca := createCA(cfg, t)
Expand Down Expand Up @@ -1736,9 +1738,9 @@ func TestAPIWithInvalidChallenge(t *testing.T) {
Expiry: jwt.NewNumericDate(time.Now().Add(30 * time.Minute)),
Subject: emailSubject,
Audience: jwt.Audience{"sigstore"},
}).Claims(customClaims{Email: emailSubject, EmailVerified: true}).CompactSerialize()
}).Claims(customClaims{Email: emailSubject, EmailVerified: true}).Serialize()
if err != nil {
t.Fatalf("CompactSerialize() = %v", err)
t.Fatalf("Serialize() = %v", err)
}

ctClient, eca := createCA(cfg, t)
Expand Down Expand Up @@ -1804,9 +1806,9 @@ func TestAPIWithInvalidCSR(t *testing.T) {
Expiry: jwt.NewNumericDate(time.Now().Add(30 * time.Minute)),
Subject: emailSubject,
Audience: jwt.Audience{"sigstore"},
}).Claims(customClaims{Email: emailSubject, EmailVerified: true}).CompactSerialize()
}).Claims(customClaims{Email: emailSubject, EmailVerified: true}).Serialize()
if err != nil {
t.Fatalf("CompactSerialize() = %v", err)
t.Fatalf("Serialize() = %v", err)
}

ctClient, eca := createCA(cfg, t)
Expand Down Expand Up @@ -1865,9 +1867,9 @@ func TestAPIWithInvalidCSRSignature(t *testing.T) {
Expiry: jwt.NewNumericDate(time.Now().Add(30 * time.Minute)),
Subject: emailSubject,
Audience: jwt.Audience{"sigstore"},
}).Claims(customClaims{Email: emailSubject, EmailVerified: true}).CompactSerialize()
}).Claims(customClaims{Email: emailSubject, EmailVerified: true}).Serialize()
if err != nil {
t.Fatalf("CompactSerialize() = %v", err)
t.Fatalf("Serialize() = %v", err)
}

ctClient, eca := createCA(cfg, t)
Expand Down

0 comments on commit 14ca3dc

Please sign in to comment.