Skip to content
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

Closed
wants to merge 2 commits into from
Closed
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
7 changes: 7 additions & 0 deletions .vscode/launch.json
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": []
}
2 changes: 1 addition & 1 deletion api/types/oidc.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ package types

import (
"github.com/golang-jwt/jwt/v5"
"github.com/lestrrat-go/jwx/jwk"
"github.com/lestrrat-go/jwx/v2/jwk"
)

// OpenIDConfig is a struct that represents the OpenID Connect configuration.
Expand Down
12 changes: 6 additions & 6 deletions database/integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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)

Expand All @@ -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)

Expand All @@ -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)

Expand Down Expand Up @@ -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

View workflow job for this annotation

GitHub Actions / golangci

[golangci] database/integration_test.go#L2579

Error return value of `jwkSet.AddKey` is not checked (errcheck)
Raw output
database/integration_test.go:2579:15: Error return value of `jwkSet.AddKey` is not checked (errcheck)
	jwkSet.AddKey(jwkOne)
	             ^
Copy link

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)

jwkSet.AddKey(jwkTwo)

Check failure on line 2580 in database/integration_test.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] database/integration_test.go#L2580

Error return value of `jwkSet.AddKey` is not checked (errcheck)
Raw output
database/integration_test.go:2580:15: Error return value of `jwkSet.AddKey` is not checked (errcheck)
	jwkSet.AddKey(jwkTwo)
	             ^
Copy link

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)


logServiceOne := new(library.Log)
logServiceOne.SetID(1)
Expand Down
2 changes: 1 addition & 1 deletion database/jwk/create.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import (
"context"
"database/sql"

"github.com/lestrrat-go/jwx/jwk"
"github.com/lestrrat-go/jwx/v2/jwk"
"github.com/sirupsen/logrus"

"github.com/go-vela/server/constants"
Expand Down
2 changes: 1 addition & 1 deletion database/jwk/get.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package jwk
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"
Expand Down
2 changes: 1 addition & 1 deletion database/jwk/get_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (

"github.com/DATA-DOG/go-sqlmock"
"github.com/google/go-cmp/cmp"
"github.com/lestrrat-go/jwx/jwk"
"github.com/lestrrat-go/jwx/v2/jwk"

"github.com/go-vela/server/database/testutils"
)
Expand Down
2 changes: 1 addition & 1 deletion database/jwk/interface.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ package jwk
import (
"context"

"github.com/lestrrat-go/jwx/jwk"
"github.com/lestrrat-go/jwx/v2/jwk"
)

// JWKInterface represents the Vela interface for JWK
Expand Down
4 changes: 2 additions & 2 deletions database/jwk/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

View workflow job for this annotation

GitHub Actions / golangci

[golangci] database/jwk/list.go#L36

Error return value of `keySet.AddKey` is not checked (errcheck)
Raw output
database/jwk/list.go:36:16: Error return value of `keySet.AddKey` is not checked (errcheck)
		keySet.AddKey(tmp.ToAPI())
		             ^
Copy link

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 keySet.AddKey is not checked (errcheck)

}

return keySet, nil
Expand Down
6 changes: 3 additions & 3 deletions database/jwk/list_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand Down Expand Up @@ -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

View workflow job for this annotation

GitHub Actions / golangci

[golangci] database/jwk/list_test.go#L57

Error return value of `wantSet.AddKey` is not checked (errcheck)
Raw output
database/jwk/list_test.go:57:16: Error return value of `wantSet.AddKey` is not checked (errcheck)
	wantSet.AddKey(_jwkOne)
	              ^
Copy link

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 wantSet.AddKey is not checked (errcheck)

wantSet.AddKey(_jwkTwo)

Check failure on line 58 in database/jwk/list_test.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] database/jwk/list_test.go#L58

Error return value of `wantSet.AddKey` is not checked (errcheck)
Raw output
database/jwk/list_test.go:58:16: Error return value of `wantSet.AddKey` is not checked (errcheck)
	wantSet.AddKey(_jwkTwo)
	              ^
Copy link

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 wantSet.AddKey is not checked (errcheck)


