github.com/opentofu/opentofu@v1.7.1/internal/encryption/keyprovider/config.go (about)

     1  // Copyright (c) The OpenTofu Authors
     2  // SPDX-License-Identifier: MPL-2.0
     3  // Copyright (c) 2023 HashiCorp, Inc.
     4  // SPDX-License-Identifier: MPL-2.0
     5  
     6  package keyprovider
     7  
     8  // Config is a struct annotated with HCL (and preferably JSON) tags that OpenTofu reads the user-provided configuration
     9  // into. The Build function assembles the configuration into a usable key provider.
    10  type Config interface {
    11  	// Build provides a key provider and an empty JSON-tagged struct to read the decryption metadata into. If the
    12  	// configuration is invalid, it returns an error.
    13  	//
    14  	// If a key provider does not need metadata, it may return nil.
    15  	Build() (KeyProvider, KeyMeta, error)
    16  }