mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-25 01:00:16 -05:00
Update to encryption key provider interface (#1351)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
This commit is contained in:
@@ -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,
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user