// setup tests
tests := []struct {
Expand Down
19 changes: 14 additions & 5 deletions database/testutils/api_resources.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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

View workflow job for this annotation

GitHub Actions / golangci

[golangci] database/testutils/api_resources.go#L303

Error return value of `jk.Set` is not checked (errcheck)
Raw output
database/testutils/api_resources.go:303:8: Error return value of `jk.Set` is not checked (errcheck)
	jk.Set(jwk.KeyIDKey, kid.String())
	      ^
Copy link

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 jk.Set is not checked (errcheck)


return j
return jk
}
2 changes: 1 addition & 1 deletion database/testutils/mock_args.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"time"

"github.com/google/go-cmp/cmp"
"github.com/lestrrat-go/jwx/jwk"
"github.com/lestrrat-go/jwx/v2/jwk"
)

// This will be used with the github.com/DATA-DOG/go-sqlmock library to compare values
Expand Down
2 changes: 1 addition & 1 deletion database/types/jwk.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import (
"errors"

"github.com/google/uuid"
"github.com/lestrrat-go/jwx/jwk"
"github.com/lestrrat-go/jwx/v2/jwk"
)

var (
Expand Down
7 changes: 4 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ require (
github.com/ghodss/yaml v1.0.0
github.com/gin-gonic/gin v1.10.0
github.com/go-playground/assert/v2 v2.2.0
github.com/go-vela/types v0.23.4-0.20240516161114-57d6b8f77b10
github.com/go-vela/types v0.24.0-rc1
github.com/golang-jwt/jwt/v5 v5.2.1
github.com/google/go-cmp v0.6.0
github.com/google/go-github/v61 v61.0.0
Expand All @@ -29,6 +29,7 @@ require (
github.com/hashicorp/go-retryablehttp v0.7.7
github.com/hashicorp/vault/api v1.14.0
github.com/joho/godotenv v1.5.1
github.com/lestrrat-go/jwx/v2 v2.0.21
github.com/lib/pq v1.10.9
github.com/microcosm-cc/bluemonday v1.0.26
github.com/pkg/errors v0.9.1
Expand All @@ -54,11 +55,12 @@ require (
github.com/cloudwego/iasm v0.2.0 // indirect
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
github.com/go-jose/go-jose/v4 v4.0.1 // indirect
github.com/lestrrat-go/backoff/v2 v2.0.8 // indirect
github.com/lestrrat-go/blackmagic v1.0.2 // indirect
github.com/lestrrat-go/httpcc v1.0.1 // indirect
github.com/lestrrat-go/httprc v1.0.5 // indirect
github.com/lestrrat-go/iter v1.0.2 // indirect
github.com/lestrrat-go/option v1.0.1 // indirect
github.com/segmentio/asm v1.2.0 // indirect
)

require (
Expand Down Expand Up @@ -104,7 +106,6 @@ require (
github.com/klauspost/cpuid/v2 v2.2.7 // indirect
github.com/kr/text v0.2.0 // indirect
github.com/leodido/go-urn v1.4.0 // indirect
github.com/lestrrat-go/jwx v1.2.29
github.com/mattn/go-isatty v0.0.20 // indirect
github.com/mattn/go-sqlite3 v1.14.17 // indirect
github.com/mitchellh/copystructure v1.0.0 // indirect
Expand Down
34 changes: 8 additions & 26 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ3
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs=
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0=
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f h1:lO4WD4F/rVNCu3HqELle0jiPLLBs70cWOduZpkS1E78=
Expand Down Expand Up @@ -92,8 +91,8 @@ github.com/go-playground/validator/v10 v10.20.0 h1:K9ISHbSaI0lyB2eWMPJo+kOS/FBEx
github.com/go-playground/validator/v10 v10.20.0/go.mod h1:dbuPbCMFw/DrkbEynArYaCwl3amGuJotoKCe95atGMM=
github.com/go-test/deep v1.0.2 h1:onZX1rnHT3Wv6cqNgYyFOOlgVKJrksuCMCRvJStbMYw=
github.com/go-test/deep v1.0.2/go.mod h1:wGDj63lr65AM2AQyKZd/NYHGb0R+1RLqB8NKt3aSFNA=
github.com/go-vela/types v0.23.4-0.20240516161114-57d6b8f77b10 h1:VQxIqxpJKIOzRnMi4z/d+EOo7jc5PXCnlUvZZl5ajzA=
github.com/go-vela/types v0.23.4-0.20240516161114-57d6b8f77b10/go.mod h1:vISsYDdjz9RPEK6qZ+MxtrdZEjTVU4K30NomB3826u8=
github.com/go-vela/types v0.24.0-rc1 h1:4NeH+YF8fVbs6ukilKySIY3uD2SVYgBz1yqREjgZaOw=
github.com/go-vela/types v0.24.0-rc1/go.mod h1:YWj6BIapl9Kbj4yHq/fp8jltXdGiwD/gTy1ez32Rzag=
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
github.com/gogo/protobuf v1.3.2 h1:Ov1cvc58UF3b5XjBnZv7+opcTcQFZebYjWzi34vdm4Q=
Expand Down Expand Up @@ -183,17 +182,16 @@ github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
github.com/leodido/go-urn v1.4.0 h1:WT9HwE9SGECu3lg4d/dIA+jxlljEa1/ffXKmRjqdmIQ=
github.com/leodido/go-urn v1.4.0/go.mod h1:bvxc+MVxLKB4z00jd1z+Dvzr47oO32F/QSNjSBOlFxI=
github.com/lestrrat-go/backoff/v2 v2.0.8 h1:oNb5E5isby2kiro9AgdHLv5N5tint1AnDVVf2E2un5A=
github.com/lestrrat-go/backoff/v2 v2.0.8/go.mod h1:rHP/q/r9aT27n24JQLa7JhSQZCKBBOiM/uP402WwN8Y=
github.com/lestrrat-go/blackmagic v1.0.2 h1:Cg2gVSc9h7sz9NOByczrbUvLopQmXrfFx//N+AkAr5k=
github.com/lestrrat-go/blackmagic v1.0.2/go.mod h1:UrEqBzIR2U6CnzVyUtfM6oZNMt/7O7Vohk2J0OGSAtU=
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.5 h1:bsTfiH8xaKOJPrg1R+E3iE/AWZr/x0Phj9PBTG/OLUk=
github.com/lestrrat-go/httprc v1.0.5/go.mod h1:mwwz3JMTPBjHUkkDv/IGJ39aALInZLrhBp0X7KGUZlo=
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 v1.2.29 h1:QT0utmUJ4/12rmsVQrJ3u55bycPkKqGYuGT4tyRhxSQ=
github.com/lestrrat-go/jwx v1.2.29/go.mod h1:hU8k2l6WF0ncx20uQdOmik/Gjg6E3/wIRtXSNFeZuB8=
github.com/lestrrat-go/option v1.0.0/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I=
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/option v1.0.1 h1:oAzP2fvZGQKWkvHa1/SAcFolBEca1oN+mQ7eooNBEYU=
github.com/lestrrat-go/option v1.0.1/go.mod h1:5ZHFbivi4xwXxhxY9XHDe2FHo6/Z7WWmtT7T5nBBp3I=
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
Expand Down Expand Up @@ -253,6 +251,8 @@ github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQD
github.com/ryanuber/columnize v2.1.0+incompatible/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
github.com/ryanuber/go-glob v1.0.0 h1:iQh3xXAumdQ+4Ufa5b25cRpC5TYKlno6hsv6Cb3pkBk=
github.com/ryanuber/go-glob v1.0.0/go.mod h1:807d1WSdnB0XRJzKNil9Om6lcp/3a0v4qIHxIXzX/Yc=
github.com/segmentio/asm v1.2.0 h1:9BQrFxC+YOHJlTlHGkTrFWf59nbL3XnCoFLTwDCI7ys=
github.com/segmentio/asm v1.2.0/go.mod h1:BqMnlJP91P8d+4ibuonYZw9mfnzI9HfxselHZr5aAcs=
github.com/shopspring/decimal v1.2.0 h1:abSATXmQEYyShuxI4/vyW3tV1MrKAJzCZ/0zLUXYbsQ=
github.com/shopspring/decimal v1.2.0/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
github.com/sirupsen/logrus v1.9.3 h1:dueUQJ1C2q9oE3F7wvmSGAaVtTmUizReu6fjN8uqzbQ=
Expand Down Expand Up @@ -301,14 +301,11 @@ golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8U
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4=
golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU=
golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs=
golang.org/x/crypto v0.24.0 h1:mnl8DM0o513X8fdIkmyFE/5hTYxbwYOjDS/+rK6qpRI=
golang.org/x/crypto v0.24.0/go.mod h1:Z1PMYSOR5nyMcyAVAIQSKCDwalqy85Aqn1x3Ws4L5DM=
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.8.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
Expand All @@ -317,9 +314,6 @@ golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwY
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
golang.org/x/net v0.2.0/go.mod h1:KqCZLdyyvdV855qA2rE3GC2aiw5xGR5TEjj8smXukLY=
golang.org/x/net v0.6.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg=
golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44=
golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac=
golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM=
golang.org/x/oauth2 v0.21.0 h1:tsimM75w1tF/uws5rbeHzIWxEqElMehnc+iW793zsZs=
Expand All @@ -328,7 +322,6 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
golang.org/x/sync v0.7.0 h1:YsImfSBoP9QPYL0xyKJPq0gcaJdG3rInoqxTWbfQu9M=
golang.org/x/sync v0.7.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk=
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
Expand All @@ -344,25 +337,15 @@ golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.8.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.17.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.18.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.21.0 h1:rF+pYz3DAGSQAxAu1CbC7catZg4ebC4UIeIhKxBZvws=
golang.org/x/sys v0.21.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
golang.org/x/term v0.2.0/go.mod h1:TVmDHMZPmdnySmBfhjOoOdhjzdE1h4u1VwSiw2l1Nuc=
golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
golang.org/x/term v0.8.0/go.mod h1:xPskH00ivmX89bAKVGSKKtLOWNx2+17Eiy94tnKShWo=
golang.org/x/term v0.17.0/go.mod h1:lLRBjIVuehSbZlaOtGMbcMncT+aqLLLmKrsjNrUguwk=
golang.org/x/term v0.18.0/go.mod h1:ILwASektA3OnRv7amZ1xhE/KTR+u50pbXfZ03+6Nx58=
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
golang.org/x/text v0.14.0/go.mod h1:18ZOQIKpY8NJVqYksKHtTdi31H5itFRjB5/qKTNYzSU=
golang.org/x/text v0.16.0 h1:a94ExnEXNtEwYLGJSIUxnWoxoRz/ZcCsV63ROupILh4=
golang.org/x/text v0.16.0/go.mod h1:GhwF1Be+LQoKShO3cGOHzqOgRrGaYc9AvblQOmPVHnI=
golang.org/x/time v0.5.0 h1:o7cqy6amK/52YcAKIPlM3a+Fpj35zvRj2TP+e1xFSfk=
Expand All @@ -372,7 +355,6 @@ golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtn
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU=
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
Expand Down
18 changes: 10 additions & 8 deletions internal/token/generate_rsa.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)
Expand All @@ -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

View workflow job for this annotation

GitHub Actions / golangci

[golangci] internal/token/generate_rsa.go#L33

error is not nil (line 30) but it returns nil (nilerr)
Raw output
internal/token/generate_rsa.go:33:3: error is not nil (line 30) but it returns nil (nilerr)
		return nil
		^
Copy link

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 is not nil (line 30) but it returns nil (nilerr)

}

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

View workflow job for this annotation

GitHub Actions / golangci

[golangci] internal/token/generate_rsa.go#L42

Error return value of `jk.Set` is not checked (errcheck)
Raw output
internal/token/generate_rsa.go:42:8: Error return value of `jk.Set` is not checked (errcheck)
	jk.Set(jwk.KeyIDKey, kid.String())
	      ^
Copy link

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 jk.Set is not checked (errcheck)


// create the JWK in the database
err = db.CreateJWK(context.TODO(), j)
err = db.CreateJWK(context.TODO(), jk)
if err != nil {
return err
}
Expand Down
2 changes: 1 addition & 1 deletion mock/server/authentication.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"net/http"

"github.com/gin-gonic/gin"
"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/types"
Expand Down Expand Up @@ -78,7 +78,7 @@

state := c.Request.FormValue("state")
code := c.Request.FormValue("code")
err := "error"

Check failure on line 81 in mock/server/authentication.go

View workflow job for this annotation

GitHub Actions / golangci

[golangci] mock/server/authentication.go#L81

string `error` has 4 occurrences, make it a constant (goconst)
Raw output
mock/server/authentication.go:81:9: string `error` has 4 occurrences, make it a constant (goconst)
	err := "error"
	       ^

if len(state) == 0 && len(code) == 0 {
c.AbortWithStatusJSON(http.StatusUnauthorized, types.Error{Message: &err})
Expand Down
Loading