// Code generated by mdatagen. DO NOT EDIT.

package configtls

import (
	"time"

	"go.opentelemetry.io/collector/config/configopaque"
)

// ClientConfig contains TLS configurations that are specific to client connections in addition to the common configurations.
// This should be used by components configuring TLS client connections.
type ClientConfig struct {
	// Insecure in gRPC and HTTP when set to true, this is used to disable the client transport security.
	// See https://godoc.org/google.golang.org/grpc#WithInsecure for gRPC.
	// Please refer to https://godoc.org/crypto/tls#Config for more information. (optional, default false)
	Insecure bool `mapstructure:"insecure,omitempty"`

	// InsecureSkipVerify enables TLS but not verify the certificate.
	InsecureSkipVerify bool `mapstructure:"insecure_skip_verify,omitempty"`

	// ServerName server name requested by client for virtual hosting. This sets the ServerName in the TLSConfig.
	// Please refer to https://godoc.org/crypto/tls#Config for more information. (optional)
	ServerName string `mapstructure:"server_name_override,omitempty"`

	// Exposes the common client and server TLS configurations.
	// Note: Since there isn''t anything specific to a server connection. Components with server connections should use Config.
	Config `mapstructure:",squash"`

	// prevent unkeyed literal initialization
	_ struct{}
}

// NewDefaultClientConfig returns a new ClientConfig with its default values applied.
// Prefer this over an empty struct literal so default changes stay in sync automatically.
func NewDefaultClientConfig() ClientConfig {
	return ClientConfig{
		Config: NewDefaultConfig(),
	}
}

// Config exposes the common client and server TLS configurations.
// Note: Since there isn”t anything specific to a server connection. Components with server connections should use Config.
type Config struct {
	// CAFile path to the CA cert. For a client this verifies the server certificate.
	// For a server this verifies client certificates. If empty uses system root CA. (optional)
	CAFile string `mapstructure:"ca_file,omitempty"`

	// CAPem in memory PEM encoded cert. (optional)
	CAPem configopaque.String `mapstructure:"ca_pem,omitempty"`

	// CertFile path to the TLS cert to use for TLS required connections. (optional)
	CertFile string `mapstructure:"cert_file,omitempty"`

	// CertPem in memory PEM encoded TLS cert to use for TLS required connections. (optional)
	CertPem configopaque.String `mapstructure:"cert_pem,omitempty"`

	// CipherSuites a list of TLS cipher suites that the TLS transport can use. If left blank, a safe default list is used.
	// See https://go.dev/src/crypto/tls/cipher_suites.go for a list of supported cipher suites.
	CipherSuites []string `mapstructure:"cipher_suites,omitempty"`

	// IncludeInsecureCipherSuites enables support for insecure cipher suites. When set to true, cipher suites returned by
	// tls.InsecureCipherSuites() will be available for selection in addition to the secure ones.
	// This should only be used when working with legacy systems that require insecure cipher suites.
	// (optional, default false)
	IncludeInsecureCipherSuites bool `mapstructure:"include_insecure_cipher_suites,omitempty"`

	// CurvePreferences contains the elliptic curves that will be used in an ECDHE handshake,
	// in preference order Defaults to empty list and "crypto/tls" defaults are used, internally.
	CurvePreferences []string `mapstructure:"curve_preferences,omitempty"`

	// IncludeSystemCACertsPool if true, load system CA certificates pool in addition to the certificates configured in this struct.
	IncludeSystemCACertsPool bool `mapstructure:"include_system_ca_certs_pool,omitempty"`

	// KeyFile path to the TLS key to use for TLS required connections. (optional)
	KeyFile string `mapstructure:"key_file,omitempty"`

	// KeyPem in memory PEM encoded TLS key to use for TLS required connections. (optional)
	KeyPem configopaque.String `mapstructure:"key_pem,omitempty"`

	// MaxVersion sets the maximum TLS version that is acceptable. If not set, refer to crypto/tls for defaults. (optional)
	MaxVersion string `mapstructure:"max_version,omitempty"`

	// MinVersion sets the minimum TLS version that is acceptable. If not set, TLS 1.2 will be used. (optional)
	MinVersion string `mapstructure:"min_version,omitempty"`

	// ReloadInterval specifies the duration after which the certificate will be reloaded If not set, it will never be reloaded (optional)
	ReloadInterval time.Duration `mapstructure:"reload_interval,omitempty"`

	// TPMConfig trusted platform module configuration
	TPMConfig TPMConfig `mapstructure:"tpm,omitempty"`

	// prevent unkeyed literal initialization
	_ struct{}
}

// NewDefaultConfig returns a new Config with its default values applied.
// Prefer this over an empty struct literal so default changes stay in sync automatically.
func NewDefaultConfig() Config {
	return Config{}
}

// ServerConfig contains TLS configurations that are specific to server connections in addition to the common configurations.
// This should be used by components configuring TLS server connections.
type ServerConfig struct {
	// ClientCAFile path to the TLS cert to use by the server to verify a client certificate. (optional)
	// This sets the ClientCAs and ClientAuth to RequireAndVerifyClientCert in the TLSConfig.
	// Please refer to https://godoc.org/crypto/tls#Config for more information. (optional)
	ClientCAFile string `mapstructure:"client_ca_file,omitempty"`

	// ReloadClientCAFile reload the ClientCAs file when it is modified (optional, default false)
	ReloadClientCAFile bool `mapstructure:"client_ca_file_reload,omitempty"`

	// Exposes the common client and server TLS configurations.
	// Note: Since there isn''t anything specific to a server connection. Components with server connections should use Config.
	Config `mapstructure:",squash"`

	// prevent unkeyed literal initialization
	_ struct{}
}

// NewDefaultServerConfig returns a new ServerConfig with its default values applied.
// Prefer this over an empty struct literal so default changes stay in sync automatically.
func NewDefaultServerConfig() ServerConfig {
	return ServerConfig{
		Config: NewDefaultConfig(),
	}
}

// TPMConfig defines trusted platform module configuration for storing TLS keys.
type TPMConfig struct {
	Auth string `mapstructure:"auth,omitempty"`

	Enabled bool `mapstructure:"enabled,omitempty"`

	OwnerAuth string `mapstructure:"owner_auth,omitempty"`

	// Path the path to the TPM device or Unix domain socket. For instance /dev/tpm0 or /dev/tpmrm0.
	Path string `mapstructure:"path,omitempty"`

	// prevent unkeyed literal initialization
	_ struct{}
}
