-
Notifications
You must be signed in to change notification settings - Fork 28
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore(release): upgrade types to v0.24.0-rc1 #1136
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
// Use IntelliSense to learn about possible attributes. | ||
// Hover to view descriptions of existing attributes. | ||
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 | ||
"version": "0.2.0", | ||
"configurations": [] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,7 +12,7 @@ | |
|
||
"github.com/adhocore/gronx" | ||
"github.com/google/go-cmp/cmp" | ||
"github.com/lestrrat-go/jwx/jwk" | ||
"github.com/lestrrat-go/jwx/v2/jwk" | ||
|
||
api "github.com/go-vela/server/api/types" | ||
"github.com/go-vela/server/api/types/settings" | ||
|
@@ -878,7 +878,7 @@ | |
} | ||
|
||
for i := 0; i < resources.JWKs.Len(); i++ { | ||
jk, _ := resources.JWKs.Get(i) | ||
jk, _ := resources.JWKs.Key(i) | ||
|
||
jkPub, _ := jk.(jwk.RSAPublicKey) | ||
|
||
|
@@ -901,7 +901,7 @@ | |
methods["ListJWKs"] = true | ||
|
||
for i := 0; i < resources.JWKs.Len(); i++ { | ||
jk, _ := resources.JWKs.Get(i) | ||
jk, _ := resources.JWKs.Key(i) | ||
|
||
jkPub, _ := jk.(jwk.RSAPublicKey) | ||
|
||
|
@@ -923,7 +923,7 @@ | |
} | ||
|
||
for i := 0; i < resources.JWKs.Len(); i++ { | ||
jk, _ := resources.JWKs.Get(i) | ||
jk, _ := resources.JWKs.Key(i) | ||
|
||
jkPub, _ := jk.(jwk.RSAPublicKey) | ||
|
||
|
@@ -2576,8 +2576,8 @@ | |
jwkTwo := testutils.JWK() | ||
|
||
jwkSet := jwk.NewSet() | ||
jwkSet.Add(jwkOne) | ||
jwkSet.Add(jwkTwo) | ||
jwkSet.AddKey(jwkOne) | ||
Check failure on line 2579 in database/integration_test.go GitHub Actions / golangci[golangci] database/integration_test.go#L2579
Raw output
|
||
jwkSet.AddKey(jwkTwo) | ||
Check failure on line 2580 in database/integration_test.go GitHub Actions / golangci[golangci] database/integration_test.go#L2580
Raw output
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [golangci] reported by reviewdog 🐶 |
||
|
||
logServiceOne := new(library.Log) | ||
logServiceOne.SetID(1) | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
import ( | ||
"context" | ||
|
||
"github.com/lestrrat-go/jwx/jwk" | ||
"github.com/lestrrat-go/jwx/v2/jwk" | ||
|
||
"github.com/go-vela/server/constants" | ||
"github.com/go-vela/server/database/types" | ||
|
@@ -33,7 +33,7 @@ | |
tmp := key | ||
|
||
// convert query result to API type | ||
keySet.Add(tmp.ToAPI()) | ||
keySet.AddKey(tmp.ToAPI()) | ||
Check failure on line 36 in database/jwk/list.go GitHub Actions / golangci[golangci] database/jwk/list.go#L36
Raw output
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [golangci] reported by reviewdog 🐶 |
||
} | ||
|
||
return keySet, nil | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ | |
"testing" | ||
|
||
"github.com/DATA-DOG/go-sqlmock" | ||
"github.com/lestrrat-go/jwx/jwk" | ||
"github.com/lestrrat-go/jwx/v2/jwk" | ||
|
||
"github.com/go-vela/server/database/testutils" | ||
) | ||
|
@@ -54,8 +54,8 @@ | |
} | ||
|
||
wantSet := jwk.NewSet() | ||
wantSet.Add(_jwkOne) | ||
wantSet.Add(_jwkTwo) | ||
wantSet.AddKey(_jwkOne) | ||
Check failure on line 57 in database/jwk/list_test.go GitHub Actions / golangci[golangci] database/jwk/list_test.go#L57
Raw output
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [golangci] reported by reviewdog 🐶 |
||
wantSet.AddKey(_jwkTwo) | ||
Check failure on line 58 in database/jwk/list_test.go GitHub Actions / golangci[golangci] database/jwk/list_test.go#L58
Raw output
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [golangci] reported by reviewdog 🐶 |
||
|
||
// setup tests | ||
tests := []struct { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ | |
"crypto/rsa" | ||
|
||
"github.com/google/uuid" | ||
"github.com/lestrrat-go/jwx/jwk" | ||
"github.com/lestrrat-go/jwx/v2/jwk" | ||
|
||
api "github.com/go-vela/server/api/types" | ||
"github.com/go-vela/server/api/types/actions" | ||
|
@@ -288,10 +288,19 @@ | |
return nil | ||
} | ||
|
||
j := jwk.NewRSAPublicKey() | ||
_ = j.FromRaw(&privateRSAKey.PublicKey) | ||
pubKey, err := jwk.PublicRawKeyOf(&privateRSAKey.PublicKey) | ||
|
||
_ = j.Set(jwk.KeyIDKey, kid.String()) | ||
if err != nil { | ||
return nil | ||
} | ||
|
||
jk, ok := pubKey.(jwk.RSAPublicKey) | ||
|
||
if !ok { | ||
return nil | ||
} | ||
|
||
jk.Set(jwk.KeyIDKey, kid.String()) | ||
Check failure on line 303 in database/testutils/api_resources.go GitHub Actions / golangci[golangci] database/testutils/api_resources.go#L303
Raw output
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [golangci] reported by reviewdog 🐶 |
||
|
||
return j | ||
return jk | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,7 +8,7 @@ | |
"crypto/rsa" | ||
|
||
"github.com/google/uuid" | ||
"github.com/lestrrat-go/jwx/jwk" | ||
"github.com/lestrrat-go/jwx/v2/jwk" | ||
|
||
"github.com/go-vela/server/database" | ||
) | ||
|
@@ -27,20 +27,22 @@ | |
return err | ||
} | ||
|
||
j := jwk.NewRSAPublicKey() | ||
pubKey, err := jwk.PublicRawKeyOf(&privateRSAKey.PublicKey) | ||
|
||
err = j.FromRaw(&privateRSAKey.PublicKey) | ||
if err != nil { | ||
return err | ||
return nil | ||
Check failure on line 33 in internal/token/generate_rsa.go GitHub Actions / golangci[golangci] internal/token/generate_rsa.go#L33
Raw output
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [golangci] reported by reviewdog 🐶 |
||
} | ||
|
||
err = j.Set(jwk.KeyIDKey, kid.String()) | ||
if err != nil { | ||
return err | ||
jk, ok := pubKey.(jwk.RSAPublicKey) | ||
|
||
if !ok { | ||
return nil | ||
} | ||
|
||
jk.Set(jwk.KeyIDKey, kid.String()) | ||
Check failure on line 42 in internal/token/generate_rsa.go GitHub Actions / golangci[golangci] internal/token/generate_rsa.go#L42
Raw output
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🚫 [golangci] reported by reviewdog 🐶 |
||
|
||
// create the JWK in the database | ||
err = db.CreateJWK(context.TODO(), j) | ||
err = db.CreateJWK(context.TODO(), jk) | ||
if err != nil { | ||
return err | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🚫 [golangci] reported by reviewdog 🐶
Error return value of
jwkSet.AddKey
is not checked (errcheck)