Skip to content

Commit 9080fb4

Browse files
chore(deps): bump github.com/go-chi/chi/v5 from 5.2.5 to 5.3.0 in the go group (#80)
Co-authored-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com> Signed-off-by: dependabot[bot] <support@github.com> Signed-off-by: Gergely Brautigam <182850+Skarlso@users.noreply.github.com>
1 parent 21baed1 commit 9080fb4

5 files changed

Lines changed: 122 additions & 92 deletions

File tree

.golangci.yaml

Lines changed: 114 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,51 +1,11 @@
1+
version: "2"
2+
13
run:
24
timeout: 10m
3-
4-
linters-settings:
5-
gci:
6-
sections:
7-
- "standard"
8-
- "default"
9-
- "prefix(github.com/external-secrets/bitwarden-sdk-server)"
10-
- "blank"
11-
- "dot"
12-
goconst:
13-
min-len: 3
14-
min-occurrences: 3
15-
gocritic:
16-
enabled-tags:
17-
- diagnostic
18-
- experimental
19-
- opinionated
20-
- performance
21-
- style
22-
disabled-checks:
23-
- dupImport
24-
- ifElseChain
25-
- octalLiteral
26-
- whyNoLint
27-
- wrapperFunc
28-
- importShadow
29-
- unnamedResult
30-
- unnecessaryBlock
31-
settings:
32-
rangeValCopy:
33-
sizeThreshold: 512
34-
hugeParam:
35-
sizeThreshold: 512
36-
gocyclo:
37-
min-complexity: 16
38-
goheader:
39-
template-path: ./hack/boilerplate.go.txt
40-
dupl:
41-
threshold: 200
42-
lll:
43-
line-length: 300
44-
misspell:
45-
locale: US
5+
allow-parallel-runners: true
466

477
linters:
48-
disable-all: true
8+
default: none
499
enable:
5010
- asciicheck
5111
- bodyclose
@@ -54,68 +14,136 @@ linters:
5414
- errcheck
5515
- errorlint
5616
- exhaustive
57-
- exportloopref
58-
- gci
17+
- copyloopvar
5918
- goheader
6019
- goconst
6120
- gocritic
6221
- godot
63-
- gofmt
6422
- goprintffuncname
6523
- gosec
66-
- gosimple
6724
- govet
6825
- ineffassign
69-
- lll
7026
- misspell
27+
- modernize # A suite of analyzers that suggest simplifications to Go code, using modern language and library features. https://golangci-lint.run/docs/linters/configuration/#modernize
7128
- nakedret
7229
- nolintlint
7330
- prealloc
74-
- staticcheck
75-
- stylecheck
76-
- typecheck
31+
- lll
7732
- unconvert
7833
- unparam
7934
- unused
8035
- whitespace
36+
settings:
37+
goconst:
38+
min-len: 3
39+
min-occurrences: 3
40+
gocritic:
41+
enabled-tags:
42+
- diagnostic
43+
- experimental
44+
- opinionated
45+
- performance
46+
- style
47+
disabled-checks:
48+
- dupImport
49+
- ifElseChain
50+
- octalLiteral
51+
- whyNoLint
52+
- wrapperFunc
53+
- importShadow
54+
- unnamedResult
55+
- unnecessaryBlock
56+
settings:
57+
rangeValCopy:
58+
sizeThreshold: 512
59+
hugeParam:
60+
sizeThreshold: 512
61+
gocyclo:
62+
min-complexity: 16
63+
goheader:
64+
template-path: ${config-path}/hack/boilerplate.go.txt
65+
dupl:
66+
threshold: 200
67+
govet:
68+
disable:
69+
- shadow
70+
lll:
71+
line-length: 300
72+
misspell:
73+
locale: US
74+
modernize:
75+
disable:
76+
- omitzero
77+
exclusions:
78+
paths:
79+
- runtime/template/v2/sprig
80+
rules:
81+
# Exclude some linters from running on tests files.
82+
- path: _test(ing)?\.go
83+
linters:
84+
- gocyclo
85+
- errcheck
86+
- dupl
87+
- gosec
88+
- unparam
89+
- lll
90+
- revive
8191

82-
issues:
83-
# Excluding configuration per-path and per-linter
84-
exclude-rules:
85-
# Exclude some linters from running on tests files.
86-
- path: _test(ing)?\.go
87-
linters:
88-
- gocyclo
89-
- errcheck
90-
- dupl
91-
- gosec
92-
- unparam
93-
- lll
92+
# Allow dot imports for Ginkgo and Gomega in test files
93+
- path: _test\.go
94+
text: "dot-imports:"
95+
linters:
96+
- revive
9497

95-
# Ease some gocritic warnings on test files.
96-
- path: _test\.go
97-
text: "(unnamedResult|exitAfterDefer)"
98-
linters:
99-
- gocritic
98+
# Ease some gocritic warnings on test files.
99+
- path: _test\.go
100+
text: "(unnamedResult|exitAfterDefer)"
101+
linters:
102+
- gocritic
100103

101-
# This is a "potential hardcoded credentials" warning. It's triggered by
102-
# any variable with 'secret' in the same, and thus hits a lot of false
103-
# positives in Kubernetes land where a Secret is an object type.
104-
- text: "G101:"
105-
linters:
106-
- gosec
104+
# Exclude fake or mock packages from revive linter
105+
- path: /(fake|mock)/
106+
linters:
107+
- revive
107108

108-
# The header check doesn't correctly parse the header as a code comment and is
109-
# triggered by the perceived diff. The header check still correctly detects missing
110-
# license headers and is useful for some cases.
111-
- text: "Actual:"
112-
linters:
113-
- goheader
109+
# This is a "potential hardcoded credentials" warning. It's triggered by
110+
# any variable with 'secret' in the same, and thus hits a lot of false
111+
# positives in Kubernetes land where a Secret is an object type.
112+
- text: "G101:"
113+
linters:
114+
- gosec
115+
116+
# The header check doesn't correctly parse the header as a code comment and is
117+
# triggered by the perceived diff. The header check still correctly detects missing
118+
# license headers and is useful for some cases.
119+
- text: "Actual:"
120+
linters:
121+
- goheader
122+
issues:
123+
# Maximum issues count per one linter. Set to 0 to disable. Default is 50.
124+
max-issues-per-linter: 0
114125

115-
# excluding deprecation check introduced on purpose in #2884
116-
- path: pkg/provider/fake/fake.go
117-
text: 'SA1019: data.ValueMap is deprecated: ValueMap is deprecated and is intended to be removed in the future, use the `value` field instead.'
118-
- path: pkg/provider/fake/fake_test.go
119-
text: 'SA1019: data.ValueMap is deprecated: ValueMap is deprecated and is intended to be removed in the future, use the `value` field instead.'
120126
# Maximum count of issues with the same text. Set to 0 to disable. Default is 3.
121127
max-same-issues: 0
128+
129+
formatters:
130+
enable:
131+
- gci
132+
- gofmt
133+
- goimports
134+
- golines
135+
settings:
136+
goimports:
137+
local-prefixes:
138+
- github.com/external-secrets/bitwarden-sdk-server
139+
golines:
140+
# Target maximum line length.
141+
# Default: 100
142+
max-len: 200
143+
gci:
144+
sections:
145+
- "standard"
146+
- "default"
147+
- "prefix(github.com/external-secrets/bitwarden-sdk-server)"
148+
- "blank"
149+
- "dot"

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ endif
3333

3434
# List the GOOS and GOARCH to build
3535
GO_LDFLAGS_STATIC="-s -w $(CTIMEVAR) -extldflags -static"
36-
GOLANGCI_LINT_VERSION ?= v1.57.2
36+
GOLANGCI_LINT_VERSION ?= v2.11.3
3737
MKCERT_VERSION ?= v1.4.4
3838

3939
.DEFAULT_GOAL := help

go.mod

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
module github.com/external-secrets/bitwarden-sdk-server
22

3-
go 1.22
3+
go 1.23
44

55
replace github.com/bitwarden/sdk-go/v2 => github.com/Skarlso/sdk-go/v2 v2.0.0
66

77
require (
88
github.com/bitwarden/sdk-go/v2 v2.0.0
9-
github.com/go-chi/chi/v5 v5.2.5
9+
github.com/go-chi/chi/v5 v5.3.0
1010
github.com/spf13/cobra v1.10.2
1111
github.com/stretchr/testify v1.11.1
1212
)

go.sum

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ github.com/Skarlso/sdk-go/v2 v2.0.0/go.mod h1:6Sfb4IdZ9tnggeFj8Ty4MLkWUyC2pNlFUo
33
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
44
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
55
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
6-
github.com/go-chi/chi/v5 v5.2.5 h1:Eg4myHZBjyvJmAFjFvWgrqDTXFyOzjj7YIm3L3mu6Ug=
7-
github.com/go-chi/chi/v5 v5.2.5/go.mod h1:X7Gx4mteadT3eDOMTsXzmI4/rwUpOwBHLpAfupzFJP0=
6+
github.com/go-chi/chi/v5 v5.3.0 h1:halUjDxhshgXHMrao5bB8eNBXo/rnzwr8m5m36glehM=
7+
github.com/go-chi/chi/v5 v5.3.0/go.mod h1:R+tYY2hNuVUUjxoPtqUdgBqevM9s9njzkTLutVsOCto=
88
github.com/gofrs/uuid v4.4.0+incompatible h1:3qXRTX8/NbyulANqlc0lchS1gqAVxRgsuW1YrTJupqA=
99
github.com/gofrs/uuid v4.4.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
1010
github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8=

pkg/server/server.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,9 @@ func (s *Server) getClient(r *http.Request, response any) (sdk.BitwardenClientIn
211211
if err != nil {
212212
return nil, err
213213
}
214-
defer r.Body.Close()
214+
defer func() {
215+
_ = r.Body.Close()
216+
}()
215217

216218
if err := json.Unmarshal(content, response); err != nil {
217219
return nil, err

0 commit comments

Comments
 (0)