Chore: additional check when decrypting values (#34637)

* Chore: additional check when decrypting values

* Apply suggestions from code review
This commit is contained in:
Sofia Papagiannaki
2021-05-25 18:35:54 +03:00
committed by GitHub
parent ab26c4dfa4
commit a5082ab112
2 changed files with 11 additions and 0 deletions

View File

@@ -27,4 +27,11 @@ func TestEncryption(t *testing.T) {
assert.Equal(t, []byte("grafana"), decrypted)
})
t.Run("decrypting empty payload should not fail", func(t *testing.T) {
_, err := Decrypt([]byte(""), "1234")
require.Error(t, err)
assert.Equal(t, "unable to compute salt", err.Error())
})
}