Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion commands/login.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"strings"
"time"

"github.com/lestrrat-go/jwx/v2/jwa"
"github.com/lestrrat-go/jwx/v3/jwa"
"github.com/openpubkey/openpubkey/client"
"github.com/openpubkey/openpubkey/client/choosers"
"github.com/openpubkey/openpubkey/oidc"
Expand All @@ -42,7 +42,7 @@
"github.com/openpubkey/openpubkey/providers"
"github.com/openpubkey/openpubkey/util"
"github.com/openpubkey/opkssh/commands/config"
"github.com/openpubkey/opkssh/sshcert"

Check failure on line 45 in commands/login.go

View workflow job for this annotation

GitHub Actions / Run golangci linter

could not import github.com/openpubkey/opkssh/sshcert (-: # github.com/openpubkey/opkssh/sshcert
"github.com/spf13/afero"
"golang.org/x/crypto/ssh"
)
Expand Down Expand Up @@ -403,12 +403,12 @@
func (l *LoginCmd) login(ctx context.Context, provider providers.OpenIdProvider, printIdToken bool, seckeyPath string) (*LoginCmd, error) {
var err error
alg := jwa.ES256
signer, err := util.GenKeyPair(alg)

Check failure on line 406 in commands/login.go

View workflow job for this annotation

GitHub Actions / Run golangci linter

cannot use alg (variable of type func() "github.com/lestrrat-go/jwx/v3/jwa".SignatureAlgorithm) as "github.com/lestrrat-go/jwx/v2/jwa".KeyAlgorithm value in argument to util.GenKeyPair: func() "github.com/lestrrat-go/jwx/v3/jwa".SignatureAlgorithm does not implement "github.com/lestrrat-go/jwx/v2/jwa".KeyAlgorithm (missing method String) (typecheck)
if err != nil {
return nil, fmt.Errorf("failed to generate keypair: %w", err)
}

opkClient, err := client.New(provider, client.WithSigner(signer, alg))

Check failure on line 411 in commands/login.go

View workflow job for this annotation

GitHub Actions / Run golangci linter

cannot use alg (variable of type func() "github.com/lestrrat-go/jwx/v3/jwa".SignatureAlgorithm) as "github.com/lestrrat-go/jwx/v2/jwa".KeyAlgorithm value in argument to client.WithSigner: func() "github.com/lestrrat-go/jwx/v3/jwa".SignatureAlgorithm does not implement "github.com/lestrrat-go/jwx/v2/jwa".KeyAlgorithm (missing method String) (typecheck)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -472,7 +472,7 @@
pkt: pkt,
signer: signer,
client: opkClient,
alg: alg,

Check failure on line 475 in commands/login.go

View workflow job for this annotation

GitHub Actions / Run golangci linter

cannot use alg (variable of type func() "github.com/lestrrat-go/jwx/v3/jwa".SignatureAlgorithm) as "github.com/lestrrat-go/jwx/v3/jwa".SignatureAlgorithm value in struct literal (typecheck)
principals: principals,
}, nil
}
Expand Down
2 changes: 1 addition & 1 deletion commands/login_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"path/filepath"
"testing"

"github.com/lestrrat-go/jwx/v2/jwa"
"github.com/lestrrat-go/jwx/v3/jwa"
"github.com/openpubkey/openpubkey/client"
"github.com/openpubkey/openpubkey/pktoken"
"github.com/openpubkey/openpubkey/providers"
Expand Down Expand Up @@ -55,7 +55,7 @@

func Mocks(t *testing.T) (*pktoken.PKToken, crypto.Signer, providers.OpenIdProvider) {
alg := jwa.ES256
signer, err := util.GenKeyPair(alg)

Check failure on line 58 in commands/login_test.go

View workflow job for this annotation

GitHub Actions / Run golangci linter

cannot use alg (variable of type func() "github.com/lestrrat-go/jwx/v3/jwa".SignatureAlgorithm) as "github.com/lestrrat-go/jwx/v2/jwa".KeyAlgorithm value in argument to util.GenKeyPair: func() "github.com/lestrrat-go/jwx/v3/jwa".SignatureAlgorithm does not implement "github.com/lestrrat-go/jwx/v2/jwa".KeyAlgorithm (missing method String) (typecheck)
require.NoError(t, err)

providerOpts := providers.DefaultMockProviderOpts()
Expand All @@ -67,7 +67,7 @@
"email": mockEmail,
}

