Skip to content

Commit a4394d3

Browse files
authored
Merge branch 'main' into target-from-address
2 parents 0653949 + 078393f commit a4394d3

File tree

16 files changed

+56
-66
lines changed

16 files changed

+56
-66
lines changed

.github/workflows/pr_build.yaml

+4-6
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ name: PR Build
22
on:
33
pull_request: {}
44
workflow_dispatch: {}
5-
env:
6-
GO_VERSION: 1.21
75
jobs:
86
lint-linux:
97
runs-on: ubuntu-latest
@@ -15,7 +13,7 @@ jobs:
1513
with:
1614
cache: true
1715
cache-dependency-path: v2/go.sum
18-
go-version: ${{ env.GO_VERSION }}
16+
go-version-file: v2/go.mod
1917
- name: Lint
2018
run: make lint
2119

@@ -29,7 +27,7 @@ jobs:
2927
with:
3028
cache: true
3129
cache-dependency-path: v2/go.sum
32-
go-version: ${{ env.GO_VERSION }}
30+
go-version-file: v2/go.mod
3331
- name: Test
3432
run: make test
3533

@@ -46,7 +44,7 @@ jobs:
4644
with:
4745
cache: true
4846
cache-dependency-path: v2/go.sum
49-
go-version: ${{ env.GO_VERSION }}
47+
go-version-file: v2/go.mod
5048
- name: Install msys2
5149
uses: msys2/setup-msys2@v2
5250
with:
@@ -73,7 +71,7 @@ jobs:
7371
with:
7472
cache: true
7573
cache-dependency-path: v2/go.sum
76-
go-version: ${{ env.GO_VERSION }}
74+
go-version-file: v2/go.mod
7775
- name: Install msys2
7876
uses: msys2/setup-msys2@v2
7977
with:

Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ protoc_gen_go_grpc_base_dir := $(build_dir)/protoc-gen-go-grpc
7272
protoc_gen_go_grpc_dir := $(protoc_gen_go_grpc_base_dir)/$(protoc_gen_go_grpc_version)-go$(go_version)
7373
protoc_gen_go_grpc_bin := $(protoc_gen_go_grpc_dir)/protoc-gen-go-grpc
7474

75-
golangci_lint_version = v1.57.2
75+
golangci_lint_version = v1.63.4
7676
golangci_lint_dir = $(build_dir)/golangci_lint/$(golangci_lint_version)
7777
golangci_lint_bin = $(golangci_lint_dir)/golangci-lint
7878

v2/.golangci.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ linters:
1010
- gosec
1111
- misspell
1212
- nakedret
13-
- exportloopref
13+
- copyloopvar
1414
- unconvert
1515
- unparam
1616
- whitespace

