mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Snapshots: Store dashboard data encrypted in the database (#28129)
* end 2 end * fix import * refactor * introduce securedata * check err * use testify instead of convey * cleanup test * cleanup test * blob time * rename funcs
This commit is contained in:
16
pkg/components/securedata/securedata.go
Normal file
16
pkg/components/securedata/securedata.go
Normal file
@@ -0,0 +1,16 @@
|
||||
package securedata
|
||||
|
||||
import (
|
||||
"github.com/grafana/grafana/pkg/setting"
|
||||
"github.com/grafana/grafana/pkg/util"
|
||||
)
|
||||
|
||||
type SecureData []byte
|
||||
|
||||
func Encrypt(data []byte) (SecureData, error) {
|
||||
return util.Encrypt(data, setting.SecretKey)
|
||||
}
|
||||
|
||||
func (s SecureData) Decrypt() ([]byte, error) {
|
||||
return util.Decrypt(s, setting.SecretKey)
|
||||
}
|
||||
Reference in New Issue
Block a user