Encryption: Refactor secrets service (#41771)
* Refactor kmsproviders pkg * Update tests * Fix linting Co-authored-by: Joan López de la Franca Beltran <joanjan14@gmail.com>
This commit is contained in:
@@ -6,6 +6,10 @@ import (
|
||||
"xorm.io/xorm"
|
||||
)
|
||||
|
||||
const (
|
||||
EnvelopeEncryptionFeatureToggle = "envelopeEncryption"
|
||||
)
|
||||
|
||||
// Service is an envelope encryption service in charge of encrypting/decrypting secrets.
|
||||
// It is a replacement for encryption.Service
|
||||
type Service interface {
|
||||
@@ -24,12 +28,6 @@ type Service interface {
|
||||
GetDecryptedValue(ctx context.Context, sjd map[string][]byte, key, fallback string) string
|
||||
}
|
||||
|
||||
type ProvidersRegistrar interface {
|
||||
CurrentProviderID() string
|
||||
GetProviders() map[string]Provider
|
||||
RegisterProvider(providerID string, provider Provider)
|
||||
}
|
||||
|
||||
// Store defines methods to interact with secrets storage
|
||||
type Store interface {
|
||||
GetDataKey(ctx context.Context, name string) (*DataKey, error)
|
||||
|
||||
Reference in New Issue
Block a user