v2/bundle/jwtbundle/bundle.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package jwtbundle
33
import (
44
"crypto"
55
"encoding/json"
6+
"errors"
67
"io"
78
"os"
89
"sync"
@@ -69,7 +70,7 @@ func Parse(trustDomain spiffeid.TrustDomain, bundleBytes []byte) (*Bundle, error
6970
bundle := New(trustDomain)
7071
for i, key := range jwks.Keys {
7172
if err := bundle.AddJWTAuthority(key.KeyID, key.Key); err != nil {
72-
return nil, jwtbundleErr.New("error adding authority %d of JWKS: %v", i, errs.Unwrap(err))
73+
return nil, jwtbundleErr.New("error adding authority %d of JWKS: %v", i, errors.Unwrap(err))
7374
}
7475
}
7576

v2/bundle/jwtbundle/bundle_test.go

-4
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ func TestLoad(t *testing.T) {
7777
}
7878

7979
for _, testCase := range testCases {
80-
testCase := testCase
8180
t.Run(testCase.tf.filePath, func(t *testing.T) {
8281
bundle, err := jwtbundle.Load(td, testCase.tf.filePath)
8382
if testCase.err != "" {
@@ -113,7 +112,6 @@ func TestRead(t *testing.T) {
113112
}
114113

115114
for _, testCase := range testCases {
116-
testCase := testCase
117115
t.Run(testCase.tf.filePath, func(t *testing.T) {
118116
// we expect the Open call to fail in some cases
119117
file, _ := os.Open(testCase.tf.filePath)
@@ -153,7 +151,6 @@ func TestParse(t *testing.T) {
153151
}
154152

155153
for _, testCase := range testCases {
156-
testCase := testCase
157154
t.Run(testCase.tf.filePath, func(t *testing.T) {
158155
// we expect the ReadFile call to fail in some cases
159156
bundleBytes, _ := os.ReadFile(testCase.tf.filePath)
@@ -306,7 +303,6 @@ func TestEqual(t *testing.T) {
306303
expectEqual: false,
307304
},
308305
} {
309-
tt := tt
310306
t.Run(tt.name, func(t *testing.T) {
311307
require.Equal(t, tt.expectEqual, tt.a.Equal(tt.b))
312308
})

v2/bundle/spiffebundle/bundle.go

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import (
44
"crypto"
55
"crypto/x509"
66
"encoding/json"
7+
"errors"
78
"io"
89
"os"
910
"sync"
@@ -106,7 +107,7 @@ func Parse(trustDomain spiffeid.TrustDomain, bundleBytes []byte) (*Bundle, error
106107
bundle.AddX509Authority(key.Certificates[0])
107108
case jwtSVIDUse:
108109
if err := bundle.AddJWTAuthority(key.KeyID, key.Key); err != nil {
109-
return nil, spiffebundleErr.New("error adding authority %d of JWKS: %v", i, errs.Unwrap(err))
110+
return nil, spiffebundleErr.New("error adding authority %d of JWKS: %v", i, errors.Unwrap(err))
110111
}
111112
}
112113
}

v2/bundle/spiffebundle/bundle_test.go

-4
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,6 @@ func TestLoad(t *testing.T) {
7373
testCases[0].err = "spiffebundle: unable to read SPIFFE bundle: open testdata/does-not-exist.json: " + errstrings.FileNotFound
7474

7575
for _, testCase := range testCases {
76-
testCase := testCase
7776
t.Run(testCase.filePath, func(t *testing.T) {
7877
bundle, err := spiffebundle.Load(td, testCase.filePath)
7978
checkBundleProperties(t, err, testCase, bundle)
@@ -85,7 +84,6 @@ func TestRead(t *testing.T) {
8584
testCases[0].err = "spiffebundle: unable to read: invalid argument"
8685

8786
for _, testCase := range testCases {
88-
testCase := testCase
8987
t.Run(testCase.filePath, func(t *testing.T) {
9088
// we expect the Open call to fail in some cases
9189
file, _ := os.Open(testCase.filePath)
@@ -101,7 +99,6 @@ func TestParse(t *testing.T) {
10199
testCases[0].err = "spiffebundle: unable to parse JWKS: unexpected end of JSON input"
102100

103101
for _, testCase := range testCases {
104-
testCase := testCase
105102
t.Run(testCase.filePath, func(t *testing.T) {
106103
// we expect the ReadFile call to fail in some cases
107104
bundleBytes, _ := os.ReadFile(testCase.filePath)
@@ -447,7 +444,6 @@ func TestEqual(t *testing.T) {
447444
expectEqual: false,
448445
},
449446
} {
450-
tt := tt
451447
t.Run(tt.name, func(t *testing.T) {
452448
require.Equal(t, tt.expectEqual, tt.a.Equal(tt.b))
453449
})

v2/bundle/x509bundle/bundle_test.go

-3
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ func TestParse(t *testing.T) {
113113
}
114114

115115
for _, test := range tests {
116-
test := test
117116
t.Run(test.name, func(t *testing.T) {
118117
fileBytes, err := os.ReadFile(test.path)
119118
require.NoError(t, err)
@@ -157,7 +156,6 @@ func TestParseRaw(t *testing.T) {
157156
}
158157

159158
for _, test := range tests {
160-
test := test
161159
t.Run(test.name, func(t *testing.T) {
162160
certsBytes := loadRawCertificates(t, test.path)
163161
bundle, err := x509bundle.ParseRaw(td, certsBytes)
@@ -297,7 +295,6 @@ func TestEqual(t *testing.T) {
297295
expectEqual: false,
298296
},
299297
} {
300-
tt := tt
301298
t.Run(tt.name, func(t *testing.T) {
302299
require.Equal(t, tt.expectEqual, tt.a.Equal(tt.b))
303300
})

v2/federation/handler_test.go

-1
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,6 @@ func TestHandler(t *testing.T) {
118118
}
119119

120120
for _, testCase := range testCases {
121-
testCase := testCase
122121
t.Run(testCase.name, func(t *testing.T) {
123122
writer.Reset()
124123

v2/go.mod

+10-10
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,26 @@
11
module github.com/spiffe/go-spiffe/v2
22

3-
go 1.21
3+
go 1.22.11
44

55
require (
66
github.com/Microsoft/go-winio v0.6.2
77
github.com/go-jose/go-jose/v4 v4.0.4
8-
github.com/stretchr/testify v1.9.0
9-
github.com/zeebo/errs v1.3.0
10-
google.golang.org/grpc v1.67.1
8+
github.com/stretchr/testify v1.10.0
9+
github.com/zeebo/errs v1.4.0
10+
google.golang.org/grpc v1.70.0
1111
google.golang.org/grpc/examples v0.0.0-20230224211313-3775f633ce20
12-
google.golang.org/protobuf v1.34.2
12+
google.golang.org/protobuf v1.36.1
1313
)
1414

1515
require (
1616
github.com/davecgh/go-spew v1.1.1 // indirect
1717
github.com/kr/pretty v0.1.0 // indirect
1818
github.com/pmezard/go-difflib v1.0.0 // indirect
19-
golang.org/x/crypto v0.26.0 // indirect
20-
golang.org/x/net v0.28.0 // indirect
21-
golang.org/x/sys v0.24.0 // indirect
22-
golang.org/x/text v0.17.0 // indirect
23-
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 // indirect
19+
golang.org/x/crypto v0.31.0 // indirect
20+
golang.org/x/net v0.33.0 // indirect
21+
golang.org/x/sys v0.28.0 // indirect
22+
golang.org/x/text v0.21.0 // indirect
23+
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a // indirect
2424
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 // indirect
2525
gopkg.in/yaml.v3 v3.0.1 // indirect
2626
)

v2/go.sum

+36-18
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,53 @@ github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c
44
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
55
github.com/go-jose/go-jose/v4 v4.0.4 h1:VsjPI33J0SB9vQM6PLmNjoHqMQNGPiZ0rHL7Ni7Q6/E=
66
github.com/go-jose/go-jose/v4 v4.0.4/go.mod h1:NKb5HO1EZccyMpiZNbdUw/14tiXNyUJh188dfnMCAfc=
7+
github.com/go-logr/logr v1.4.2 h1:6pFjapn8bFcIbiKo3XT4j/BhANplGihG6tvd+8rYgrY=
8+
github.com/go-logr/logr v1.4.2/go.mod h1:9T104GzyrTigFIr8wt5mBrctHMim0Nb2HLGrmQ40KvY=
9+
github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
10+
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
11+
github.com/golang/protobuf v1.5.4 h1:i7eJL8qZTpSEXOPTxNKhASYpMn+8e5Q6AdndVa1dWek=
12+
github.com/golang/protobuf v1.5.4/go.mod h1:lnTiLA8Wa4RWRcIUkrtSVa5nRhsEGBg48fD6rSs7xps=
713
github.com/google/go-cmp v0.6.0 h1:ofyhxvXcZhMsU5ulbFiLKl/XBFqE1GSq7atu8tAmTRI=
814
github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY=
15+
github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0=
16+
github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
917
github.com/kr/pretty v0.1.0 h1:L/CwN0zerZDmRFUapSPitk6f+Q3+0za1rQkzVuMiMFI=
1018
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
1119
github.com/kr/pty v1.1.1/go.mod h1:pFQYn66WHrOpPYNljwOMqo10TkYh1fy3cYio2l3bCsQ=
1220
github.com/kr/text v0.1.0 h1:45sCR5RtlFHMR4UwH9sdQ5TC8v0qDQCHnXt+kaKSTVE=
1321
github.com/kr/text v0.1.0/go.mod h1:4Jbv+DJW3UT/LiOwJeYQe1efqtUx/iVham/4vfdArNI=
1422
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
1523
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
16-
github.com/stretchr/testify v1.9.0 h1:HtqpIVDClZ4nwg75+f6Lvsy/wHu+3BoSGCbBAcpTsTg=
17-
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
18-
github.com/zeebo/errs v1.3.0 h1:hmiaKqgYZzcVgRL1Vkc1Mn2914BbzB0IBxs+ebeutGs=
19-
github.com/zeebo/errs v1.3.0/go.mod h1:sgbWHsvVuTPHcqJJGQ1WhI5KbWlHYz+2+2C/LSEtCw4=
20-
golang.org/x/crypto v0.26.0 h1:RrRspgV4mU+YwB4FYnuBoKsUapNIL5cohGAmSH3azsw=
21-
golang.org/x/crypto v0.26.0/go.mod h1:GY7jblb9wI+FOo5y8/S2oY4zWP07AkOJ4+jxCqdqn54=
22-
golang.org/x/net v0.28.0 h1:a9JDOJc5GMUJ0+UDqmLT86WiEy7iWyIhz8gz8E4e5hE=
23-
golang.org/x/net v0.28.0/go.mod h1:yqtgsTWOOnlGLG9GFRrK3++bGOUEkNBoHZc8MEDWPNg=
24-
golang.org/x/sys v0.24.0 h1:Twjiwq9dn6R1fQcyiK+wQyHWfaz/BJB+YIpzU/Cv3Xg=
25-
golang.org/x/sys v0.24.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
26-
golang.org/x/text v0.17.0 h1:XtiM5bkSOt+ewxlOE/aE/AKEHibwj/6gvWMl9Rsh0Qc=
27-
golang.org/x/text v0.17.0/go.mod h1:BuEKDfySbSR4drPmRPG/7iBdf8hvFMuRexcpahXilzY=
28-
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142 h1:e7S5W7MGGLaSu8j3YjdezkZ+m1/Nm0uRVRMEMGk26Xs=
29-
google.golang.org/genproto/googleapis/rpc v0.0.0-20240814211410-ddb44dafa142/go.mod h1:UqMtugtsSgubUsoxbuAoiCXvqvErP7Gf0so0mK9tHxU=
30-
google.golang.org/grpc v1.67.1 h1:zWnc1Vrcno+lHZCOofnIMvycFcc0QRGIzm9dhnDX68E=
31-
google.golang.org/grpc v1.67.1/go.mod h1:1gLDyUQU7CTLJI90u3nXZ9ekeghjeM7pTDZlqFNg2AA=
24+
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
25+
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
26+
github.com/zeebo/errs v1.4.0 h1:XNdoD/RRMKP7HD0UhJnIzUy74ISdGGxURlYG8HSWSfM=
27+
github.com/zeebo/errs v1.4.0/go.mod h1:sgbWHsvVuTPHcqJJGQ1WhI5KbWlHYz+2+2C/LSEtCw4=
28+
go.opentelemetry.io/otel v1.32.0 h1:WnBN+Xjcteh0zdk01SVqV55d/m62NJLJdIyb4y/WO5U=
29+
go.opentelemetry.io/otel v1.32.0/go.mod h1:00DCVSB0RQcnzlwyTfqtxSm+DRr9hpYrHjNGiBHVQIg=
30+
go.opentelemetry.io/otel/metric v1.32.0 h1:xV2umtmNcThh2/a/aCP+h64Xx5wsj8qqnkYZktzNa0M=
31+
go.opentelemetry.io/otel/metric v1.32.0/go.mod h1:jH7CIbbK6SH2V2wE16W05BHCtIDzauciCRLoc/SyMv8=
32+
go.opentelemetry.io/otel/sdk v1.32.0 h1:RNxepc9vK59A8XsgZQouW8ue8Gkb4jpWtJm9ge5lEG4=
33+
go.opentelemetry.io/otel/sdk v1.32.0/go.mod h1:LqgegDBjKMmb2GC6/PrTnteJG39I8/vJCAP9LlJXEjU=
34+
go.opentelemetry.io/otel/sdk/metric v1.32.0 h1:rZvFnvmvawYb0alrYkjraqJq0Z4ZUJAiyYCU9snn1CU=
35+
go.opentelemetry.io/otel/sdk/metric v1.32.0/go.mod h1:PWeZlq0zt9YkYAp3gjKZ0eicRYvOh1Gd+X99x6GHpCQ=
36+
go.opentelemetry.io/otel/trace v1.32.0 h1:WIC9mYrXf8TmY/EXuULKc8hR17vE+Hjv2cssQDe03fM=
37+
go.opentelemetry.io/otel/trace v1.32.0/go.mod h1:+i4rkvCraA+tG6AzwloGaCtkx53Fa+L+V8e9a7YvhT8=
38+
golang.org/x/crypto v0.31.0 h1:ihbySMvVjLAeSH1IbfcRTkD/iNscyz8rGzjF/E5hV6U=
39+
golang.org/x/crypto v0.31.0/go.mod h1:kDsLvtWBEx7MV9tJOj9bnXsPbxwJQ6csT/x4KIN4Ssk=
40+
golang.org/x/net v0.33.0 h1:74SYHlV8BIgHIFC/LrYkOGIwL19eTYXQ5wc6TBuO36I=
41+
golang.org/x/net v0.33.0/go.mod h1:HXLR5J+9DxmrqMwG9qjGCxZ+zKXxBru04zlTvWlWuN4=
42+
golang.org/x/sys v0.28.0 h1:Fksou7UEQUWlKvIdsqzJmUmCX3cZuD2+P3XyyzwMhlA=
43+
golang.org/x/sys v0.28.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
44+
golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo=
45+
golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ=
46+
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a h1:hgh8P4EuoxpsuKMXX/To36nOFD7vixReXgn8lPGnt+o=
47+
google.golang.org/genproto/googleapis/rpc v0.0.0-20241202173237-19429a94021a/go.mod h1:5uTbfoYQed2U9p3KIj2/Zzm02PYhndfdmML0qC3q3FU=
48+
google.golang.org/grpc v1.70.0 h1:pWFv03aZoHzlRKHWicjsZytKAiYCtNS0dHbXnIdq7jQ=
49+
google.golang.org/grpc v1.70.0/go.mod h1:ofIJqVKDXx/JiXrwr2IG4/zwdH9txy3IlF40RmcJSQw=
3250
google.golang.org/grpc/examples v0.0.0-20230224211313-3775f633ce20 h1:MLBCGN1O7GzIx+cBiwfYPwtmZ41U3Mn/cotLJciaArI=
3351
google.golang.org/grpc/examples v0.0.0-20230224211313-3775f633ce20/go.mod h1:Nr5H8+MlGWr5+xX/STzdoEqJrO+YteqFbMyCsrb6mH0=
34-
google.golang.org/protobuf v1.34.2 h1:6xV6lTsCfpGD21XK49h7MhtcApnLqkfYgPcdHftf6hg=
35-
google.golang.org/protobuf v1.34.2/go.mod h1:qYOHts0dSfpeUzUFpOMr/WGzszTmLH+DiWniOlNbLDw=
52+
google.golang.org/protobuf v1.36.1 h1:yBPeRvTftaleIgM3PZ/WBIZ7XM/eEYAaEyCwvyjq/gk=
53+
google.golang.org/protobuf v1.36.1/go.mod h1:9fA7Ob0pmnwhb644+1+CVWFRbNajQ6iRojtC/QF5bRE=
3654
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
3755
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
3856
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=

v2/spiffetls/spiffetls_test.go

-2
Original file line numberDiff line numberDiff line change
@@ -248,8 +248,6 @@ func TestListenAndDial(t *testing.T) {
248248
tests = append(tests, listenAndDialCasesOS()...)
249249

250250
for _, test := range tests {
251-
test := test
252-
253251
if test.defaultWlAPIAddr != "" {
254252
require.NoError(t, os.Setenv("SPIFFE_ENDPOINT_SOCKET", test.defaultWlAPIAddr))
255253
} else {

v2/spiffetls/tlsconfig/config_test.go

-7
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,6 @@ func TestGetCertificate(t *testing.T) {
307307
}
308308

309309
for _, testCase := range testCases {
310-
testCase := testCase
311310
t.Run(testCase.name, func(t *testing.T) {
312311
getCertificateCalls := 0
313312
tracer := hookedTracer(
@@ -361,7 +360,6 @@ func TestGetClientCertificate(t *testing.T) {
361360
}
362361

363362
for _, testCase := range testCases {
364-
testCase := testCase
365363
t.Run(testCase.name, func(t *testing.T) {
366364
getCertificateCalls := 0
367365
tracer := hookedTracer(
@@ -427,7 +425,6 @@ func TestVerifyPeerCertificate(t *testing.T) {
427425
}
428426

429427
for _, testCase := range testCases {
430-
testCase := testCase
431428
t.Run(testCase.name, func(t *testing.T) {
432429
verifyPeerCertificate := tlsconfig.VerifyPeerCertificate(testCase.bundle, testCase.authorizer)
433430
require.NotNil(t, verifyPeerCertificate)
@@ -500,7 +497,6 @@ func TestWrapVerifyPeerCertificate(t *testing.T) {
500497
}
501498

502499
for _, testCase := range testCases {
503-
testCase := testCase
504500
t.Run(testCase.name, func(t *testing.T) {
505501
verifyPeerCertificate := tlsconfig.WrapVerifyPeerCertificate(testCase.wrapped, testCase.bundle, testCase.authorizer)
506502
require.NotNil(t, verifyPeerCertificate)
@@ -567,7 +563,6 @@ func TestTLSHandshake(t *testing.T) {
567563
}
568564

569565
for _, testCase := range testCases {
570-
testCase := testCase
571566
t.Run(testCase.name, func(t *testing.T) {
572567
testConnection(t, testCase.serverConfig, testCase.clientConfig, testCase.serverErr, testCase.clientErr)
573568
})
@@ -647,7 +642,6 @@ func TestMTLSHandshake(t *testing.T) {
647642
}
648643

649644
for _, testCase := range testCases {
650-
testCase := testCase
651645
t.Run(testCase.name, func(t *testing.T) {
652646
testConnection(t, testCase.serverConfig, testCase.clientConfig, testCase.serverErr, testCase.clientErr)
653647
})
@@ -722,7 +716,6 @@ func TestMTLSWebHandshake(t *testing.T) {
722716
}
723717

724718
for _, testCase := range testCases {
725-
testCase := testCase
726719
t.Run(testCase.name, func(t *testing.T) {
727720
testConnection(t, testCase.serverConfig, testCase.clientConfig, testCase.serverErr, testCase.clientErr)
728721
})

v2/svid/jwtsvid/svid_test.go

-2
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,6 @@ func TestParseAndValidate(t *testing.T) {
251251
}
252252

253253
for _, testCase := range testCases {
254-
testCase := testCase
255254
t.Run(testCase.name, func(t *testing.T) {
256255
// Generate token
257256
token := testCase.generateToken(t)
@@ -405,7 +404,6 @@ func TestParseInsecure(t *testing.T) {
405404
}
406405

407406
for _, testCase := range testCases {
408-
testCase := testCase
409407
t.Run(testCase.name, func(t *testing.T) {
410408
// Create token
411409
token := testCase.generateToken(t)

0 commit comments

Comments
 (0)