Skip to content

Commit aeaa143

Browse files
committed
feat: add gosec linter
chore: update gosec excludes with comments fix: gosec lint issue Signed-off-by: bupd <bupdprasanth@gmail.com>
1 parent cd46a58 commit aeaa143

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

src/.golangci.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ linters:
55
- bodyclose
66
- errcheck
77
- goheader
8+
- gosec
89
- govet
910
- ineffassign
1011
- misspell
@@ -14,6 +15,16 @@ linters:
1415
settings:
1516
goheader:
1617
template-path: copyright.tmpl
18+
gosec:
19+
excludes:
20+
- G101
21+
- G110
22+
- G112
23+
- G114
24+
- G115
25+
- G306
26+
- G402
27+
- G404
1728
misspell:
1829
locale: US,UK
1930
staticcheck:
@@ -26,6 +37,11 @@ linters:
2637
- common-false-positives
2738
- legacy
2839
- std-error-handling
40+
rules:
41+
- linters:
42+
- revive
43+
text: "var-naming: avoid meaningless package names"
44+
path: "(common/|controller/event/handler/util/|core/utils/|jobservice/common/utils/|pkg/permission/types/|pkg/quota/types/|server/middleware/util/|server/registry/util/|pkg/reg/util/)"
2945
paths:
3046
- third_party$
3147
- builtin$

src/common/utils/encrypt.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import (
1818
"crypto/aes"
1919
"crypto/cipher"
2020
"crypto/rand"
21-
"crypto/sha1"
21+
"crypto/sha1" //nolint:gosec // Required for PBKDF2 legacy compatibility
2222
"crypto/sha256"
2323
"encoding/base64"
2424
"errors"

0 commit comments

Comments
 (0)