mirror of
https://github.com/opentffoundation/opentf.git
synced 2026-03-09 16:00:38 -04:00
39 lines
738 B
Go
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
|
|
}
|