mirror of
https://github.com/opentofu/opentofu.git
synced 2026-05-20 00:55:16 -04:00
Some checks are pending
build / Build for freebsd_386 (push) Waiting to run
build / Build for linux_386 (push) Waiting to run
build / Build for openbsd_386 (push) Waiting to run
build / Build for windows_386 (push) Waiting to run
build / Build for freebsd_amd64 (push) Waiting to run
build / Build for linux_amd64 (push) Waiting to run
build / Build for openbsd_amd64 (push) Waiting to run
build / Build for solaris_amd64 (push) Waiting to run
build / Build for windows_amd64 (push) Waiting to run
build / Build for freebsd_arm (push) Waiting to run
build / Build for linux_arm (push) Waiting to run
build / Build for linux_arm64 (push) Waiting to run
build / Build for darwin_amd64 (push) Waiting to run
build / Build for darwin_arm64 (push) Waiting to run
build / End-to-end Tests for linux_386 (push) Waiting to run
build / End-to-end Tests for windows_386 (push) Waiting to run
build / End-to-end Tests for darwin_amd64 (push) Waiting to run
build / End-to-end Tests for linux_amd64 (push) Waiting to run
build / End-to-end Tests for windows_amd64 (push) Waiting to run
Quick Checks / List files changed for pull request (push) Waiting to run
Quick Checks / Unit tests for linux_386 (push) Blocked by required conditions
Quick Checks / Unit tests for linux_amd64 (push) Blocked by required conditions
Quick Checks / Unit tests for windows_amd64 (push) Blocked by required conditions
Quick Checks / Unit tests for linux_arm (push) Blocked by required conditions
Quick Checks / Unit tests for darwin_arm64 (push) Blocked by required conditions
Quick Checks / Unit tests for linux_arm64 (push) Blocked by required conditions
Quick Checks / Race Tests (push) Blocked by required conditions
Quick Checks / End-to-end Tests (push) Blocked by required conditions
Quick Checks / Code Consistency Checks (push) Blocked by required conditions
Quick Checks / License Checks (push) Waiting to run
Website checks / List files changed for pull request (push) Waiting to run
Website checks / Build (push) Blocked by required conditions
Website checks / Test Installation Instructions (push) Blocked by required conditions
Signed-off-by: Christian Mesh <christianmesh1@gmail.com> Signed-off-by: Andrei Ciobanu <andrei.ciobanu@opentofu.org> Co-authored-by: Christian Mesh <christianmesh1@gmail.com>
49 lines
1.1 KiB
Go
49 lines
1.1 KiB
Go
// Copyright (c) The OpenTofu Authors
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
// Copyright (c) 2023 HashiCorp, Inc.
|
|
// SPDX-License-Identifier: MPL-2.0
|
|
|
|
package unencrypted
|
|
|
|
import (
|
|
"github.com/hashicorp/hcl/v2"
|
|
"github.com/opentofu/opentofu/internal/encryption/config"
|
|
"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) DecodeConfig(_ method.EvalContext, _ hcl.Body) (method.Config, hcl.Diagnostics) {
|
|
return new(methodConfig), nil
|
|
}
|
|
|
|
type methodConfig struct{}
|
|
|
|
func (c *methodConfig) 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
|
|
}
|
|
|
|
func IsConfig(m config.MethodConfig) bool {
|
|
return m.Type == "unencrypted"
|
|
}
|