Files
opentf/internal/encryption/default_registry.go
Larry Bordowitz bcbfebce3d Implement the Azure Key Provider
This uses the same auth package as the newly-rewritten Azure State
Backend, so many of the properties and environment variables are the
same. I have put this through both the compliance test as well as built
the binary and run some end-to-end tests, and found that it
appropriately uses the Azure key as expected.

Signed-off-by: Larry Bordowitz <laurence.bordowitz@gmail.com>
2025-09-29 06:19:02 -04:00

52 lines
1.8 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 encryption
import (
"github.com/opentofu/opentofu/internal/encryption/keyprovider/aws_kms"
"github.com/opentofu/opentofu/internal/encryption/keyprovider/azure_vault"
externalKeyProvider "github.com/opentofu/opentofu/internal/encryption/keyprovider/external"
"github.com/opentofu/opentofu/internal/encryption/keyprovider/gcp_kms"
"github.com/opentofu/opentofu/internal/encryption/keyprovider/openbao"
"github.com/opentofu/opentofu/internal/encryption/keyprovider/pbkdf2"
"github.com/opentofu/opentofu/internal/encryption/method/aesgcm"
externalMethod "github.com/opentofu/opentofu/internal/encryption/method/external"
"github.com/opentofu/opentofu/internal/encryption/method/unencrypted"
"github.com/opentofu/opentofu/internal/encryption/registry/lockingencryptionregistry"
)
var DefaultRegistry = lockingencryptionregistry.New()
func init() {
if err := DefaultRegistry.RegisterKeyProvider(pbkdf2.New()); err != nil {
panic(err)
}
if err := DefaultRegistry.RegisterKeyProvider(aws_kms.New()); err != nil {
panic(err)
}
if err := DefaultRegistry.RegisterKeyProvider(gcp_kms.New()); err != nil {
panic(err)
}
if err := DefaultRegistry.RegisterKeyProvider(azure_vault.New()); err != nil {
panic(err)
}
if err := DefaultRegistry.RegisterKeyProvider(openbao.New()); err != nil {
panic(err)
}
if err := DefaultRegistry.RegisterKeyProvider(externalKeyProvider.New()); err != nil {
panic(err)
}
if err := DefaultRegistry.RegisterMethod(aesgcm.New()); err != nil {
panic(err)
}
if err := DefaultRegistry.RegisterMethod(externalMethod.New()); err != nil {
panic(err)
}
if err := DefaultRegistry.RegisterMethod(unencrypted.New()); err != nil {
panic(err)
}
}