Encryption: Override Encrypt/Decrypt in util

Breaks every test that uses Encrypt or Decrypt
This commit is contained in:
Emil Tullstedt
2020-10-14 15:53:49 +02:00
parent 1ff6fa9424
commit 84669d2213
11 changed files with 146 additions and 161 deletions
+2 -3
View File
@@ -6,7 +6,6 @@ import (
"github.com/grafana/grafana/pkg/bus"
"github.com/grafana/grafana/pkg/models"
"github.com/grafana/grafana/pkg/setting"
"github.com/grafana/grafana/pkg/util"
)
@@ -265,7 +264,7 @@ func decodeAndDecrypt(s string) (string, error) {
if err != nil {
return "", err
}
decrypted, err := util.Decrypt(decoded, setting.SecretKey)
decrypted, err := util.Decrypt(decoded)
if err != nil {
return "", err
}
@@ -275,7 +274,7 @@ func decodeAndDecrypt(s string) (string, error) {
// encryptAndEncode will encrypt a string with grafana's secretKey, and
// then encode it with the standard bas64 encoder
func encryptAndEncode(s string) (string, error) {
encrypted, err := util.Encrypt([]byte(s), setting.SecretKey)
encrypted, err := util.Encrypt([]byte(s))
if err != nil {
return "", err
}