upgrade github.com/go-jose/go-jose and github.com/coreos/go-oidc

Also standardize some related imports and fix some whitespace in a test
This commit is contained in:
Ryan Richard
2024-06-21 11:16:40 -07:00
parent 10699314d4
commit 0380a9ce33
25 changed files with 301 additions and 142 deletions
+2 -2
View File
@@ -19,7 +19,7 @@ import (
"testing"
"time"
"github.com/go-jose/go-jose/v3"
"github.com/go-jose/go-jose/v4"
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
"golang.org/x/sync/errgroup"
@@ -193,7 +193,7 @@ func TestCLILoginOIDC_Browser(t *testing.T) {
// Assert some properties about the token, which should be a valid JWT.
require.NotEmpty(t, credOutput.Status.Token)
jws, err := jose.ParseSigned(credOutput.Status.Token)
jws, err := jose.ParseSigned(credOutput.Status.Token, []jose.SignatureAlgorithm{jose.ES256, jose.RS256})
require.NoError(t, err)
claims := map[string]any{}
require.NoError(t, json.Unmarshal(jws.UnsafePayloadWithoutVerification(), &claims))
@@ -10,7 +10,8 @@ import (
"testing"
"time"
"github.com/go-jose/go-jose/v3/jwt"
"github.com/go-jose/go-jose/v4"
josejwt "github.com/go-jose/go-jose/v4/jwt"
"github.com/stretchr/testify/require"
corev1 "k8s.io/api/core/v1"
apierrors "k8s.io/apimachinery/pkg/api/errors"
@@ -219,7 +220,7 @@ func safeDerefStringPtr(s *string) string {
func getJWTSubAndGroupsClaims(t *testing.T, jwtToken string) (string, []string) {
t.Helper()
token, err := jwt.ParseSigned(jwtToken)
token, err := josejwt.ParseSigned(jwtToken, []jose.SignatureAlgorithm{jose.ES256, jose.RS256})
require.NoError(t, err)
var claims struct {
+1 -1
View File
@@ -10,7 +10,7 @@ import (
"testing"
"time"
"github.com/go-jose/go-jose/v3"
"github.com/go-jose/go-jose/v4"
"github.com/stretchr/testify/require"
corev1 "k8s.io/api/core/v1"
metav1 "k8s.io/apimachinery/pkg/apis/meta/v1"