Skip to content

Commit 711200d

Browse files
Bump golangci/golangci-lint-action from 6.5.2 to 7.0.0 (#1983)
* Bump golangci/golangci-lint-action from 6.5.2 to 7.0.0 Bumps [golangci/golangci-lint-action](https://github.com/golangci/golangci-lint-action) from 6.5.2 to 7.0.0. - [Release notes](https://github.com/golangci/golangci-lint-action/releases) - [Commits](golangci/golangci-lint-action@55c2c14...1481404) --- updated-dependencies: - dependency-name: golangci/golangci-lint-action dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] <[email protected]> * lint fixes and bump version in CI Signed-off-by: Bob Callaway <[email protected]> --------- Signed-off-by: dependabot[bot] <[email protected]> Signed-off-by: Bob Callaway <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Bob Callaway <[email protected]>
1 parent 0c254bd commit 711200d

File tree

6 files changed

+59
-38
lines changed

6 files changed

+59
-38
lines changed

.github/workflows/verify.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -70,9 +70,9 @@ jobs:
7070
check-latest: true
7171

7272
- name: golangci-lint
73-
uses: golangci/golangci-lint-action@55c2c1448f86e01eaae002a5a3a9624417608d84 # v6.5.2
73+
uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7.0.0
7474
with:
75-
version: v1.64
75+
version: v2.0
7676

7777
oidc-config:
7878
name: oidc-config

.golangci.yml

+45-26
Original file line numberDiff line numberDiff line change
@@ -13,39 +13,58 @@
1313
# See the License for the specific language governing permissions and
1414
# limitations under the License.
1515

16+
version: "2"
17+
run:
18+
issues-exit-code: 1
1619
linters:
1720
enable:
18-
- unused
1921
- errcheck
20-
- gofmt
21-
- goimports
22-
- gosec
2322
- gocritic
23+
- gosec
2424
- misspell
2525
- revive
26-
linters-settings:
27-
gosec:
28-
excludes:
29-
- G115 # integer overflow conversion int -> uint32
30-
- G602 # slice index out of range
26+
- unused
27+
settings:
28+
gosec:
29+
excludes:
30+
- G115 # integer overflow conversion int -> uint32
31+
- G602 # slice index out of range
32+
exclusions:
33+
generated: lax
34+
presets:
35+
- comments
36+
- common-false-positives
37+
- legacy
38+
- std-error-handling
39+
rules:
40+
- linters:
41+
- errcheck
42+
- gosec
43+
path: _test\.go
44+
- linters:
45+
- staticcheck
46+
# the following section is due to the legacy API being deprecated
47+
path: pkg/server/legacy_server.go
48+
text: SA1019
49+
- linters:
50+
- staticcheck
51+
path: pkg/ca/tinkca/signer.go
52+
text: SA1019
53+
paths:
54+
- third_party$
55+
- builtin$
56+
- examples$
3157
issues:
32-
exclude-rules:
33-
- path: _test\.go
34-
linters:
35-
- errcheck
36-
- gosec
37-
# the following section is due to the legacy API being deprecated
38-
- path: pkg/server/legacy_server.go
39-
linters:
40-
- staticcheck
41-
text: SA1019
42-
- path: pkg/ca/tinkca/signer.go
43-
linters:
44-
- staticcheck
45-
text: SA1019
4658
max-issues-per-linter: 0
4759
max-same-issues: 0
4860
uniq-by-line: false
49-
run:
50-
issues-exit-code: 1
51-
timeout: 10m
61+
formatters:
62+
enable:
63+
- gofmt
64+
- goimports
65+
exclusions:
66+
generated: lax
67+
paths:
68+
- third_party$
69+
- builtin$
70+
- examples$

cmd/app/grpc.go

+3-3
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ func (g *grpcServer) startTCPListener(wg *sync.WaitGroup) {
222222
<-sigint
223223

224224
// received an interrupt signal, shut down
225-
g.Server.GracefulStop()
225+
g.GracefulStop()
226226
close(idleConnsClosed)
227227
log.Logger.Info("stopped grpc server")
228228
}()
@@ -232,7 +232,7 @@ func (g *grpcServer) startTCPListener(wg *sync.WaitGroup) {
232232
if g.tlsCertWatcher != nil {
233233
defer g.tlsCertWatcher.Close()
234234
}
235-
if err := g.Server.Serve(lis); err != nil {
235+
if err := g.Serve(lis); err != nil {
236236
log.Logger.Fatalf("error shutting down grpcServer: %w", err)
237237
}
238238
<-idleConnsClosed
@@ -263,7 +263,7 @@ func (g *grpcServer) startUnixListener() {
263263

264264
log.Logger.Infof("listening on grpc at %s", unixAddr.String())
265265

266-
log.Logger.Fatal(g.Server.Serve(lis))
266+
log.Logger.Fatal(g.Serve(lis))
267267
}()
268268
}
269269

examples/request-certificate/main.go

+6-4
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ import (
3737
)
3838

3939
var (
40-
fulcioUrl = "https://fulcio.sigstore.dev"
40+
fulcioURL = "https://fulcio.sigstore.dev"
4141
oidcIssuer = "https://oauth2.sigstore.dev/auth"
4242
oidcClientID = "sigstore"
4343
)
@@ -87,11 +87,13 @@ func NewClient(fulcioURL string) (fulciopb.CAClient, error) {
8787
dialOpt := grpc.WithTransportCredentials(insecure.NewCredentials())
8888
hostWithPort := fmt.Sprintf("%s:80", fulcioServer.Host)
8989
if fulcioServer.Scheme == "https" {
90-
dialOpt = grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{}))
90+
dialOpt = grpc.WithTransportCredentials(credentials.NewTLS(&tls.Config{
91+
MinVersion: tls.VersionTLS12,
92+
}))
9193
hostWithPort = fmt.Sprintf("%s:443", fulcioServer.Host)
9294
}
9395

94-
conn, err := grpc.Dial(hostWithPort, dialOpt)
96+
conn, err := grpc.NewClient(hostWithPort, dialOpt)
9597
if err != nil {
9698
return nil, err
9799
}
@@ -104,7 +106,7 @@ func main() {
104106
log.Fatal(err)
105107
}
106108

107-
fClient, err := NewClient(fulcioUrl)
109+
fClient, err := NewClient(fulcioURL)
108110
if err != nil {
109111
log.Fatal(err)
110112
}

pkg/ca/tinkca/signer.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,9 +68,9 @@ func KeyHandleToSigner(kh *keyset.Handle) (crypto.Signer, error) {
6868
if c == nil {
6969
return nil, errors.New("tink ecdsa signer: invalid curve")
7070
}
71-
p.PublicKey.Curve = c
71+
p.Curve = c
7272
p.D = new(big.Int).SetBytes(privKey.GetKeyValue())
73-
p.PublicKey.X, p.PublicKey.Y = c.ScalarBaseMult(privKey.GetKeyValue())
73+
p.X, p.Y = c.ScalarBaseMult(privKey.GetKeyValue())
7474
return p, nil
7575
case ed25519SignerTypeURL:
7676
// https://github.com/tink-crypto/tink-go/blob/0aadc94a816408c4bdf95885b3c9860ecfd55fc0/signature/ed25519/signer_key_manager.go#L47

pkg/server/grpc_server.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ func (g *grpcaCAServer) CreateSigningCertificate(ctx context.Context, request *f
8787
}
8888

8989
// Authenticate OIDC ID token by checking signature
90-
principal, err := g.IssuerPool.Authenticate(ctx, token)
90+
principal, err := g.Authenticate(ctx, token)
9191
if err != nil {
9292
return nil, handleFulcioGRPCError(ctx, codes.InvalidArgument, err, invalidIdentityToken)
9393
}

0 commit comments

Comments
 (0)