Replace encryption.Service usages by secrets.Service (#41625)

* 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
This commit is contained in:
Joan López de la Franca Beltran
2021-11-12 12:16:39 +01:00
committed by GitHub
parent dcae138379
commit 44837fc592
16 changed files with 66 additions and 53 deletions
+6 -3
View File
@@ -2,9 +2,12 @@ package encryption
import "context"
// Service must not be used for encryption,
// use secrets.Service implementing envelope encryption instead.
type Service interface {
// 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)