Encryption: Override Encrypt/Decrypt in util
Breaks every test that uses Encrypt or Decrypt
This commit is contained in:
+2
-2
@@ -279,12 +279,12 @@ func tryGetEncryptedCookie(ctx *models.ReqContext, cookieName string) (string, b
|
||||
return "", false
|
||||
}
|
||||
|
||||
decryptedError, err := util.Decrypt(decoded, setting.SecretKey)
|
||||
decryptedError, err := util.Decrypt(decoded)
|
||||
return string(decryptedError), err == nil
|
||||
}
|
||||
|
||||
func (hs *HTTPServer) trySetEncryptedCookie(ctx *models.ReqContext, cookieName string, value string, maxAge int) error {
|
||||
encryptedError, err := util.Encrypt([]byte(value), setting.SecretKey)
|
||||
encryptedError, err := util.Encrypt([]byte(value))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -109,7 +109,7 @@ func TestLoginErrorCookieApiEndpoint(t *testing.T) {
|
||||
setting.OAuthAutoLogin = true
|
||||
|
||||
oauthError := errors.New("User not a member of one of the required organizations")
|
||||
encryptedError, _ := util.Encrypt([]byte(oauthError.Error()), setting.SecretKey)
|
||||
encryptedError, _ := util.Encrypt([]byte(oauthError.Error()))
|
||||
expCookiePath := "/"
|
||||
if len(setting.AppSubUrl) > 0 {
|
||||
expCookiePath = setting.AppSubUrl
|
||||
|
||||
Reference in New Issue
Block a user