client, err := client.New(op, client.WithSigner(signer, alg))

Check failure on line 70 in commands/login_test.go

View workflow job for this annotation

GitHub Actions / Run golangci linter

cannot use alg (variable of type func() "github.com/lestrrat-go/jwx/v3/jwa".SignatureAlgorithm) as "github.com/lestrrat-go/jwx/v2/jwa".KeyAlgorithm value in argument to client.WithSigner: func() "github.com/lestrrat-go/jwx/v3/jwa".SignatureAlgorithm does not implement "github.com/lestrrat-go/jwx/v2/jwa".KeyAlgorithm (missing method String) (typecheck)
require.NoError(t, err)

pkt, err := client.Auth(context.Background())
Expand Down
2 changes: 1 addition & 1 deletion commands/verify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"strings"
"testing"

"github.com/lestrrat-go/jwx/v2/jwa"
"github.com/lestrrat-go/jwx/v3/jwa"
"github.com/openpubkey/openpubkey/client"
"github.com/openpubkey/openpubkey/pktoken"
"github.com/openpubkey/openpubkey/providers"
Expand Down Expand Up @@ -65,7 +65,7 @@
expectedAccessToken := "fake-auth-token"

alg := jwa.ES256
signer, err := util.GenKeyPair(alg)

Check failure on line 68 in commands/verify_test.go

View workflow job for this annotation

GitHub Actions / Run golangci linter

cannot use alg (variable of type func() "github.com/lestrrat-go/jwx/v3/jwa".SignatureAlgorithm) as "github.com/lestrrat-go/jwx/v2/jwa".KeyAlgorithm value in argument to util.GenKeyPair: func() "github.com/lestrrat-go/jwx/v3/jwa".SignatureAlgorithm does not implement "github.com/lestrrat-go/jwx/v2/jwa".KeyAlgorithm (missing method String) (typecheck)
require.NoError(t, err)

