Update to encryption key provider interface (#1351)

Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
This commit is contained in:
Christian Mesh
2024-03-08 07:55:08 -05:00
committed by GitHub
parent 8cd4036af0
commit cef62ea738
9 changed files with 50 additions and 50 deletions

View File

@@ -36,14 +36,14 @@ func newBaseEncryption(enc *encryption, target *config.TargetConfig, enforced bo
}
// This performs a e2e validation run of the config -> methods flow. It serves as a validation step and allows us to
// return detailed diagnostics here and simple errors below
_, diags := base.buildTargetMethods(make(map[keyprovider.Addr]any))
_, diags := base.buildTargetMethods(make(map[keyprovider.Addr][]byte))
return base, diags
}
type basedata struct {
Meta map[keyprovider.Addr]any `json:"meta"`
Data []byte `json:"encrypted_data"`
Version string `json:"encryption_version"` // This is both a sigil for a valid encrypted payload and a future compatability field
Meta map[keyprovider.Addr][]byte `json:"meta"`
Data []byte `json:"encrypted_data"`
Version string `json:"encryption_version"` // This is both a sigil for a valid encrypted payload and a future compatability field
}
func IsEncryptionPayload(data []byte) (bool, error) {
@@ -64,7 +64,7 @@ func (s *baseEncryption) encrypt(data []byte) ([]byte, error) {
}
es := basedata{
Meta: make(map[keyprovider.Addr]any),
Meta: make(map[keyprovider.Addr][]byte),
Version: encryptionVersion,
}