Improve encryption internals and fix a few bugs therein (#2551)

Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
Signed-off-by: yottta <andrei.ciobanu@opentofu.org>
Co-authored-by: yottta <andrei.ciobanu@opentofu.org>
Co-authored-by: Martin Atkins <mart@degeneration.co.uk>
This commit is contained in:
Christian Mesh
2025-03-06 12:51:09 -05:00
committed by GitHub
parent 832310fb74
commit ce7279c39f
9 changed files with 482 additions and 334 deletions

View File

@@ -6,6 +6,7 @@
package unencrypted
import (
"github.com/opentofu/opentofu/internal/encryption/config"
"github.com/opentofu/opentofu/internal/encryption/method"
)
@@ -19,12 +20,12 @@ func (f *descriptor) ID() method.ID {
return "unencrypted"
}
func (f *descriptor) ConfigStruct() method.Config {
return new(config)
return new(methodConfig)
}
type config struct{}
type methodConfig struct{}
func (c *config) Build() (method.Method, error) {
func (c *methodConfig) Build() (method.Method, error) {
return new(unenc), nil
}
@@ -41,3 +42,7 @@ func Is(m method.Method) bool {
_, ok := m.(*unenc)
return ok
}
func IsConfig(m config.MethodConfig) bool {
return m.Type == "unencrypted"
}