Files
opentf/internal/encryption/method/unencrypted/method.go
Christian Mesh d7e96665f6 Add unencrypted Method for migrations (#1458)
Signed-off-by: Christian Mesh <christianmesh1@gmail.com>
2024-04-12 09:38:21 -04:00

39 lines
738 B
Go

package unencrypted
import (
"github.com/opentofu/opentofu/internal/encryption/method"
)
func New() method.Descriptor {
return &descriptor{}
}
type descriptor struct{}
func (f *descriptor) ID() method.ID {
return "unencrypted"
}
func (f *descriptor) ConfigStruct() method.Config {
return new(config)
}
type config struct{}
func (c *config) Build() (method.Method, error) {
return new(unenc), nil
}
type unenc struct{}
func (a *unenc) Encrypt(data []byte) ([]byte, error) {
panic("Placeholder for type check! Should never be called!")
}
func (a *unenc) Decrypt(data []byte) ([]byte, error) {
panic("Placeholder for type check! Should never be called!")
}
func Is(m method.Method) bool {
_, ok := m.(*unenc)
return ok
}