mirror of
https://github.com/opentffoundation/opentf.git
synced 2025-12-25 01:00:16 -05:00
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:
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user