providerOpts := providers.DefaultMockProviderOpts()
Expand Down Expand Up @@ -102,7 +102,7 @@
}
for _, tt := range tests {
t.Run(tt.name, func(t *testing.T) {
client, err := client.New(op, client.WithSigner(signer, alg))

Check failure on line 105 in commands/verify_test.go

View workflow job for this annotation

GitHub Actions / Run golangci linter

cannot use alg (variable of type func() "github.com/lestrrat-go/jwx/v3/jwa".SignatureAlgorithm) as "github.com/lestrrat-go/jwx/v2/jwa".KeyAlgorithm value in argument to client.WithSigner: func() "github.com/lestrrat-go/jwx/v3/jwa".SignatureAlgorithm does not implement "github.com/lestrrat-go/jwx/v2/jwa".KeyAlgorithm (missing method String) (typecheck)
require.NoError(t, err)

pkt, err := client.Auth(context.Background())
Expand Down
7 changes: 5 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ require (
github.com/docker/go-connections v0.5.0
github.com/jeremija/gosubmit v0.2.8
github.com/kballard/go-shellquote v0.0.0-20180428030007-95032a82bc51
github.com/lestrrat-go/jwx/v2 v2.1.6
github.com/lestrrat-go/jwx/v3 v3.0.8
github.com/melbahja/goph v1.4.0
github.com/openpubkey/openpubkey v0.17.0
github.com/spf13/cobra v1.9.1
Expand Down Expand Up @@ -43,6 +43,9 @@ require (
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/klauspost/compress v1.17.4 // indirect
github.com/kr/fs v0.1.0 // indirect
github.com/lestrrat-go/httprc/v3 v3.0.0 // indirect
github.com/lestrrat-go/jwx/v2 v2.0.21 // indirect
github.com/lestrrat-go/option/v2 v2.0.0 // indirect
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 // indirect
github.com/magiconair/properties v1.8.10 // indirect
github.com/moby/docker-image-spec v1.3.1 // indirect
Expand Down Expand Up @@ -82,7 +85,7 @@ require (
github.com/davecgh/go-spew v1.1.1 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.4.0 // indirect
github.com/goccy/go-json v0.10.3 // indirect
github.com/lestrrat-go/blackmagic v1.0.3 // indirect
github.com/lestrrat-go/blackmagic v1.0.4 // indirect
github.com/lestrrat-go/httpcc v1.0.1 // indirect
github.com/lestrrat-go/httprc v1.0.6 // indirect
github.com/lestrrat-go/iter v1.0.2 // indirect
Expand Down
16 changes: 12 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,24 @@ github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/lestrrat-go/blackmagic v1.0.3 h1:94HXkVLxkZO9vJI/w2u1T0DAoprShFd13xtnSINtDWs=
github.com/lestrrat-go/blackmagic v1.0.3/go.mod h1:6AWFyKNNj0zEXQYfTMPfZrAXUWUfTIZ5ECEUEJaijtw=
github.com/lestrrat-go/blackmagic v1.0.4 h1:IwQibdnf8l2KoO+qC3uT4OaTWsW7tuRQXy9TRN9QanA=
github.com/lestrrat-go/blackmagic v1.0.4/go.mod h1:6AWFyKNNj0zEXQYfTMPfZrAXUWUfTIZ5ECEUEJaijtw=
github.com/lestrrat-go/httpcc v1.0.1 h1:ydWCStUeJLkpYyjLDHihupbn2tYmZ7m22BGkcvZZrIE=
github.com/lestrrat-go/httpcc v1.0.1/go.mod h1:qiltp3Mt56+55GPVCbTdM9MlqhvzyuL6W/NMDA8vA5E=
github.com/lestrrat-go/httprc v1.0.6 h1:qgmgIRhpvBqexMJjA/PmwSvhNk679oqD1RbovdCGW8k=
github.com/lestrrat-go/httprc v1.0.6/go.mod h1:mwwz3JMTPBjHUkkDv/IGJ39aALInZLrhBp0X7KGUZlo=
github.com/lestrrat-go/httprc/v3 v3.0.0 h1:nZUx/zFg5uc2rhlu1L1DidGr5Sj02JbXvGSpnY4LMrc=
github.com/lestrrat-go/httprc/v3 v3.0.0/go.mod h1:k2U1QIiyVqAKtkffbg+cUmsyiPGQsb9aAfNQiNFuQ9Q=
github.com/lestrrat-go/iter v1.0.2 h1:gMXo1q4c2pHmC3dn8LzRhJfP1ceCbgSiT9lUydIzltI=
github.com/lestrrat-go/iter v1.0.2/go.mod h1:Momfcq3AnRlRjI5b5O8/G5/BvpzrhoFTZcn06fEOPt4=
github.com/lestrrat-go/jwx/v2 v2.1.6 h1:hxM1gfDILk/l5ylers6BX/Eq1m/pnxe9NBwW6lVfecA=
github.com/lestrrat-go/jwx/v2 v2.1.6/go.mod h1:Y722kU5r/8mV7fYDifjug0r8FK8mZdw0K0GpJw/l8pU=
github.com/lestrrat-go/jwx/v2 v2.0.21 h1:jAPKupy4uHgrHFEdjVjNkUgoBKtVDgrQPB/h55FHrR0=
github.com/lestrrat-go/jwx/v2 v2.0.21/go.mod h1:09mLW8zto6bWL9GbwnqAli+ArLf+5M33QLQPDggkUWM=
github.com/lestrrat-go/jwx/v3 v3.0.8 h1:lOCHy+k4/mgRI8FkgkHO+NsUx1GXHHktGx0CIkFToyI=
github.com/lestrrat-go/jwx/v3 v3.0.8/go.mod h1:0P9rjqNMDOspNSetpKX86Go54jLSEwCh8ax4jQRGYL0=
github.com/lestrrat-go/option v1.0.1 h1:oAzP2fvZGQKWkvHa1/SAcFolBEca1oN+mQ7eooNBEYU=
github.com/lestrrat-go/option v1.0.1/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I=
github.com/lestrrat-go/option/v2 v2.0.0 h1:XxrcaJESE1fokHy3FpaQ/cXW8ZsIdWcdFzzLOcID3Ss=
github.com/lestrrat-go/option/v2 v2.0.0/go.mod h1:oSySsmzMoR0iRzCDCaUfsCzxQHUEuhOViQObyy7S6Vg=
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0 h1:6E+4a0GO5zZEnZ81pIr0yLvtUWk2if982qA3F3QD6H4=
github.com/lufia/plan9stats v0.0.0-20211012122336-39d0f177ccd0/go.mod h1:zJYVVT2jmtg6P3p1VtQj7WsuWi/y4VnjVBn7F8KPB3I=
github.com/magiconair/properties v1.8.10 h1:s31yESBquKXCV9a/ScB3ESkOjUYYv+X0rg8SYxI99mE=
Expand Down Expand Up @@ -170,6 +176,8 @@ github.com/tklauser/go-sysconf v0.3.12 h1:0QaGUFOdQaIVdPgfITYzaTegZvdCjmYO52cSFA
github.com/tklauser/go-sysconf v0.3.12/go.mod h1:Ho14jnntGE1fpdOqQEEaiKRpvIavV0hSfmBq8nJbHYI=
github.com/tklauser/numcpus v0.6.1 h1:ng9scYS7az0Bk4OZLvrNXNSAO2Pxr1XXRAPyjhIx+Fk=
github.com/tklauser/numcpus v0.6.1/go.mod h1:1XfjsgE2zo8GVw7POkMbHENHzVg3GzmoZ9fESEdAacY=
github.com/valyala/fastjson v1.6.4 h1:uAUNq9Z6ymTgGhcm0UynUAB6tlbakBrz6CQFax3BXVQ=
github.com/valyala/fastjson v1.6.4/go.mod h1:CLCAqky6SMuOcxStkYQvblddUtoRxhYMGLrsQns1aXY=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
Expand Down
2 changes: 1 addition & 1 deletion policy/plugins/plugins_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"strings"
"testing"

"github.com/lestrrat-go/jwx/v2/jwa"
"github.com/lestrrat-go/jwx/v3/jwa"
"github.com/openpubkey/openpubkey/client"
"github.com/openpubkey/openpubkey/providers"
"github.com/openpubkey/openpubkey/util"
Expand Down Expand Up @@ -493,7 +493,7 @@
require.NoError(t, err)

alg := jwa.ES256
signer, err := util.GenKeyPair(alg)

Check failure on line 496 in policy/plugins/plugins_test.go

View workflow job for this annotation

GitHub Actions / Run Tests

cannot use alg (variable of type func() "github.com/lestrrat-go/jwx/v3/jwa".SignatureAlgorithm) as "github.com/lestrrat-go/jwx/v2/jwa".KeyAlgorithm value in argument to util.GenKeyPair: func() "github.com/lestrrat-go/jwx/v3/jwa".SignatureAlgorithm does not implement "github.com/lestrrat-go/jwx/v2/jwa".KeyAlgorithm (missing method String)
require.NoError(t, err)

providerOpts := providers.DefaultMockProviderOpts()
Expand All @@ -505,7 +505,7 @@
"email": mockEmail,
}

client, err := client.New(op, client.WithSigner(signer, alg))

Check failure on line 508 in policy/plugins/plugins_test.go

View workflow job for this annotation

GitHub Actions / Run Tests

cannot use alg (variable of type func() "github.com/lestrrat-go/jwx/v3/jwa".SignatureAlgorithm) as "github.com/lestrrat-go/jwx/v2/jwa".KeyAlgorithm value in argument to client.WithSigner: func() "github.com/lestrrat-go/jwx/v3/jwa".SignatureAlgorithm does not implement "github.com/lestrrat-go/jwx/v2/jwa".KeyAlgorithm (missing method String)
require.NoError(t, err)

pkt, err := client.Auth(context.Background())
Expand Down
2 changes: 1 addition & 1 deletion sshcert/sshcert.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"fmt"
"time"

"github.com/lestrrat-go/jwx/v2/jwk"
"github.com/lestrrat-go/jwx/v3/jwk"
"github.com/openpubkey/openpubkey/pktoken"
"github.com/openpubkey/openpubkey/verifier"
"golang.org/x/crypto/ssh"
Expand Down Expand Up @@ -151,12 +151,12 @@
upk := cic.PublicKey()

cryptoCertKey := (s.SshCert.Key.(ssh.CryptoPublicKey)).CryptoPublicKey()
jwkCertKey, err := jwk.FromRaw(cryptoCertKey)

Check failure on line 154 in sshcert/sshcert.go

View workflow job for this annotation

GitHub Actions / Run Tests

undefined: jwk.FromRaw

Check failure on line 154 in sshcert/sshcert.go

View workflow job for this annotation

GitHub Actions / Run golangci linter

undefined: jwk.FromRaw

Check failure on line 154 in sshcert/sshcert.go

View workflow job for this annotation

GitHub Actions / Build (1.23.x)

undefined: jwk.FromRaw

Check failure on line 154 in sshcert/sshcert.go

View workflow job for this annotation

GitHub Actions / Build opkssh with GoReleaser

undefined: jwk.FromRaw
if err != nil {
return nil, err
}

if jwk.Equal(jwkCertKey, upk) {

Check failure on line 159 in sshcert/sshcert.go

View workflow job for this annotation

GitHub Actions / Run Tests

cannot use upk (variable of type "github.com/lestrrat-go/jwx/v2/jwk".Key) as "github.com/lestrrat-go/jwx/v3/jwk".Key value in argument to jwk.Equal: "github.com/lestrrat-go/jwx/v2/jwk".Key does not implement "github.com/lestrrat-go/jwx/v3/jwk".Key (wrong type for method Algorithm)

Check failure on line 159 in sshcert/sshcert.go

View workflow job for this annotation

GitHub Actions / Run golangci linter

cannot use upk (variable of type "github.com/lestrrat-go/jwx/v2/jwk".Key) as "github.com/lestrrat-go/jwx/v3/jwk".Key value in argument to jwk.Equal: "github.com/lestrrat-go/jwx/v2/jwk".Key does not implement "github.com/lestrrat-go/jwx/v3/jwk".Key (wrong type for method Algorithm)

Check failure on line 159 in sshcert/sshcert.go

View workflow job for this annotation

GitHub Actions / Build (1.23.x)

cannot use upk (variable of type "github.com/lestrrat-go/jwx/v2/jwk".Key) as "github.com/lestrrat-go/jwx/v3/jwk".Key value in argument to jwk.Equal: "github.com/lestrrat-go/jwx/v2/jwk".Key does not implement "github.com/lestrrat-go/jwx/v3/jwk".Key (wrong type for method Algorithm)

Check failure on line 159 in sshcert/sshcert.go

View workflow job for this annotation

GitHub Actions / Build opkssh with GoReleaser

cannot use upk (variable of type "github.com/lestrrat-go/jwx/v2/jwk".Key) as "github.com/lestrrat-go/jwx/v3/jwk".Key value in argument to jwk.Equal: "github.com/lestrrat-go/jwx/v2/jwk".Key does not implement "github.com/lestrrat-go/jwx/v3/jwk".Key (wrong type for method Algorithm)
return pkt, nil
} else {
return nil, fmt.Errorf("public key 'upk' in PK Token does not match public key in certificate")
Expand Down
2 changes: 1 addition & 1 deletion sshcert/sshcert_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ import (
"strings"
"testing"

"github.com/lestrrat-go/jwx/v2/jwk"
"github.com/lestrrat-go/jwx/v3/jwk"
"github.com/openpubkey/openpubkey/client"
"github.com/openpubkey/openpubkey/pktoken"
"github.com/openpubkey/openpubkey/providers"
Expand Down
Loading