mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Encryption: De-duplicate encryption code with extensible service (#52472)
* Encryption: De-duplicate encryption code with extensible service * Fix Wire injections * Fix tests * Register reload handler
This commit is contained in:
committed by
GitHub
parent
9c6aab3bc9
commit
28e27e1365
20
pkg/services/encryption/provider/cipher_aescfb_test.go
Normal file
20
pkg/services/encryption/provider/cipher_aescfb_test.go
Normal file
@@ -0,0 +1,20 @@
|
||||
package provider
|
||||
|
||||
import (
|
||||
"context"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/assert"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
func Test_aesCfbCipher(t *testing.T) {
|
||||
cipher := aesCfbCipher{}
|
||||
ctx := context.Background()
|
||||
|
||||
encrypted, err := cipher.Encrypt(ctx, []byte("grafana"), "1234")
|
||||
require.NoError(t, err)
|
||||
assert.NotNil(t, encrypted)
|
||||
assert.NotEmpty(t, encrypted)
|
||||
}
|
||||
Reference in New Issue
Block a user