mirror of
https://github.com/grafana/grafana.git
synced 2024-12-02 05:29:42 -06:00
44837fc592
* Replace encryption.Service by secrets.Service on expr.Service * Replace encryption.Service by secrets.Service on live pkg * Rename encryption.Service to encryption.Internal to clarify it must be not used
19 lines
833 B
Go
19 lines
833 B
Go
package encryption
|
|
|
|
import "context"
|
|
|
|
// Internal must not be used for general purpose encryption.
|
|
// This service is used as an internal component for envelope encryption
|
|
// and for very specific few use cases that still require legacy encryption.
|
|
//
|
|
// Unless there is any specific reason, you must use secrets.Service instead.
|
|
type Internal interface {
|
|
Encrypt(ctx context.Context, payload []byte, secret string) ([]byte, error)
|
|
Decrypt(ctx context.Context, payload []byte, secret string) ([]byte, error)
|
|
|
|
EncryptJsonData(ctx context.Context, kv map[string]string, secret string) (map[string][]byte, error)
|
|
DecryptJsonData(ctx context.Context, sjd map[string][]byte, secret string) (map[string]string, error)
|
|
|
|
GetDecryptedValue(ctx context.Context, sjd map[string][]byte, key string, fallback string, secret string) string
|
|
}
|