Skip to content

Commit 2720749

Browse files
committed
fix
1 parent 3bbc482 commit 2720749

File tree

3 files changed

+6
-4
lines changed

3 files changed

+6
-4
lines changed

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@ linters:
1919
- revive
2020
- staticcheck
2121
- stylecheck
22-
- tenv
2322
- testifylint
2423
- typecheck
2524
- unconvert
2625
- unused
2726
- unparam
27+
- usetesting
2828
- wastedassign
2929

3030
run:

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ XGO_VERSION := go-1.24.x
2828
AIR_PACKAGE ?= github.com/air-verse/air@v1
2929
EDITORCONFIG_CHECKER_PACKAGE ?= github.com/editorconfig-checker/editorconfig-checker/v3/cmd/[email protected]
3030
GOFUMPT_PACKAGE ?= mvdan.cc/[email protected]
31-
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.63.4
31+
GOLANGCI_LINT_PACKAGE ?= github.com/golangci/golangci-lint/cmd/golangci-lint@v1.64.5
3232
GXZ_PACKAGE ?= github.com/ulikunitz/xz/cmd/[email protected]
3333
MISSPELL_PACKAGE ?= github.com/golangci/misspell/cmd/[email protected]
3434
SWAGGER_PACKAGE ?= github.com/go-swagger/go-swagger/cmd/[email protected]

modules/secret/secret.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ import (
1616
)
1717

1818
// AesEncrypt encrypts text and given key with AES.
19+
// It is only internally used at the moment to use "SECRET_KEY" for some database values.
1920
func AesEncrypt(key, text []byte) ([]byte, error) {
2021
block, err := aes.NewCipher(key)
2122
if err != nil {
@@ -27,12 +28,13 @@ func AesEncrypt(key, text []byte) ([]byte, error) {
2728
if _, err = io.ReadFull(rand.Reader, iv); err != nil {
2829
return nil, fmt.Errorf("AesEncrypt unable to read IV: %w", err)
2930
}
30-
cfb := cipher.NewCFBEncrypter(block, iv)
31+
cfb := cipher.NewCFBEncrypter(block, iv) // nolint:staticcheck need to migrate and refactor to a new approach
3132
cfb.XORKeyStream(ciphertext[aes.BlockSize:], []byte(b))
3233
return ciphertext, nil
3334
}
3435

3536
// AesDecrypt decrypts text and given key with AES.
37+
// It is only internally used at the moment to use "SECRET_KEY" for some database values.
3638
func AesDecrypt(key, text []byte) ([]byte, error) {
3739
block, err := aes.NewCipher(key)
3840
if err != nil {
@@ -43,7 +45,7 @@ func AesDecrypt(key, text []byte) ([]byte, error) {
4345
}
4446
iv := text[:aes.BlockSize]
4547
text = text[aes.BlockSize:]
46-
cfb := cipher.NewCFBDecrypter(block, iv)
48+
cfb := cipher.NewCFBDecrypter(block, iv) // nolint:staticcheck need to migrate and refactor to a new approach
4749
cfb.XORKeyStream(text, text)
4850
data, err := base64.StdEncoding.DecodeString(string(text))
4951
if err != nil {

0 commit comments

Comments
 (0)