diff --git a/cmd/configschema/comments_test.go b/cmd/configschema/comments_test.go index 06880828840ea..2d906a3d3968f 100644 --- a/cmd/configschema/comments_test.go +++ b/cmd/configschema/comments_test.go @@ -35,7 +35,7 @@ func TestExternalType(t *testing.T) { } func TestSubPackage(t *testing.T) { - s := configtls.TLSClientSetting{} + s := configtls.ClientConfig{} v := reflect.ValueOf(s) _, err := commentsForStruct(v, testDR()) require.NoError(t, err) diff --git a/cmd/configschema/common_test.go b/cmd/configschema/common_test.go index e55401bfd71b6..3287e534ea3c4 100644 --- a/cmd/configschema/common_test.go +++ b/cmd/configschema/common_test.go @@ -22,13 +22,13 @@ type testStruct struct { Four bool `mapstructure:"four"` // embedded, package qualified comment time.Duration `mapstructure:"duration"` - Squashed testPerson `mapstructure:",squash"` - PersonPtr *testPerson `mapstructure:"person_ptr"` - PersonStruct testPerson `mapstructure:"person_struct"` - Persons []testPerson `mapstructure:"persons"` - PersonPtrs []*testPerson `mapstructure:"person_ptrs"` - Ignored string `mapstructure:"-"` - TLS configtls.TLSClientSetting `mapstructure:"tls"` + Squashed testPerson `mapstructure:",squash"` + PersonPtr *testPerson `mapstructure:"person_ptr"` + PersonStruct testPerson `mapstructure:"person_struct"` + Persons []testPerson `mapstructure:"persons"` + PersonPtrs []*testPerson `mapstructure:"person_ptrs"` + Ignored string `mapstructure:"-"` + TLS configtls.ClientConfig `mapstructure:"tls"` } func testDR() DirResolver { diff --git a/cmd/configschema/docsgen/docsgen/template.go b/cmd/configschema/docsgen/docsgen/template.go index 1c5d7a2a63594..4475c859161ba 100644 --- a/cmd/configschema/docsgen/docsgen/template.go +++ b/cmd/configschema/docsgen/docsgen/template.go @@ -28,14 +28,14 @@ func join(s string) string { return strings.ReplaceAll(s, "\n", " ") } -// mkAnchor takes a name and a type (e.g. "configtls.TLSClientSetting") and +// mkAnchor takes a name and a type (e.g. "configtls.ClientConfig") and // returns a string suitable for use as a markdown anchor. func mkAnchor(name, typ string) string { if isDuration(typ) { return "time-Duration" } idx := strings.IndexRune(typ, '.') - // strip "configtls." from e.g. "configtls.TLSClientSetting" + // strip "configtls." from e.g. "configtls.ClientConfig" typeStripped := typ[idx+1:] concat := fmt.Sprintf("%s-%s", name, typeStripped) asterisksRemoved := strings.ReplaceAll(concat, "*", "") diff --git a/cmd/configschema/docsgen/docsgen/testdata/otlp-receiver.json b/cmd/configschema/docsgen/docsgen/testdata/otlp-receiver.json index c1a1f0a71b07e..b7d9f54fe1478 100644 --- a/cmd/configschema/docsgen/docsgen/testdata/otlp-receiver.json +++ b/cmd/configschema/docsgen/docsgen/testdata/otlp-receiver.json @@ -37,7 +37,7 @@ }, { "Name": "tls_settings", - "Type": "*configtls.TLSServerSetting", + "Type": "*configtls.ServerConfig", "Kind": "ptr", "Default": null, "Doc": "Configures the protocol to use TLS.\nThe default value is nil, which will cause the protocol to not use TLS.\n", @@ -276,7 +276,7 @@ }, { "Name": "tls_settings", - "Type": "*configtls.TLSServerSetting", + "Type": "*configtls.ServerConfig", "Kind": "ptr", "Default": null, "Doc": "TLSSetting struct exposes TLS client configuration.\n", diff --git a/cmd/opampsupervisor/examples/supervisor_darwin.yaml b/cmd/opampsupervisor/examples/supervisor_darwin.yaml index 3797923778828..80d5b8bb5755a 100644 --- a/cmd/opampsupervisor/examples/supervisor_darwin.yaml +++ b/cmd/opampsupervisor/examples/supervisor_darwin.yaml @@ -4,7 +4,7 @@ server: # Disable verification to test locally. # Don't do this in production. insecure_skip_verify: true - # For more TLS settings see config/configtls.TLSClientSetting + # For more TLS settings see config/configtls.ClientConfig capabilities: reports_effective_config: true diff --git a/cmd/opampsupervisor/examples/supervisor_linux.yaml b/cmd/opampsupervisor/examples/supervisor_linux.yaml index 0c2cf5ce84305..00021ece6b40f 100644 --- a/cmd/opampsupervisor/examples/supervisor_linux.yaml +++ b/cmd/opampsupervisor/examples/supervisor_linux.yaml @@ -4,7 +4,7 @@ server: # Disable verification to test locally. # Don't do this in production. insecure_skip_verify: true - # For more TLS settings see config/configtls.TLSClientSetting + # For more TLS settings see config/configtls.ClientConfig capabilities: reports_effective_config: true diff --git a/cmd/opampsupervisor/examples/supervisor_windows.yaml b/cmd/opampsupervisor/examples/supervisor_windows.yaml index 35c20b62ca213..13d0a911d78dc 100644 --- a/cmd/opampsupervisor/examples/supervisor_windows.yaml +++ b/cmd/opampsupervisor/examples/supervisor_windows.yaml @@ -4,7 +4,7 @@ server: # Disable verification to test locally. # Don't do this in production. insecure_skip_verify: true - # For more TLS settings see config/configtls.TLSClientSetting + # For more TLS settings see config/configtls.ClientConfig capabilities: reports_effective_config: true diff --git a/cmd/opampsupervisor/supervisor/config/config.go b/cmd/opampsupervisor/supervisor/config/config.go index ccbd523d4e6f9..7d50005742310 100644 --- a/cmd/opampsupervisor/supervisor/config/config.go +++ b/cmd/opampsupervisor/supervisor/config/config.go @@ -25,7 +25,7 @@ type Capabilities struct { type OpAMPServer struct { Endpoint string - TLSSetting configtls.TLSClientSetting `mapstructure:"tls,omitempty"` + TLSSetting configtls.ClientConfig `mapstructure:"tls,omitempty"` } type Agent struct { diff --git a/exporter/alertmanagerexporter/alertmanager_exporter_test.go b/exporter/alertmanagerexporter/alertmanager_exporter_test.go index 438c44824fe78..382e541fa716a 100644 --- a/exporter/alertmanagerexporter/alertmanager_exporter_test.go +++ b/exporter/alertmanagerexporter/alertmanager_exporter_test.go @@ -347,7 +347,7 @@ func TestClientConfig(t *testing.T) { config: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: false, }, }, @@ -370,8 +370,8 @@ func TestClientConfig(t *testing.T) { config: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "testdata/test_cert.pem", }, }, @@ -383,8 +383,8 @@ func TestClientConfig(t *testing.T) { config: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "nosuchfile", }, }, diff --git a/exporter/alertmanagerexporter/config_test.go b/exporter/alertmanagerexporter/config_test.go index 41a3acda1b42a..3583349ac1df2 100644 --- a/exporter/alertmanagerexporter/config_test.go +++ b/exporter/alertmanagerexporter/config_test.go @@ -69,8 +69,8 @@ func TestLoadConfig(t *testing.T) { "another": "somevalue", }, Endpoint: "a.new.alertmanager.target:9093", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/var/lib/mycert.pem", }, }, diff --git a/exporter/coralogixexporter/config_test.go b/exporter/coralogixexporter/config_test.go index e3ccf3a154c5b..4ea81bbefefd4 100644 --- a/exporter/coralogixexporter/config_test.go +++ b/exporter/coralogixexporter/config_test.go @@ -60,8 +60,8 @@ func TestLoadConfig(t *testing.T) { Traces: configgrpc.ClientConfig{ Endpoint: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", Compression: configcompression.TypeGzip, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{}, + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{}, Insecure: false, InsecureSkipVerify: false, ServerName: "", @@ -73,8 +73,8 @@ func TestLoadConfig(t *testing.T) { }, ClientConfig: configgrpc.ClientConfig{ Endpoint: "https://", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{}, + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{}, Insecure: false, InsecureSkipVerify: false, ServerName: "", @@ -115,8 +115,8 @@ func TestLoadConfig(t *testing.T) { Traces: configgrpc.ClientConfig{ Endpoint: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", Compression: configcompression.TypeGzip, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{}, + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{}, Insecure: false, InsecureSkipVerify: false, ServerName: "", @@ -130,8 +130,8 @@ func TestLoadConfig(t *testing.T) { SubSystemAttributes: []string{"service.name", "k8s.deployment.name", "k8s.statefulset.name", "k8s.daemonset.name", "k8s.cronjob.name", "k8s.job.name", "k8s.container.name"}, ClientConfig: configgrpc.ClientConfig{ Endpoint: "https://", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{}, + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{}, Insecure: false, InsecureSkipVerify: false, ServerName: "", diff --git a/exporter/coralogixexporter/factory_test.go b/exporter/coralogixexporter/factory_test.go index 9c98356722fd1..bbac7634c6d43 100644 --- a/exporter/coralogixexporter/factory_test.go +++ b/exporter/coralogixexporter/factory_test.go @@ -92,7 +92,7 @@ func TestCreateTracesExporter(t *testing.T) { config: &Config{ Traces: configgrpc.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: false, }, }, @@ -172,8 +172,8 @@ func TestCreateTracesExporter(t *testing.T) { config: &Config{ Traces: configgrpc.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "nosuchfile", }, }, @@ -186,7 +186,7 @@ func TestCreateTracesExporter(t *testing.T) { config: &Config{ Domain: "localhost", DomainSettings: configgrpc.ClientConfig{ - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: false, }, }, diff --git a/exporter/dynatraceexporter/metrics_exporter_test.go b/exporter/dynatraceexporter/metrics_exporter_test.go index ae31e474dce40..0e095b6c67966 100644 --- a/exporter/dynatraceexporter/metrics_exporter_test.go +++ b/exporter/dynatraceexporter/metrics_exporter_test.go @@ -689,8 +689,8 @@ func Test_exporter_start_InvalidClientConfig(t *testing.T) { cfg := &config.Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: "localhost:9090", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, diff --git a/exporter/elasticsearchexporter/config.go b/exporter/elasticsearchexporter/config.go index b30f486c41160..63dfe75dde896 100644 --- a/exporter/elasticsearchexporter/config.go +++ b/exporter/elasticsearchexporter/config.go @@ -90,7 +90,7 @@ type ClientConfig struct { // will be send with each HTTP request. Headers map[string]string `mapstructure:"headers,omitempty"` - configtls.TLSClientSetting `mapstructure:"tls,omitempty"` + configtls.ClientConfig `mapstructure:"tls,omitempty"` } // AuthenticationSettings defines user authentication related settings. diff --git a/exporter/elasticsearchexporter/elasticsearch_bulk.go b/exporter/elasticsearchexporter/elasticsearch_bulk.go index b0ad977cd1a65..9885b70a41270 100644 --- a/exporter/elasticsearchexporter/elasticsearch_bulk.go +++ b/exporter/elasticsearchexporter/elasticsearch_bulk.go @@ -65,7 +65,7 @@ func (*clientLogger) ResponseBodyEnabled() bool { } func newElasticsearchClient(logger *zap.Logger, config *Config) (*esClientCurrent, error) { - tlsCfg, err := config.TLSClientSetting.LoadTLSConfig() + tlsCfg, err := config.ClientConfig.LoadTLSConfig() if err != nil { return nil, err } diff --git a/exporter/instanaexporter/config_test.go b/exporter/instanaexporter/config_test.go index fa05153942b65..207b2fe2daa97 100644 --- a/exporter/instanaexporter/config_test.go +++ b/exporter/instanaexporter/config_test.go @@ -29,8 +29,8 @@ func TestConfigValidate(t *testing.T) { t.Run("Valid configuration with ca_file", func(t *testing.T) { c := &Config{Endpoint: "https://example.com/", AgentKey: "key1", ClientConfig: confighttp.ClientConfig{ - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "ca.crt", }, }, diff --git a/exporter/instanaexporter/exporter_test.go b/exporter/instanaexporter/exporter_test.go index d81a7711202ff..6c7319e28ecf7 100644 --- a/exporter/instanaexporter/exporter_test.go +++ b/exporter/instanaexporter/exporter_test.go @@ -84,8 +84,8 @@ func TestSelfSignedBackend(t *testing.T) { AgentKey: "key11", ClientConfig: confighttp.ClientConfig{ Endpoint: server.URL, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: caFile, }, }, @@ -110,8 +110,8 @@ func TestSelfSignedBackendCAFileNotFound(t *testing.T) { AgentKey: "key11", ClientConfig: confighttp.ClientConfig{ Endpoint: "", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "ca_file_not_found.pem", }, }, diff --git a/exporter/instanaexporter/factory_test.go b/exporter/instanaexporter/factory_test.go index 63643b76f8558..4a9d867c97014 100644 --- a/exporter/instanaexporter/factory_test.go +++ b/exporter/instanaexporter/factory_test.go @@ -79,8 +79,8 @@ func TestLoadConfig(t *testing.T) { Timeout: 30 * time.Second, Headers: map[string]configopaque.String{}, WriteBufferSize: 512 * 1024, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "ca.crt", }, }, diff --git a/exporter/kafkaexporter/kafka_exporter_test.go b/exporter/kafkaexporter/kafka_exporter_test.go index ef91f0892d1e3..7035bf1869055 100644 --- a/exporter/kafkaexporter/kafka_exporter_test.go +++ b/exporter/kafkaexporter/kafka_exporter_test.go @@ -87,8 +87,8 @@ func TestNewExporter_err_auth_type(t *testing.T) { c := Config{ ProtocolVersion: "2.0.0", Authentication: kafka.Authentication{ - TLS: &configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/doesnotexist", }, }, diff --git a/exporter/lokiexporter/config_test.go b/exporter/lokiexporter/config_test.go index bd0078f5ca5ae..901b73ef817b1 100644 --- a/exporter/lokiexporter/config_test.go +++ b/exporter/lokiexporter/config_test.go @@ -41,8 +41,8 @@ func TestLoadConfigNewExporter(t *testing.T) { "X-Custom-Header": "loki_rocks", }, Endpoint: "https://loki:3100/loki/api/v1/push", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/var/lib/mycert.pem", CertFile: "certfile", KeyFile: "keyfile", diff --git a/exporter/opencensusexporter/config_test.go b/exporter/opencensusexporter/config_test.go index 5e80135b82918..1cd3b1a8b9bdb 100644 --- a/exporter/opencensusexporter/config_test.go +++ b/exporter/opencensusexporter/config_test.go @@ -57,8 +57,8 @@ func TestLoadConfig(t *testing.T) { }, Endpoint: "1.2.3.4:1234", Compression: "gzip", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/var/lib/mycert.pem", }, Insecure: false, diff --git a/exporter/opencensusexporter/factory_test.go b/exporter/opencensusexporter/factory_test.go index 54f8409442e2f..4ff456c9fbd8c 100644 --- a/exporter/opencensusexporter/factory_test.go +++ b/exporter/opencensusexporter/factory_test.go @@ -49,7 +49,7 @@ func TestCreateTracesExporter(t *testing.T) { config: &Config{ ClientConfig: configgrpc.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: false, }, }, @@ -62,7 +62,7 @@ func TestCreateTracesExporter(t *testing.T) { config: &Config{ ClientConfig: configgrpc.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: false, }, }, @@ -123,8 +123,8 @@ func TestCreateTracesExporter(t *testing.T) { config: &Config{ ClientConfig: configgrpc.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "testdata/test_cert.pem", }, }, @@ -137,8 +137,8 @@ func TestCreateTracesExporter(t *testing.T) { config: &Config{ ClientConfig: configgrpc.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "nosuchfile", }, }, diff --git a/exporter/opencensusexporter/opencensus_test.go b/exporter/opencensusexporter/opencensus_test.go index 947c632bbb950..5bc8001ef255e 100644 --- a/exporter/opencensusexporter/opencensus_test.go +++ b/exporter/opencensusexporter/opencensus_test.go @@ -41,7 +41,7 @@ func TestSendTraces(t *testing.T) { cfg := factory.CreateDefaultConfig().(*Config) cfg.ClientConfig = configgrpc.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, } @@ -83,7 +83,7 @@ func TestSendTraces_NoBackend(t *testing.T) { cfg := factory.CreateDefaultConfig().(*Config) cfg.ClientConfig = configgrpc.ClientConfig{ Endpoint: "localhost:56569", - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, } @@ -107,7 +107,7 @@ func TestSendTraces_AfterStop(t *testing.T) { cfg := factory.CreateDefaultConfig().(*Config) cfg.ClientConfig = configgrpc.ClientConfig{ Endpoint: "localhost:56569", - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, } @@ -140,7 +140,7 @@ func TestSendMetrics(t *testing.T) { cfg := factory.CreateDefaultConfig().(*Config) cfg.ClientConfig = configgrpc.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, } @@ -180,7 +180,7 @@ func TestSendMetrics_NoBackend(t *testing.T) { cfg := factory.CreateDefaultConfig().(*Config) cfg.ClientConfig = configgrpc.ClientConfig{ Endpoint: "localhost:56569", - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, } @@ -204,7 +204,7 @@ func TestSendMetrics_AfterStop(t *testing.T) { cfg := factory.CreateDefaultConfig().(*Config) cfg.ClientConfig = configgrpc.ClientConfig{ Endpoint: "localhost:56569", - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, } diff --git a/exporter/otelarrowexporter/config_test.go b/exporter/otelarrowexporter/config_test.go index 9f4d83ea5ef73..057e2137fefbb 100644 --- a/exporter/otelarrowexporter/config_test.go +++ b/exporter/otelarrowexporter/config_test.go @@ -66,8 +66,8 @@ func TestUnmarshalConfig(t *testing.T) { }, Endpoint: "1.2.3.4:1234", Compression: "none", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/var/lib/mycert.pem", }, Insecure: false, diff --git a/exporter/otelarrowexporter/factory_test.go b/exporter/otelarrowexporter/factory_test.go index 1aa923384d6a0..3c827d6b4ef44 100644 --- a/exporter/otelarrowexporter/factory_test.go +++ b/exporter/otelarrowexporter/factory_test.go @@ -77,7 +77,7 @@ func TestCreateTracesExporter(t *testing.T) { config: Config{ ClientConfig: configgrpc.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: false, }, }, @@ -157,8 +157,8 @@ func TestCreateTracesExporter(t *testing.T) { config: Config{ ClientConfig: configgrpc.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: filepath.Join("testdata", "test_cert.pem"), }, }, @@ -170,8 +170,8 @@ func TestCreateTracesExporter(t *testing.T) { config: Config{ ClientConfig: configgrpc.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "nosuchfile", }, }, diff --git a/exporter/prometheusexporter/config_test.go b/exporter/prometheusexporter/config_test.go index 833a1a1237767..d0eaf69d7fc97 100644 --- a/exporter/prometheusexporter/config_test.go +++ b/exporter/prometheusexporter/config_test.go @@ -37,8 +37,8 @@ func TestLoadConfig(t *testing.T) { expected: &Config{ ServerConfig: confighttp.ServerConfig{ Endpoint: "1.2.3.4:1234", - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "certs/server.crt", KeyFile: "certs/server.key", CAFile: "certs/ca.crt", diff --git a/exporter/prometheusexporter/prometheus_test.go b/exporter/prometheusexporter/prometheus_test.go index 763f3a34fef2b..ccec759239147 100644 --- a/exporter/prometheusexporter/prometheus_test.go +++ b/exporter/prometheusexporter/prometheus_test.go @@ -98,8 +98,8 @@ func TestPrometheusExporter_WithTLS(t *testing.T) { }, ServerConfig: confighttp.ServerConfig{ Endpoint: "localhost:7777", - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "./testdata/certs/server.crt", KeyFile: "./testdata/certs/server.key", CAFile: "./testdata/certs/ca.crt", @@ -117,8 +117,8 @@ func TestPrometheusExporter_WithTLS(t *testing.T) { exp, err := factory.CreateMetricsExporter(context.Background(), set, cfg) require.NoError(t, err) - tlscs := configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + tlscs := configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "./testdata/certs/ca.crt", CertFile: "./testdata/certs/client.crt", KeyFile: "./testdata/certs/client.key", diff --git a/exporter/prometheusremotewriteexporter/config_test.go b/exporter/prometheusremotewriteexporter/config_test.go index 8b6b7345fe77b..690acbc254628 100644 --- a/exporter/prometheusremotewriteexporter/config_test.go +++ b/exporter/prometheusremotewriteexporter/config_test.go @@ -61,8 +61,8 @@ func TestLoadConfig(t *testing.T) { ExternalLabels: map[string]string{"key1": "value1", "key2": "value2"}, ClientConfig: confighttp.ClientConfig{ Endpoint: "localhost:8888", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/var/lib/mycert.pem", // This is subject to change, but currently I have no idea what else to put here lol }, Insecure: false, diff --git a/exporter/prometheusremotewriteexporter/exporter_test.go b/exporter/prometheusremotewriteexporter/exporter_test.go index ef2f0f195c144..cec87c5b0defb 100644 --- a/exporter/prometheusremotewriteexporter/exporter_test.go +++ b/exporter/prometheusremotewriteexporter/exporter_test.go @@ -180,8 +180,8 @@ func Test_Start(t *testing.T) { returnErrorOnStartUp: true, clientSettings: confighttp.ClientConfig{ Endpoint: "https://some.url:9411/api/prom/push", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "non-existent file", CertFile: "", KeyFile: "", diff --git a/exporter/prometheusremotewriteexporter/factory_test.go b/exporter/prometheusremotewriteexporter/factory_test.go index ea3be196bac50..ed86ed403a606 100644 --- a/exporter/prometheusremotewriteexporter/factory_test.go +++ b/exporter/prometheusremotewriteexporter/factory_test.go @@ -29,8 +29,8 @@ func Test_createMetricsExporter(t *testing.T) { invalidConfig := createDefaultConfig().(*Config) invalidConfig.ClientConfig = confighttp.ClientConfig{} invalidTLSConfig := createDefaultConfig().(*Config) - invalidTLSConfig.ClientConfig.TLSSetting = configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + invalidTLSConfig.ClientConfig.TLSSetting = configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "non-existent file", CertFile: "", KeyFile: "", diff --git a/exporter/signalfxexporter/config.go b/exporter/signalfxexporter/config.go index aed4f7c82d9a2..d7b27608c9b26 100644 --- a/exporter/signalfxexporter/config.go +++ b/exporter/signalfxexporter/config.go @@ -68,7 +68,7 @@ type Config struct { // ingest_tls needs to be set if the exporter's IngestURL is pointing to a signalfx receiver // with TLS enabled and using a self-signed certificate where its CA is not loaded in the system cert pool. - IngestTLSSettings configtls.TLSClientSetting `mapstructure:"ingest_tls,omitempty"` + IngestTLSSettings configtls.ClientConfig `mapstructure:"ingest_tls,omitempty"` // APIURL is the destination to where SignalFx metadata will be sent. This // value takes precedence over the value of Realm @@ -76,7 +76,7 @@ type Config struct { // api_tls needs to be set if the exporter's APIURL is pointing to a httforwarder extension // with TLS enabled and using a self-signed certificate where its CA is not loaded in the system cert pool. - APITLSSettings configtls.TLSClientSetting `mapstructure:"api_tls,omitempty"` + APITLSSettings configtls.ClientConfig `mapstructure:"api_tls,omitempty"` // Whether to log datapoints dispatched to Splunk Observability Cloud LogDataPoints bool `mapstructure:"log_data_points"` diff --git a/exporter/signalfxexporter/exporter_test.go b/exporter/signalfxexporter/exporter_test.go index 1aee964074713..b5203af95ed69 100644 --- a/exporter/signalfxexporter/exporter_test.go +++ b/exporter/signalfxexporter/exporter_test.go @@ -1277,13 +1277,13 @@ func TestTLSExporterInit(t *testing.T) { config: &Config{ APIURL: "https://test", IngestURL: "https://test", - IngestTLSSettings: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + IngestTLSSettings: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "./testdata/certs/ca.pem", }, }, - APITLSSettings: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + APITLSSettings: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "./testdata/certs/ca.pem", }, }, @@ -1297,8 +1297,8 @@ func TestTLSExporterInit(t *testing.T) { config: &Config{ APIURL: "https://test", IngestURL: "https://test", - IngestTLSSettings: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + IngestTLSSettings: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "./testdata/certs/missingfile", }, }, @@ -1313,8 +1313,8 @@ func TestTLSExporterInit(t *testing.T) { config: &Config{ APIURL: "https://test", IngestURL: "https://test", - IngestTLSSettings: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + IngestTLSSettings: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "./testdata/certs/invalid-ca.pem", }, }, @@ -1384,8 +1384,8 @@ func TestTLSIngestConnection(t *testing.T) { config: &Config{ APIURL: serverURL, IngestURL: serverURL, - IngestTLSSettings: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + IngestTLSSettings: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "./testdata/certs/ca.pem", }, }, @@ -1497,8 +1497,8 @@ func TestTLSAPIConnection(t *testing.T) { IngestURL: server.URL, AccessToken: "random", SyncHostMetadata: true, - APITLSSettings: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + APITLSSettings: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "./testdata/certs/ca.pem", }, }, diff --git a/exporter/signalfxexporter/internal/correlation/correlation_test.go b/exporter/signalfxexporter/internal/correlation/correlation_test.go index d1e9db2f7c03a..27633dcb2d1bd 100644 --- a/exporter/signalfxexporter/internal/correlation/correlation_test.go +++ b/exporter/signalfxexporter/internal/correlation/correlation_test.go @@ -56,8 +56,8 @@ func TestTrackerStart(t *testing.T) { config: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: "localhost:9090", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, diff --git a/exporter/skywalkingexporter/config_test.go b/exporter/skywalkingexporter/config_test.go index 3f53ff4356bc2..c86f145885678 100644 --- a/exporter/skywalkingexporter/config_test.go +++ b/exporter/skywalkingexporter/config_test.go @@ -66,8 +66,8 @@ func TestLoadConfig(t *testing.T) { }, Endpoint: "1.2.3.4:11800", Compression: "gzip", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/var/lib/mycert.pem", }, Insecure: false, diff --git a/exporter/skywalkingexporter/factory_test.go b/exporter/skywalkingexporter/factory_test.go index e5f5880e30156..37b732f710402 100644 --- a/exporter/skywalkingexporter/factory_test.go +++ b/exporter/skywalkingexporter/factory_test.go @@ -39,7 +39,7 @@ func TestCreateTracesExporter(t *testing.T) { config: &Config{ ClientConfig: configgrpc.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: false, }, }, @@ -100,8 +100,8 @@ func TestCreateTracesExporter(t *testing.T) { config: &Config{ ClientConfig: configgrpc.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "testdata/test_cert.pem", }, Insecure: false, @@ -115,8 +115,8 @@ func TestCreateTracesExporter(t *testing.T) { config: &Config{ ClientConfig: configgrpc.ClientConfig{ Endpoint: endpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "nosuchfile", }, }, diff --git a/exporter/skywalkingexporter/skywalking_benchmark_test.go b/exporter/skywalkingexporter/skywalking_benchmark_test.go index a62aff28ffbff..4a232bbb19ad0 100644 --- a/exporter/skywalkingexporter/skywalking_benchmark_test.go +++ b/exporter/skywalkingexporter/skywalking_benchmark_test.go @@ -128,7 +128,7 @@ func doInit(numStream int, t *testing.T) (*swExporter, *grpc.Server, *mockLogHan }, ClientConfig: configgrpc.ClientConfig{ Endpoint: addr.String(), - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, }, diff --git a/exporter/skywalkingexporter/skywalking_test.go b/exporter/skywalkingexporter/skywalking_test.go index cebb52485bb08..e75c957b621c0 100644 --- a/exporter/skywalkingexporter/skywalking_test.go +++ b/exporter/skywalkingexporter/skywalking_test.go @@ -33,7 +33,7 @@ func TestSwExporter(t *testing.T) { NumStreams: 10, ClientConfig: configgrpc.ClientConfig{ Endpoint: addr.String(), - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, }, @@ -106,7 +106,7 @@ func TestSwExporter(t *testing.T) { NumStreams: 10, ClientConfig: configgrpc.ClientConfig{ Endpoint: addr.String(), - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, }, diff --git a/exporter/splunkhecexporter/config_test.go b/exporter/splunkhecexporter/config_test.go index dd6c4c689581a..023b3eed3a6ef 100644 --- a/exporter/splunkhecexporter/config_test.go +++ b/exporter/splunkhecexporter/config_test.go @@ -63,8 +63,8 @@ func TestLoadConfig(t *testing.T) { ClientConfig: confighttp.ClientConfig{ Timeout: 10 * time.Second, Endpoint: "https://splunk:8088/services/collector", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "", CertFile: "", KeyFile: "", diff --git a/exporter/syslogexporter/config.go b/exporter/syslogexporter/config.go index c5f0c9c3d7671..31f0c0c4bfc12 100644 --- a/exporter/syslogexporter/config.go +++ b/exporter/syslogexporter/config.go @@ -38,7 +38,7 @@ type Config struct { EnableOctetCounting bool `mapstructure:"enable_octet_counting"` // TLSSetting struct exposes TLS client configuration. - TLSSetting configtls.TLSClientSetting `mapstructure:"tls"` + TLSSetting configtls.ClientConfig `mapstructure:"tls"` exporterhelper.QueueSettings `mapstructure:"sending_queue"` configretry.BackOffConfig `mapstructure:"retry_on_failure"` diff --git a/exporter/syslogexporter/exporter_test.go b/exporter/syslogexporter/exporter_test.go index 58a025701b3a9..189e89e73f401 100644 --- a/exporter/syslogexporter/exporter_test.go +++ b/exporter/syslogexporter/exporter_test.go @@ -191,27 +191,27 @@ func TestTLSConfig(t *testing.T) { tests := []struct { name string network string - tlsSettings configtls.TLSClientSetting + tlsSettings configtls.ClientConfig tlsConfig *tls.Config }{ {name: "TCP with TLS configuration", network: "tcp", - tlsSettings: configtls.TLSClientSetting{}, + tlsSettings: configtls.ClientConfig{}, tlsConfig: &tls.Config{}, }, {name: "TCP insecure", network: "tcp", - tlsSettings: configtls.TLSClientSetting{Insecure: true}, + tlsSettings: configtls.ClientConfig{Insecure: true}, tlsConfig: nil, }, {name: "UDP with TLS configuration", network: "udp", - tlsSettings: configtls.TLSClientSetting{}, + tlsSettings: configtls.ClientConfig{}, tlsConfig: nil, }, {name: "UDP insecure", network: "udp", - tlsSettings: configtls.TLSClientSetting{Insecure: true}, + tlsSettings: configtls.ClientConfig{Insecure: true}, tlsConfig: nil, }, } diff --git a/exporter/zipkinexporter/config_test.go b/exporter/zipkinexporter/config_test.go index cd317d1605689..db89e0619f7af 100644 --- a/exporter/zipkinexporter/config_test.go +++ b/exporter/zipkinexporter/config_test.go @@ -61,7 +61,7 @@ func TestLoadConfig(t *testing.T) { Endpoint: "https://somedest:1234/api/v2/spans", WriteBufferSize: 524288, Timeout: 5 * time.Second, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ InsecureSkipVerify: true, }, MaxIdleConns: &maxIdleConns, diff --git a/extension/awsproxy/config_test.go b/extension/awsproxy/config_test.go index 4834342dfa2c8..a6171a652990d 100644 --- a/extension/awsproxy/config_test.go +++ b/extension/awsproxy/config_test.go @@ -37,7 +37,7 @@ func TestLoadConfig(t *testing.T) { Endpoint: "0.0.0.0:1234", }, ProxyAddress: "https://proxy.proxy.com", - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, ServerName: "something", }, diff --git a/extension/awsproxy/factory.go b/extension/awsproxy/factory.go index b371d643b4c04..9c56133faceb0 100644 --- a/extension/awsproxy/factory.go +++ b/extension/awsproxy/factory.go @@ -36,7 +36,7 @@ func createDefaultConfig() component.Config { TCPAddrConfig: confignet.TCPAddrConfig{ Endpoint: localhostgate.EndpointForPort(defaultPort), }, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: false, }, }, diff --git a/extension/healthcheckextension/config_test.go b/extension/healthcheckextension/config_test.go index 16729c019b64a..43dc962b1ae7c 100644 --- a/extension/healthcheckextension/config_test.go +++ b/extension/healthcheckextension/config_test.go @@ -34,8 +34,8 @@ func TestLoadConfig(t *testing.T) { expected: &Config{ ServerConfig: confighttp.ServerConfig{ Endpoint: "localhost:13", - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CAFile: "/path/to/ca", CertFile: "/path/to/cert", KeyFile: "/path/to/key", diff --git a/extension/httpforwarderextension/extension_test.go b/extension/httpforwarderextension/extension_test.go index 352fe7b331dd1..3a9747857d34c 100644 --- a/extension/httpforwarderextension/extension_test.go +++ b/extension/httpforwarderextension/extension_test.go @@ -132,8 +132,8 @@ func TestExtension(t *testing.T) { config: &Config{ Egress: confighttp.ClientConfig{ Endpoint: "localhost:9090", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, diff --git a/extension/jaegerremotesampling/extension_test.go b/extension/jaegerremotesampling/extension_test.go index 53be6b87d7d82..072b45268e76e 100644 --- a/extension/jaegerremotesampling/extension_test.go +++ b/extension/jaegerremotesampling/extension_test.go @@ -102,7 +102,7 @@ func TestRemote(t *testing.T) { cfg.Source.ReloadInterval = tc.reloadInterval cfg.Source.Remote = &configgrpc.ClientConfig{ Endpoint: fmt.Sprintf("127.0.0.1:%d", lis.Addr().(*net.TCPAddr).Port), - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, // test only }, WaitForReady: true, diff --git a/extension/oauth2clientauthextension/config.go b/extension/oauth2clientauthextension/config.go index c5e31064070ab..ea99916f4d73f 100644 --- a/extension/oauth2clientauthextension/config.go +++ b/extension/oauth2clientauthextension/config.go @@ -49,7 +49,7 @@ type Config struct { Scopes []string `mapstructure:"scopes,omitempty"` // TLSSetting struct exposes TLS client configuration for the underneath client to authorization server. - TLSSetting configtls.TLSClientSetting `mapstructure:"tls,omitempty"` + TLSSetting configtls.ClientConfig `mapstructure:"tls,omitempty"` // Timeout parameter configures `http.Client.Timeout` for the underneath client to authorization // server while fetching and refreshing tokens. diff --git a/extension/oauth2clientauthextension/config_test.go b/extension/oauth2clientauthextension/config_test.go index 288b4340c5679..10fae26ecaf7b 100644 --- a/extension/oauth2clientauthextension/config_test.go +++ b/extension/oauth2clientauthextension/config_test.go @@ -45,8 +45,8 @@ func TestLoadConfig(t *testing.T) { Scopes: []string{"api.metrics"}, TokenURL: "https://example2.com/oauth2/default/v1/token", Timeout: time.Second, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "cafile", CertFile: "certfile", KeyFile: "keyfile", diff --git a/extension/oauth2clientauthextension/extension_test.go b/extension/oauth2clientauthextension/extension_test.go index 2e68687aeafdb..bfc0886cbf777 100644 --- a/extension/oauth2clientauthextension/extension_test.go +++ b/extension/oauth2clientauthextension/extension_test.go @@ -43,8 +43,8 @@ func TestOAuthClientSettings(t *testing.T) { TokenURL: "https://example.com/v1/token", Scopes: []string{"resource.read"}, Timeout: 2, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: testCAFile, CertFile: testCertFile, KeyFile: testKeyFile, @@ -64,8 +64,8 @@ func TestOAuthClientSettings(t *testing.T) { TokenURL: "https://example.com/v1/token", Scopes: []string{"resource.read"}, Timeout: 2, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: testCAFile, CertFile: "doestexist.cert", KeyFile: testKeyFile, diff --git a/extension/opampextension/config.go b/extension/opampextension/config.go index 0ed2bb11e4a15..7756b1e1164a1 100644 --- a/extension/opampextension/config.go +++ b/extension/opampextension/config.go @@ -46,7 +46,7 @@ func (caps Capabilities) toAgentCapabilities() protobufs.AgentCapabilities { type commonFields struct { Endpoint string `mapstructure:"endpoint"` - TLSSetting configtls.TLSClientSetting `mapstructure:"tls,omitempty"` + TLSSetting configtls.ClientConfig `mapstructure:"tls,omitempty"` Headers map[string]configopaque.String `mapstructure:"headers,omitempty"` } @@ -87,13 +87,13 @@ func (s OpAMPServer) GetHeaders() map[string]configopaque.String { return map[string]configopaque.String{} } -func (s OpAMPServer) GetTLSSetting() configtls.TLSClientSetting { +func (s OpAMPServer) GetTLSSetting() configtls.ClientConfig { if s.WS != nil { return s.WS.TLSSetting } else if s.HTTP != nil { return s.HTTP.TLSSetting } - return configtls.TLSClientSetting{} + return configtls.ClientConfig{} } func (s OpAMPServer) GetEndpoint() string { diff --git a/extension/opampextension/config_test.go b/extension/opampextension/config_test.go index 364f1236f1e52..7a0d0ddd4461c 100644 --- a/extension/opampextension/config_test.go +++ b/extension/opampextension/config_test.go @@ -97,7 +97,7 @@ func TestConfig_Getters(t *testing.T) { Headers: map[string]configopaque.String{ "test": configopaque.String("test"), }, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, }, @@ -118,7 +118,7 @@ func TestConfig_Getters(t *testing.T) { Headers: map[string]configopaque.String{ "test": configopaque.String("test"), }, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, }, diff --git a/internal/aws/proxy/cfg.go b/internal/aws/proxy/cfg.go index 4a20b817b4a98..2d352d58f7421 100644 --- a/internal/aws/proxy/cfg.go +++ b/internal/aws/proxy/cfg.go @@ -23,7 +23,7 @@ type Config struct { // TLSSetting struct exposes TLS client configuration when forwarding // calls to the AWS X-Ray backend. - TLSSetting configtls.TLSClientSetting `mapstructure:"tls,omitempty"` + TLSSetting configtls.ClientConfig `mapstructure:"tls,omitempty"` // Region is the AWS region the local TCP server forwards requests to. Region string `mapstructure:"region"` @@ -52,7 +52,7 @@ func DefaultConfig() *Config { Endpoint: localhostgate.EndpointForPort(2000), }, ProxyAddress: "", - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: false, ServerName: "", }, diff --git a/internal/kafka/authentication.go b/internal/kafka/authentication.go index 835244fc10dcc..a05edc6486c50 100644 --- a/internal/kafka/authentication.go +++ b/internal/kafka/authentication.go @@ -16,10 +16,10 @@ import ( // Authentication defines authentication. type Authentication struct { - PlainText *PlainTextConfig `mapstructure:"plain_text"` - SASL *SASLConfig `mapstructure:"sasl"` - TLS *configtls.TLSClientSetting `mapstructure:"tls"` - Kerberos *KerberosConfig `mapstructure:"kerberos"` + PlainText *PlainTextConfig `mapstructure:"plain_text"` + SASL *SASLConfig `mapstructure:"sasl"` + TLS *configtls.ClientConfig `mapstructure:"tls"` + Kerberos *KerberosConfig `mapstructure:"kerberos"` } // PlainTextConfig defines plaintext authentication. @@ -134,7 +134,7 @@ func configureSASL(config SASLConfig, saramaConfig *sarama.Config) error { return nil } -func configureTLS(config configtls.TLSClientSetting, saramaConfig *sarama.Config) error { +func configureTLS(config configtls.ClientConfig, saramaConfig *sarama.Config) error { tlsConfig, err := config.LoadTLSConfig() if err != nil { return fmt.Errorf("error loading tls config: %w", err) diff --git a/internal/kafka/authentication_test.go b/internal/kafka/authentication_test.go index 071a7ec8bf181..3fa52c62ea333 100644 --- a/internal/kafka/authentication_test.go +++ b/internal/kafka/authentication_test.go @@ -46,7 +46,7 @@ func TestAuthentication(t *testing.T) { saramaTLSCfg := &sarama.Config{} saramaTLSCfg.Net.TLS.Enable = true - tlsClient := configtls.TLSClientSetting{} + tlsClient := configtls.ClientConfig{} tlscfg, err := tlsClient.LoadTLSConfig() require.NoError(t, err) saramaTLSCfg.Net.TLS.Config = tlscfg @@ -73,12 +73,12 @@ func TestAuthentication(t *testing.T) { saramaConfig: saramaPlaintext, }, { - auth: Authentication{TLS: &configtls.TLSClientSetting{}}, + auth: Authentication{TLS: &configtls.ClientConfig{}}, saramaConfig: saramaTLSCfg, }, { - auth: Authentication{TLS: &configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{CAFile: "/doesnotexists"}, + auth: Authentication{TLS: &configtls.ClientConfig{ + TLSSetting: configtls.Config{CAFile: "/doesnotexists"}, }}, saramaConfig: saramaTLSCfg, err: "failed to load TLS config", diff --git a/internal/kubelet/client_config.go b/internal/kubelet/client_config.go index ff8c86f2c8cb2..91eb85267d684 100644 --- a/internal/kubelet/client_config.go +++ b/internal/kubelet/client_config.go @@ -11,8 +11,8 @@ import ( // ClientConfig for a kubelet client for talking to a kubelet HTTP endpoint. type ClientConfig struct { - k8sconfig.APIConfig `mapstructure:",squash"` - configtls.TLSSetting `mapstructure:",squash"` + k8sconfig.APIConfig `mapstructure:",squash"` + configtls.Config `mapstructure:",squash"` // InsecureSkipVerify controls whether the client verifies the server's // certificate chain and host name. InsecureSkipVerify bool `mapstructure:"insecure_skip_verify"` diff --git a/internal/kubelet/client_test.go b/internal/kubelet/client_test.go index cdc0c10ed457b..c0a3b86fec7c2 100644 --- a/internal/kubelet/client_test.go +++ b/internal/kubelet/client_test.go @@ -55,7 +55,7 @@ func TestNewTLSClientProvider(t *testing.T) { APIConfig: k8sconfig.APIConfig{ AuthType: k8sconfig.AuthTypeTLS, }, - TLSSetting: configtls.TLSSetting{ + Config: configtls.Config{ CAFile: certPath, CertFile: certPath, KeyFile: keyFile, @@ -278,7 +278,7 @@ func TestTLSMissingCertFile(t *testing.T) { p := tlsClientProvider{ endpoint: "", cfg: &ClientConfig{ - TLSSetting: configtls.TLSSetting{ + Config: configtls.Config{ CAFile: certPath, }, }, diff --git a/pkg/stanza/operator/input/syslog/config_test.go b/pkg/stanza/operator/input/syslog/config_test.go index fc8354440db0d..3285fb793ca26 100644 --- a/pkg/stanza/operator/input/syslog/config_test.go +++ b/pkg/stanza/operator/input/syslog/config_test.go @@ -39,8 +39,8 @@ func TestUnmarshal(t *testing.T) { cfg.TCP.Encoding = "utf-16" cfg.TCP.SplitConfig.LineStartPattern = "ABC" cfg.TCP.SplitConfig.LineEndPattern = "" - cfg.TCP.TLS = &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + cfg.TCP.TLS = &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "foo", KeyFile: "foo2", CAFile: "foo3", diff --git a/pkg/stanza/operator/input/tcp/config_test.go b/pkg/stanza/operator/input/tcp/config_test.go index 07e7f9305bf65..e760df6018ca1 100644 --- a/pkg/stanza/operator/input/tcp/config_test.go +++ b/pkg/stanza/operator/input/tcp/config_test.go @@ -32,8 +32,8 @@ func TestUnmarshal(t *testing.T) { cfg.AddAttributes = true cfg.Encoding = "utf-8" cfg.SplitConfig.LineStartPattern = "ABC" - cfg.TLS = &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + cfg.TLS = &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "foo", KeyFile: "foo2", CAFile: "foo3", diff --git a/pkg/stanza/operator/input/tcp/tcp.go b/pkg/stanza/operator/input/tcp/tcp.go index 2dd553e775121..e28853cbd2871 100644 --- a/pkg/stanza/operator/input/tcp/tcp.go +++ b/pkg/stanza/operator/input/tcp/tcp.go @@ -68,14 +68,14 @@ type Config struct { // BaseConfig is the detailed configuration of a tcp input operator. type BaseConfig struct { - MaxLogSize helper.ByteSize `mapstructure:"max_log_size,omitempty"` - ListenAddress string `mapstructure:"listen_address,omitempty"` - TLS *configtls.TLSServerSetting `mapstructure:"tls,omitempty"` - AddAttributes bool `mapstructure:"add_attributes,omitempty"` - OneLogPerPacket bool `mapstructure:"one_log_per_packet,omitempty"` - Encoding string `mapstructure:"encoding,omitempty"` - SplitConfig split.Config `mapstructure:"multiline,omitempty"` - TrimConfig trim.Config `mapstructure:",squash"` + MaxLogSize helper.ByteSize `mapstructure:"max_log_size,omitempty"` + ListenAddress string `mapstructure:"listen_address,omitempty"` + TLS *configtls.ServerConfig `mapstructure:"tls,omitempty"` + AddAttributes bool `mapstructure:"add_attributes,omitempty"` + OneLogPerPacket bool `mapstructure:"one_log_per_packet,omitempty"` + Encoding string `mapstructure:"encoding,omitempty"` + SplitConfig split.Config `mapstructure:"multiline,omitempty"` + TrimConfig trim.Config `mapstructure:",squash"` SplitFuncBuilder SplitFuncBuilder } diff --git a/pkg/stanza/operator/input/tcp/tcp_test.go b/pkg/stanza/operator/input/tcp/tcp_test.go index 3bb3c0cbe4bef..c08eb4545cfc6 100644 --- a/pkg/stanza/operator/input/tcp/tcp_test.go +++ b/pkg/stanza/operator/input/tcp/tcp_test.go @@ -206,8 +206,8 @@ func tlsInputTest(input []byte, expected []string) func(t *testing.T) { cfg := NewConfigWithID("test_id") cfg.ListenAddress = ":0" - cfg.TLS = &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + cfg.TLS = &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "test.crt", KeyFile: "test.key", }, @@ -325,8 +325,8 @@ func TestBuild(t *testing.T) { BaseConfig: BaseConfig{ MaxLogSize: 65536, ListenAddress: "10.0.0.1:9000", - TLS: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "/tmp/cert/missing", KeyFile: "/tmp/key/missing", }, diff --git a/processor/resourcedetectionprocessor/config_test.go b/processor/resourcedetectionprocessor/config_test.go index 829e3f6accf95..20ba6b7e7c6d3 100644 --- a/processor/resourcedetectionprocessor/config_test.go +++ b/processor/resourcedetectionprocessor/config_test.go @@ -33,7 +33,7 @@ func TestLoadConfig(t *testing.T) { openshiftConfig.OpenShiftConfig = openshift.Config{ Address: "127.0.0.1:4444", Token: "some_token", - TLSSettings: configtls.TLSClientSetting{ + TLSSettings: configtls.ClientConfig{ Insecure: true, }, ResourceAttributes: openshift.CreateDefaultConfig().ResourceAttributes, diff --git a/processor/resourcedetectionprocessor/internal/openshift/config.go b/processor/resourcedetectionprocessor/internal/openshift/config.go index 57e9a0c56b53e..408bcc7609840 100644 --- a/processor/resourcedetectionprocessor/internal/openshift/config.go +++ b/processor/resourcedetectionprocessor/internal/openshift/config.go @@ -48,7 +48,7 @@ type Config struct { // TLSSettings contains TLS configurations that are specific to client // connection used to communicate with the Openshift API. - TLSSettings configtls.TLSClientSetting `mapstructure:"tls"` + TLSSettings configtls.ClientConfig `mapstructure:"tls"` ResourceAttributes metadata.ResourceAttributesConfig `mapstructure:"resource_attributes"` } diff --git a/receiver/aerospikereceiver/config.go b/receiver/aerospikereceiver/config.go index 1e8040226f2bd..bfdfa157b64dd 100644 --- a/receiver/aerospikereceiver/config.go +++ b/receiver/aerospikereceiver/config.go @@ -39,7 +39,7 @@ type Config struct { CollectClusterMetrics bool `mapstructure:"collect_cluster_metrics"` Timeout time.Duration `mapstructure:"timeout"` MetricsBuilderConfig metadata.MetricsBuilderConfig `mapstructure:",squash"` - TLS *configtls.TLSClientSetting `mapstructure:"tls,omitempty"` + TLS *configtls.ClientConfig `mapstructure:"tls,omitempty"` } // Validate validates the values of the given Config, and returns an error if validation fails diff --git a/receiver/aerospikereceiver/config_test.go b/receiver/aerospikereceiver/config_test.go index 9df9bdb4262ba..cc3e2a708b2a0 100644 --- a/receiver/aerospikereceiver/config_test.go +++ b/receiver/aerospikereceiver/config_test.go @@ -104,9 +104,9 @@ func TestValidate(t *testing.T) { config: &Config{ Endpoint: "localhost:3000", TLSName: "tls1", - TLS: &configtls.TLSClientSetting{ + TLS: &configtls.ClientConfig{ Insecure: false, - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.Config{ CAFile: "BADCAFILE", }, }, @@ -119,9 +119,9 @@ func TestValidate(t *testing.T) { config: &Config{ Endpoint: "localhost:3000", TLSName: "", - TLS: &configtls.TLSClientSetting{ + TLS: &configtls.ClientConfig{ Insecure: false, - TLSSetting: configtls.TLSSetting{}, + TLSSetting: configtls.Config{}, }, ScraperControllerSettings: scraperhelper.NewDefaultScraperControllerSettings(metadata.Type), }, diff --git a/receiver/apachereceiver/scraper_test.go b/receiver/apachereceiver/scraper_test.go index ab17716b64f50..0a021c473c022 100644 --- a/receiver/apachereceiver/scraper_test.go +++ b/receiver/apachereceiver/scraper_test.go @@ -58,8 +58,8 @@ func TestScraperFailedStart(t *testing.T) { sc := newApacheScraper(receivertest.NewNopCreateSettings(), &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: "localhost:8080", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, diff --git a/receiver/awsfirehosereceiver/config_test.go b/receiver/awsfirehosereceiver/config_test.go index 2963f517bc164..951330deb3498 100644 --- a/receiver/awsfirehosereceiver/config_test.go +++ b/receiver/awsfirehosereceiver/config_test.go @@ -35,8 +35,8 @@ func TestLoadConfig(t *testing.T) { AccessKey: "some_access_key", ServerConfig: confighttp.ServerConfig{ Endpoint: "0.0.0.0:4433", - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "server.crt", KeyFile: "server.key", }, diff --git a/receiver/awsxrayreceiver/config_test.go b/receiver/awsxrayreceiver/config_test.go index c1e6c64e08fa8..caef308eef437 100644 --- a/receiver/awsxrayreceiver/config_test.go +++ b/receiver/awsxrayreceiver/config_test.go @@ -44,7 +44,7 @@ func TestLoadConfig(t *testing.T) { Endpoint: "0.0.0.0:2000", }, ProxyAddress: "", - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: false, ServerName: "", }, @@ -67,7 +67,7 @@ func TestLoadConfig(t *testing.T) { Endpoint: "0.0.0.0:1234", }, ProxyAddress: "https://proxy.proxy.com", - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, ServerName: "something", }, diff --git a/receiver/bigipreceiver/client_test.go b/receiver/bigipreceiver/client_test.go index 21a117de939a5..74ddbe971dfdf 100644 --- a/receiver/bigipreceiver/client_test.go +++ b/receiver/bigipreceiver/client_test.go @@ -50,8 +50,8 @@ func TestNewClient(t *testing.T) { cfg: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: defaultEndpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, @@ -66,7 +66,7 @@ func TestNewClient(t *testing.T) { desc: "Valid Configuration", cfg: &Config{ ClientConfig: confighttp.ClientConfig{ - TLSSetting: configtls.TLSClientSetting{}, + TLSSetting: configtls.ClientConfig{}, Endpoint: defaultEndpoint, }, }, diff --git a/receiver/bigipreceiver/scraper_test.go b/receiver/bigipreceiver/scraper_test.go index 066a289c19beb..37f3c3f171d7e 100644 --- a/receiver/bigipreceiver/scraper_test.go +++ b/receiver/bigipreceiver/scraper_test.go @@ -38,8 +38,8 @@ func TestScraperStart(t *testing.T) { cfg: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: defaultEndpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, @@ -54,7 +54,7 @@ func TestScraperStart(t *testing.T) { scraper: &bigipScraper{ cfg: &Config{ ClientConfig: confighttp.ClientConfig{ - TLSSetting: configtls.TLSClientSetting{}, + TLSSetting: configtls.ClientConfig{}, Endpoint: defaultEndpoint, }, }, diff --git a/receiver/cloudflarereceiver/config.go b/receiver/cloudflarereceiver/config.go index a532da47419ce..59ef966c0d75c 100644 --- a/receiver/cloudflarereceiver/config.go +++ b/receiver/cloudflarereceiver/config.go @@ -18,11 +18,11 @@ type Config struct { } type LogsConfig struct { - Secret string `mapstructure:"secret"` - Endpoint string `mapstructure:"endpoint"` - TLS *configtls.TLSServerSetting `mapstructure:"tls"` - Attributes map[string]string `mapstructure:"attributes"` - TimestampField string `mapstructure:"timestamp_field"` + Secret string `mapstructure:"secret"` + Endpoint string `mapstructure:"endpoint"` + TLS *configtls.ServerConfig `mapstructure:"tls"` + Attributes map[string]string `mapstructure:"attributes"` + TimestampField string `mapstructure:"timestamp_field"` } var ( diff --git a/receiver/cloudflarereceiver/config_test.go b/receiver/cloudflarereceiver/config_test.go index b5335f7181fab..e541cf92db01e 100644 --- a/receiver/cloudflarereceiver/config_test.go +++ b/receiver/cloudflarereceiver/config_test.go @@ -34,8 +34,8 @@ func TestValidate(t *testing.T) { config: Config{ Logs: LogsConfig{ Endpoint: "0.0.0.0:9999", - TLS: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "some_cert_file", KeyFile: "some_key_file", }, @@ -64,8 +64,8 @@ func TestValidate(t *testing.T) { config: Config{ Logs: LogsConfig{ Endpoint: "0.0.0.0:9999", - TLS: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "some_cert_file", }, }, @@ -78,8 +78,8 @@ func TestValidate(t *testing.T) { config: Config{ Logs: LogsConfig{ Endpoint: "0.0.0.0:9999", - TLS: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ KeyFile: "some_key_file", }, }, @@ -114,8 +114,8 @@ func TestLoadConfig(t *testing.T) { expectedConfig: &Config{ Logs: LogsConfig{ Endpoint: "0.0.0.0:12345", - TLS: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "some_cert_file", KeyFile: "some_key_file", }, diff --git a/receiver/cloudflarereceiver/logs_integration_test.go b/receiver/cloudflarereceiver/logs_integration_test.go index bf95f031f4fda..6a16bf2b3afdd 100644 --- a/receiver/cloudflarereceiver/logs_integration_test.go +++ b/receiver/cloudflarereceiver/logs_integration_test.go @@ -56,8 +56,8 @@ func TestReceiverTLS(t *testing.T) { Logs: LogsConfig{ Secret: testSecret, Endpoint: testAddr, - TLS: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: filepath.Join("testdata", "cert", "server.crt"), KeyFile: filepath.Join("testdata", "cert", "server.key"), }, diff --git a/receiver/cloudflarereceiver/logs_test.go b/receiver/cloudflarereceiver/logs_test.go index 6a0ac738da63e..9df7c91376bd6 100644 --- a/receiver/cloudflarereceiver/logs_test.go +++ b/receiver/cloudflarereceiver/logs_test.go @@ -115,7 +115,7 @@ func TestPayloadToLogRecord(t *testing.T) { recv := newReceiver(t, &Config{ Logs: LogsConfig{ Endpoint: "localhost:0", - TLS: &configtls.TLSServerSetting{}, + TLS: &configtls.ServerConfig{}, TimestampField: "EdgeStartTimestamp", Attributes: map[string]string{ "ClientIP": "http_request.client_ip", @@ -310,7 +310,7 @@ func TestHandleRequest(t *testing.T) { Attributes: map[string]string{ "ClientIP": "http_request.client_ip", }, - TLS: &configtls.TLSServerSetting{}, + TLS: &configtls.ServerConfig{}, }, }, consumer, diff --git a/receiver/cloudfoundryreceiver/config_test.go b/receiver/cloudfoundryreceiver/config_test.go index b8083f1da0232..110d0d95a6b36 100644 --- a/receiver/cloudfoundryreceiver/config_test.go +++ b/receiver/cloudfoundryreceiver/config_test.go @@ -36,7 +36,7 @@ func TestLoadConfig(t *testing.T) { RLPGateway: RLPGatewayConfig{ ClientConfig: confighttp.ClientConfig{ Endpoint: "https://log-stream.sys.example.internal", - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ InsecureSkipVerify: true, }, Timeout: time.Second * 20, @@ -106,7 +106,7 @@ func TestHTTPConfigurationStructConsistency(t *testing.T) { // library does not support. checkTypeFieldMatch(t, "Endpoint", reflect.TypeOf(LimitedClientConfig{}), reflect.TypeOf(confighttp.ClientConfig{})) checkTypeFieldMatch(t, "TLSSetting", reflect.TypeOf(LimitedClientConfig{}), reflect.TypeOf(confighttp.ClientConfig{})) - checkTypeFieldMatch(t, "InsecureSkipVerify", reflect.TypeOf(LimitedTLSClientSetting{}), reflect.TypeOf(configtls.TLSClientSetting{})) + checkTypeFieldMatch(t, "InsecureSkipVerify", reflect.TypeOf(LimitedTLSClientSetting{}), reflect.TypeOf(configtls.ClientConfig{})) } func loadSuccessfulConfig(t *testing.T) *Config { @@ -115,7 +115,7 @@ func loadSuccessfulConfig(t *testing.T) *Config { ClientConfig: confighttp.ClientConfig{ Endpoint: "https://log-stream.sys.example.internal", Timeout: time.Second * 20, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ InsecureSkipVerify: true, }, }, diff --git a/receiver/cloudfoundryreceiver/factory.go b/receiver/cloudfoundryreceiver/factory.go index 38ae50a0c76fd..9ce95b4495f51 100644 --- a/receiver/cloudfoundryreceiver/factory.go +++ b/receiver/cloudfoundryreceiver/factory.go @@ -36,7 +36,7 @@ func createDefaultConfig() component.Config { RLPGateway: RLPGatewayConfig{ ClientConfig: confighttp.ClientConfig{ Endpoint: defaultURL, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ InsecureSkipVerify: false, }, }, diff --git a/receiver/couchdbreceiver/client_test.go b/receiver/couchdbreceiver/client_test.go index 803eec0603ef8..15b351102d5d8 100644 --- a/receiver/couchdbreceiver/client_test.go +++ b/receiver/couchdbreceiver/client_test.go @@ -35,8 +35,8 @@ func TestNewCouchDBClient(t *testing.T) { &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: defaultEndpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, diff --git a/receiver/couchdbreceiver/factory.go b/receiver/couchdbreceiver/factory.go index baeebf8359d05..ad04701e2e3ce 100644 --- a/receiver/couchdbreceiver/factory.go +++ b/receiver/couchdbreceiver/factory.go @@ -30,7 +30,7 @@ func createDefaultConfig() component.Config { MetricsBuilderConfig: metadata.DefaultMetricsBuilderConfig(), ScraperControllerSettings: scraperhelper.NewDefaultScraperControllerSettings(metadata.Type), ClientConfig: confighttp.ClientConfig{ - TLSSetting: configtls.TLSClientSetting{}, + TLSSetting: configtls.ClientConfig{}, Endpoint: defaultEndpoint, Timeout: 1 * time.Minute, }, diff --git a/receiver/elasticsearchreceiver/scraper_test.go b/receiver/elasticsearchreceiver/scraper_test.go index 74cad46a44402..6fc74abc73f50 100644 --- a/receiver/elasticsearchreceiver/scraper_test.go +++ b/receiver/elasticsearchreceiver/scraper_test.go @@ -211,8 +211,8 @@ func TestScraperFailedStart(t *testing.T) { conf.ClientConfig = confighttp.ClientConfig{ Endpoint: "localhost:9200", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, diff --git a/receiver/flinkmetricsreceiver/client_test.go b/receiver/flinkmetricsreceiver/client_test.go index 8cb23c2c4c1f1..86fcfcbc4b35a 100644 --- a/receiver/flinkmetricsreceiver/client_test.go +++ b/receiver/flinkmetricsreceiver/client_test.go @@ -60,8 +60,8 @@ func TestNewClient(t *testing.T) { cfg: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: defaultEndpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, @@ -76,7 +76,7 @@ func TestNewClient(t *testing.T) { desc: "Valid Configuration", cfg: &Config{ ClientConfig: confighttp.ClientConfig{ - TLSSetting: configtls.TLSClientSetting{}, + TLSSetting: configtls.ClientConfig{}, Endpoint: defaultEndpoint, }, }, diff --git a/receiver/flinkmetricsreceiver/scraper_test.go b/receiver/flinkmetricsreceiver/scraper_test.go index ab02aa118d984..fb45281a8a484 100644 --- a/receiver/flinkmetricsreceiver/scraper_test.go +++ b/receiver/flinkmetricsreceiver/scraper_test.go @@ -44,8 +44,8 @@ func TestScraperStart(t *testing.T) { cfg: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: defaultEndpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, @@ -60,7 +60,7 @@ func TestScraperStart(t *testing.T) { scraper: &flinkmetricsScraper{ cfg: &Config{ ClientConfig: confighttp.ClientConfig{ - TLSSetting: configtls.TLSClientSetting{}, + TLSSetting: configtls.ClientConfig{}, Endpoint: defaultEndpoint, }, }, diff --git a/receiver/httpcheckreceiver/scraper_test.go b/receiver/httpcheckreceiver/scraper_test.go index ef0244b98c554..0ceb0df9440e3 100644 --- a/receiver/httpcheckreceiver/scraper_test.go +++ b/receiver/httpcheckreceiver/scraper_test.go @@ -45,8 +45,8 @@ func TestScraperStart(t *testing.T) { { ClientConfig: confighttp.ClientConfig{ Endpoint: "http://example.com", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, @@ -65,7 +65,7 @@ func TestScraperStart(t *testing.T) { Targets: []*targetConfig{ { ClientConfig: confighttp.ClientConfig{ - TLSSetting: configtls.TLSClientSetting{}, + TLSSetting: configtls.ClientConfig{}, Endpoint: "http://example.com", }, }, diff --git a/receiver/jaegerreceiver/config_test.go b/receiver/jaegerreceiver/config_test.go index 39400a80538de..97999b6812b18 100644 --- a/receiver/jaegerreceiver/config_test.go +++ b/receiver/jaegerreceiver/config_test.go @@ -113,8 +113,8 @@ func TestLoadConfig(t *testing.T) { Endpoint: "localhost:9876", Transport: confignet.TransportTypeTCP, }, - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "/test.crt", KeyFile: "/test.key", }, diff --git a/receiver/jaegerreceiver/factory_test.go b/receiver/jaegerreceiver/factory_test.go index 084bf2865cb22..92c45a910c100 100644 --- a/receiver/jaegerreceiver/factory_test.go +++ b/receiver/jaegerreceiver/factory_test.go @@ -102,8 +102,8 @@ func TestCreateTLSGPRCEndpoint(t *testing.T) { Endpoint: "0.0.0.0:14250", Transport: confignet.TransportTypeTCP, }, - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "./testdata/server.crt", KeyFile: "./testdata/server.key", }, @@ -121,8 +121,8 @@ func TestCreateTLSThriftHTTPEndpoint(t *testing.T) { cfg.(*Config).Protocols.ThriftHTTP = &confighttp.ServerConfig{ Endpoint: "0.0.0.0:14268", - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "./testdata/server.crt", KeyFile: "./testdata/server.key", }, diff --git a/receiver/jaegerreceiver/trace_receiver_test.go b/receiver/jaegerreceiver/trace_receiver_test.go index d7eeaf522cae3..50de4cb2d787e 100644 --- a/receiver/jaegerreceiver/trace_receiver_test.go +++ b/receiver/jaegerreceiver/trace_receiver_test.go @@ -188,8 +188,8 @@ func TestGRPCReception(t *testing.T) { func TestGRPCReceptionWithTLS(t *testing.T) { // prepare - tlsCreds := &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + tlsCreds := &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: filepath.Join("testdata", "server.crt"), KeyFile: filepath.Join("testdata", "server.key"), }, diff --git a/receiver/kafkametricsreceiver/config_test.go b/receiver/kafkametricsreceiver/config_test.go index 4751b3a9a35b2..8c25669a1c53e 100644 --- a/receiver/kafkametricsreceiver/config_test.go +++ b/receiver/kafkametricsreceiver/config_test.go @@ -35,8 +35,8 @@ func TestLoadConfig(t *testing.T) { TopicMatch: "test_\\w+", GroupMatch: "test_\\w+", Authentication: kafka.Authentication{ - TLS: &configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "ca.pem", CertFile: "cert.pem", KeyFile: "key.pem", diff --git a/receiver/kafkametricsreceiver/receiver_test.go b/receiver/kafkametricsreceiver/receiver_test.go index 5a8ac97222c6d..27564342ad769 100644 --- a/receiver/kafkametricsreceiver/receiver_test.go +++ b/receiver/kafkametricsreceiver/receiver_test.go @@ -46,8 +46,8 @@ func TestNewReceiver_invalid_scraper_error(t *testing.T) { func TestNewReceiver_invalid_auth_error(t *testing.T) { c := createDefaultConfig().(*Config) c.Authentication = kafka.Authentication{ - TLS: &configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/invalid", }, }, diff --git a/receiver/kafkareceiver/config_test.go b/receiver/kafkareceiver/config_test.go index c59f70d92e74b..bc0d8d4974d58 100644 --- a/receiver/kafkareceiver/config_test.go +++ b/receiver/kafkareceiver/config_test.go @@ -41,8 +41,8 @@ func TestLoadConfig(t *testing.T) { GroupID: "otel-collector", InitialOffset: "latest", Authentication: kafka.Authentication{ - TLS: &configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "ca.pem", CertFile: "cert.pem", KeyFile: "key.pem", @@ -73,8 +73,8 @@ func TestLoadConfig(t *testing.T) { GroupID: "otel-collector", InitialOffset: "earliest", Authentication: kafka.Authentication{ - TLS: &configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "ca.pem", CertFile: "cert.pem", KeyFile: "key.pem", diff --git a/receiver/kafkareceiver/kafka_receiver_test.go b/receiver/kafkareceiver/kafka_receiver_test.go index ca4b5f544dc10..25d4dcaa4bcae 100644 --- a/receiver/kafkareceiver/kafka_receiver_test.go +++ b/receiver/kafkareceiver/kafka_receiver_test.go @@ -59,8 +59,8 @@ func TestNewTracesReceiver_err_auth_type(t *testing.T) { c := Config{ ProtocolVersion: "2.0.0", Authentication: kafka.Authentication{ - TLS: &configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/doesnotexist", }, }, @@ -325,8 +325,8 @@ func TestNewMetricsExporter_err_auth_type(t *testing.T) { c := Config{ ProtocolVersion: "2.0.0", Authentication: kafka.Authentication{ - TLS: &configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/doesnotexist", }, }, @@ -580,8 +580,8 @@ func TestNewLogsExporter_err_auth_type(t *testing.T) { c := Config{ ProtocolVersion: "2.0.0", Authentication: kafka.Authentication{ - TLS: &configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/doesnotexist", }, }, diff --git a/receiver/kubeletstatsreceiver/config_test.go b/receiver/kubeletstatsreceiver/config_test.go index fe5f055413e11..7ec0c97bb2b66 100644 --- a/receiver/kubeletstatsreceiver/config_test.go +++ b/receiver/kubeletstatsreceiver/config_test.go @@ -69,7 +69,7 @@ func TestLoadConfig(t *testing.T) { APIConfig: k8sconfig.APIConfig{ AuthType: "tls", }, - TLSSetting: configtls.TLSSetting{ + Config: configtls.Config{ CAFile: "/path/to/ca.crt", CertFile: "/path/to/apiserver.crt", KeyFile: "/path/to/apiserver.key", diff --git a/receiver/kubeletstatsreceiver/factory_test.go b/receiver/kubeletstatsreceiver/factory_test.go index 1bc8b23ce4ef5..715c2c7c42314 100644 --- a/receiver/kubeletstatsreceiver/factory_test.go +++ b/receiver/kubeletstatsreceiver/factory_test.go @@ -121,7 +121,7 @@ func tlsConfig() *Config { APIConfig: k8sconfig.APIConfig{ AuthType: "tls", }, - TLSSetting: configtls.TLSSetting{ + Config: configtls.Config{ CAFile: "testdata/testcert.crt", CertFile: "testdata/testcert.crt", KeyFile: "testdata/testkey.key", diff --git a/receiver/mongodbatlasreceiver/alerts.go b/receiver/mongodbatlasreceiver/alerts.go index a1fd7b6978858..1aae71729e596 100644 --- a/receiver/mongodbatlasreceiver/alerts.go +++ b/receiver/mongodbatlasreceiver/alerts.go @@ -63,7 +63,7 @@ type alertsReceiver struct { secret string server *http.Server mode string - tlsSettings *configtls.TLSServerSetting + tlsSettings *configtls.ServerConfig consumer consumer.Logs wg *sync.WaitGroup diff --git a/receiver/mongodbatlasreceiver/alerts_integration_test.go b/receiver/mongodbatlasreceiver/alerts_integration_test.go index b884fd94468f2..e5bb9a4247420 100644 --- a/receiver/mongodbatlasreceiver/alerts_integration_test.go +++ b/receiver/mongodbatlasreceiver/alerts_integration_test.go @@ -128,8 +128,8 @@ func TestAlertsReceiverTLS(t *testing.T) { Secret: testSecret, Mode: alertModeListen, Endpoint: testAddr, - TLS: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: filepath.Join("testdata", "alerts", "cert", "server.crt"), KeyFile: filepath.Join("testdata", "alerts", "cert", "server.key"), }, diff --git a/receiver/mongodbatlasreceiver/config.go b/receiver/mongodbatlasreceiver/config.go index aebe2cd869356..d57ca108e57e5 100644 --- a/receiver/mongodbatlasreceiver/config.go +++ b/receiver/mongodbatlasreceiver/config.go @@ -37,11 +37,11 @@ type Config struct { } type AlertConfig struct { - Enabled bool `mapstructure:"enabled"` - Endpoint string `mapstructure:"endpoint"` - Secret configopaque.String `mapstructure:"secret"` - TLS *configtls.TLSServerSetting `mapstructure:"tls"` - Mode string `mapstructure:"mode"` + Enabled bool `mapstructure:"enabled"` + Endpoint string `mapstructure:"endpoint"` + Secret configopaque.String `mapstructure:"secret"` + TLS *configtls.ServerConfig `mapstructure:"tls"` + Mode string `mapstructure:"mode"` // these parameters are only relevant in retrieval mode Projects []*ProjectConfig `mapstructure:"projects"` diff --git a/receiver/mongodbatlasreceiver/config_test.go b/receiver/mongodbatlasreceiver/config_test.go index 183d582900530..3a74b09418bb0 100644 --- a/receiver/mongodbatlasreceiver/config_test.go +++ b/receiver/mongodbatlasreceiver/config_test.go @@ -88,8 +88,8 @@ func TestValidate(t *testing.T) { Endpoint: "0.0.0.0:7706", Secret: "some_secret", Mode: alertModeListen, - TLS: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "some_cert_file", }, }, @@ -106,8 +106,8 @@ func TestValidate(t *testing.T) { Endpoint: "0.0.0.0:7706", Secret: "some_secret", Mode: alertModeListen, - TLS: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLS: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ KeyFile: "some_key_file", }, }, diff --git a/receiver/mongodbatlasreceiver/factory_test.go b/receiver/mongodbatlasreceiver/factory_test.go index 7bf3d01c60768..f8f2d52ccf538 100644 --- a/receiver/mongodbatlasreceiver/factory_test.go +++ b/receiver/mongodbatlasreceiver/factory_test.go @@ -29,7 +29,7 @@ func TestBadAlertsReceiver(t *testing.T) { cfg := conf.(*Config) cfg.Alerts.Enabled = true - cfg.Alerts.TLS = &configtls.TLSServerSetting{ + cfg.Alerts.TLS = &configtls.ServerConfig{ ClientCAFile: "/not/a/file", } params := receivertest.NewNopCreateSettings() diff --git a/receiver/mongodbreceiver/config.go b/receiver/mongodbreceiver/config.go index 73f6f86e3cf72..f0ed51ea51ce6 100644 --- a/receiver/mongodbreceiver/config.go +++ b/receiver/mongodbreceiver/config.go @@ -21,7 +21,7 @@ import ( type Config struct { scraperhelper.ScraperControllerSettings `mapstructure:",squash"` - configtls.TLSClientSetting `mapstructure:"tls,omitempty"` + configtls.ClientConfig `mapstructure:"tls,omitempty"` // MetricsBuilderConfig defines which metrics/attributes to enable for the scraper metadata.MetricsBuilderConfig `mapstructure:",squash"` Hosts []confignet.AddrConfig `mapstructure:"hosts"` diff --git a/receiver/mongodbreceiver/config_test.go b/receiver/mongodbreceiver/config_test.go index c9c2121e29e48..d522bf343d6bc 100644 --- a/receiver/mongodbreceiver/config_test.go +++ b/receiver/mongodbreceiver/config_test.go @@ -104,13 +104,13 @@ func TestValidate(t *testing.T) { func TestBadTLSConfigs(t *testing.T) { testCases := []struct { desc string - tlsConfig configtls.TLSClientSetting + tlsConfig configtls.ClientConfig expectError bool }{ { desc: "CA file not found", - tlsConfig: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + tlsConfig: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "not/a/real/file.pem", }, Insecure: false, @@ -121,8 +121,8 @@ func TestBadTLSConfigs(t *testing.T) { }, { desc: "no issues", - tlsConfig: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{}, + tlsConfig: configtls.ClientConfig{ + TLSSetting: configtls.Config{}, Insecure: false, InsecureSkipVerify: false, ServerName: "", @@ -142,7 +142,7 @@ func TestBadTLSConfigs(t *testing.T) { }, }, ScraperControllerSettings: scraperhelper.NewDefaultScraperControllerSettings(metadata.Type), - TLSClientSetting: tc.tlsConfig, + ClientConfig: tc.tlsConfig, } err := component.ValidateConfig(cfg) if tc.expectError { @@ -186,9 +186,9 @@ func TestOptionsTLS(t *testing.T) { Endpoint: "localhost:27017", }, }, - TLSClientSetting: configtls.TLSClientSetting{ + ClientConfig: configtls.ClientConfig{ Insecure: false, - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.Config{ CAFile: caFile, }, }, diff --git a/receiver/mongodbreceiver/factory.go b/receiver/mongodbreceiver/factory.go index b4823b018d26a..e87c7c75737a1 100644 --- a/receiver/mongodbreceiver/factory.go +++ b/receiver/mongodbreceiver/factory.go @@ -36,7 +36,7 @@ func createDefaultConfig() component.Config { }, }, MetricsBuilderConfig: metadata.DefaultMetricsBuilderConfig(), - TLSClientSetting: configtls.TLSClientSetting{}, + ClientConfig: configtls.ClientConfig{}, } } diff --git a/receiver/mysqlreceiver/config.go b/receiver/mysqlreceiver/config.go index 337891bfee152..9fa92155db1d9 100644 --- a/receiver/mysqlreceiver/config.go +++ b/receiver/mysqlreceiver/config.go @@ -28,7 +28,7 @@ type Config struct { Database string `mapstructure:"database,omitempty"` AllowNativePasswords bool `mapstructure:"allow_native_passwords,omitempty"` confignet.AddrConfig `mapstructure:",squash"` - TLS configtls.TLSClientSetting `mapstructure:"tls,omitempty"` + TLS configtls.ClientConfig `mapstructure:"tls,omitempty"` MetricsBuilderConfig metadata.MetricsBuilderConfig `mapstructure:",squash"` StatementEvents StatementEventsConfig `mapstructure:"statement_events"` } @@ -48,7 +48,7 @@ func (cfg *Config) Unmarshal(componentParser *confmap.Conf) error { // Change the default to Insecure = true as we don't want to break // existing deployments which does not use TLS by default. if !componentParser.IsSet("tls") { - cfg.TLS = configtls.TLSClientSetting{} + cfg.TLS = configtls.ClientConfig{} cfg.TLS.Insecure = true } diff --git a/receiver/nginxreceiver/scraper_test.go b/receiver/nginxreceiver/scraper_test.go index 3d4f76110abff..00c3915525701 100644 --- a/receiver/nginxreceiver/scraper_test.go +++ b/receiver/nginxreceiver/scraper_test.go @@ -85,8 +85,8 @@ func TestScraperFailedStart(t *testing.T) { sc := newNginxScraper(receivertest.NewNopCreateSettings(), &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: "localhost:8080", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, diff --git a/receiver/opencensusreceiver/config_test.go b/receiver/opencensusreceiver/config_test.go index 8e385f12bc34c..e8af7f5099687 100644 --- a/receiver/opencensusreceiver/config_test.go +++ b/receiver/opencensusreceiver/config_test.go @@ -95,8 +95,8 @@ func TestLoadConfig(t *testing.T) { Transport: confignet.TransportTypeTCP, }, ReadBufferSize: 512 * 1024, - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "test.crt", KeyFile: "test.key", }, diff --git a/receiver/opencensusreceiver/opencensus_test.go b/receiver/opencensusreceiver/opencensus_test.go index 1846baae582ac..8d2460a5cc0af 100644 --- a/receiver/opencensusreceiver/opencensus_test.go +++ b/receiver/opencensusreceiver/opencensus_test.go @@ -602,8 +602,8 @@ func TestOCReceiverMetrics_HandleNextConsumerResponse(t *testing.T) { func TestInvalidTLSCredentials(t *testing.T) { cfg := Config{ ServerConfig: configgrpc.ServerConfig{ - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "willfail", }, }, diff --git a/receiver/otelarrowreceiver/config_test.go b/receiver/otelarrowreceiver/config_test.go index f52ffc980e42b..43d8316de8bbf 100644 --- a/receiver/otelarrowreceiver/config_test.go +++ b/receiver/otelarrowreceiver/config_test.go @@ -53,8 +53,8 @@ func TestUnmarshalConfig(t *testing.T) { Endpoint: "0.0.0.0:4317", Transport: confignet.TransportTypeTCP, }, - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "test.crt", KeyFile: "test.key", }, diff --git a/receiver/postgresqlreceiver/client.go b/receiver/postgresqlreceiver/client.go index 1a9e47badff1d..160b943e0cc0d 100644 --- a/receiver/postgresqlreceiver/client.go +++ b/receiver/postgresqlreceiver/client.go @@ -70,10 +70,10 @@ type postgreSQLConfig struct { password string database string address confignet.AddrConfig - tls configtls.TLSClientSetting + tls configtls.ClientConfig } -func sslConnectionString(tls configtls.TLSClientSetting) string { +func sslConnectionString(tls configtls.ClientConfig) string { if tls.Insecure { return "sslmode='disable'" } diff --git a/receiver/postgresqlreceiver/client_factory.go b/receiver/postgresqlreceiver/client_factory.go index da332a660b703..c940bf2ba7235 100644 --- a/receiver/postgresqlreceiver/client_factory.go +++ b/receiver/postgresqlreceiver/client_factory.go @@ -40,7 +40,7 @@ func newDefaultClientFactory(cfg *Config) *defaultClientFactory { username: cfg.Username, password: string(cfg.Password), address: cfg.AddrConfig, - tls: cfg.TLSClientSetting, + tls: cfg.ClientConfig, }, } } @@ -73,7 +73,7 @@ func newPoolClientFactory(cfg *Config) *poolClientFactory { username: cfg.Username, password: string(cfg.Password), address: cfg.AddrConfig, - tls: cfg.TLSClientSetting, + tls: cfg.ClientConfig, }, poolConfig: &poolCfg, pool: make(map[string]*sql.DB), diff --git a/receiver/postgresqlreceiver/config.go b/receiver/postgresqlreceiver/config.go index 1d1d425a18f49..735b4689f7256 100644 --- a/receiver/postgresqlreceiver/config.go +++ b/receiver/postgresqlreceiver/config.go @@ -34,7 +34,7 @@ type Config struct { Databases []string `mapstructure:"databases"` ExcludeDatabases []string `mapstructure:"exclude_databases"` confignet.AddrConfig `mapstructure:",squash"` // provides Endpoint and Transport - configtls.TLSClientSetting `mapstructure:"tls,omitempty"` // provides SSL details + configtls.ClientConfig `mapstructure:"tls,omitempty"` // provides SSL details ConnectionPool `mapstructure:"connection_pool,omitempty"` metadata.MetricsBuilderConfig `mapstructure:",squash"` } diff --git a/receiver/postgresqlreceiver/config_test.go b/receiver/postgresqlreceiver/config_test.go index bb9a57f9095fb..d93a92b60d745 100644 --- a/receiver/postgresqlreceiver/config_test.go +++ b/receiver/postgresqlreceiver/config_test.go @@ -160,10 +160,10 @@ func TestLoadConfig(t *testing.T) { expected.Databases = []string{"otel"} expected.ExcludeDatabases = []string{"template0"} expected.CollectionInterval = 10 * time.Second - expected.TLSClientSetting = configtls.TLSClientSetting{ + expected.ClientConfig = configtls.ClientConfig{ Insecure: false, InsecureSkipVerify: false, - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.Config{ CAFile: "/home/otel/authorities.crt", CertFile: "/home/otel/mypostgrescert.crt", KeyFile: "/home/otel/mypostgreskey.key", diff --git a/receiver/postgresqlreceiver/factory.go b/receiver/postgresqlreceiver/factory.go index 7aca869a6dc50..5bb27db6f001d 100644 --- a/receiver/postgresqlreceiver/factory.go +++ b/receiver/postgresqlreceiver/factory.go @@ -34,7 +34,7 @@ func createDefaultConfig() component.Config { Endpoint: "localhost:5432", Transport: confignet.TransportTypeTCP, }, - TLSClientSetting: configtls.TLSClientSetting{ + ClientConfig: configtls.ClientConfig{ Insecure: false, InsecureSkipVerify: true, }, diff --git a/receiver/rabbitmqreceiver/client_test.go b/receiver/rabbitmqreceiver/client_test.go index f6427bb3a3fe7..113b4bbda05f4 100644 --- a/receiver/rabbitmqreceiver/client_test.go +++ b/receiver/rabbitmqreceiver/client_test.go @@ -41,8 +41,8 @@ func TestNewClient(t *testing.T) { cfg: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: defaultEndpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, @@ -57,7 +57,7 @@ func TestNewClient(t *testing.T) { desc: "Valid Configuration", cfg: &Config{ ClientConfig: confighttp.ClientConfig{ - TLSSetting: configtls.TLSClientSetting{}, + TLSSetting: configtls.ClientConfig{}, Endpoint: defaultEndpoint, }, }, diff --git a/receiver/rabbitmqreceiver/scraper_test.go b/receiver/rabbitmqreceiver/scraper_test.go index 527c9d15f53ce..bcb64e7e7c567 100644 --- a/receiver/rabbitmqreceiver/scraper_test.go +++ b/receiver/rabbitmqreceiver/scraper_test.go @@ -37,8 +37,8 @@ func TestScraperStart(t *testing.T) { cfg: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: defaultEndpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, @@ -53,7 +53,7 @@ func TestScraperStart(t *testing.T) { scraper: &rabbitmqScraper{ cfg: &Config{ ClientConfig: confighttp.ClientConfig{ - TLSSetting: configtls.TLSClientSetting{}, + TLSSetting: configtls.ClientConfig{}, Endpoint: defaultEndpoint, }, }, diff --git a/receiver/redisreceiver/config.go b/receiver/redisreceiver/config.go index 7a932efc2aad1..097f5f6feb160 100644 --- a/receiver/redisreceiver/config.go +++ b/receiver/redisreceiver/config.go @@ -33,7 +33,7 @@ type Config struct { // to a Redis 6.0 instance, or greater, that is using the Redis ACL system. Password configopaque.String `mapstructure:"password"` - TLS configtls.TLSClientSetting `mapstructure:"tls,omitempty"` + TLS configtls.ClientConfig `mapstructure:"tls,omitempty"` MetricsBuilderConfig metadata.MetricsBuilderConfig `mapstructure:",squash"` } diff --git a/receiver/redisreceiver/config_test.go b/receiver/redisreceiver/config_test.go index 5b404aefc1e06..02882112efdd9 100644 --- a/receiver/redisreceiver/config_test.go +++ b/receiver/redisreceiver/config_test.go @@ -35,7 +35,7 @@ func TestConfig(t *testing.T) { Endpoint: "localhost:6379", Transport: confignet.TransportTypeTCP, }, - TLS: configtls.TLSClientSetting{ + TLS: configtls.ClientConfig{ Insecure: true, }, Username: "test", diff --git a/receiver/redisreceiver/factory.go b/receiver/redisreceiver/factory.go index 87864aa7c8af6..19196ccd671bb 100644 --- a/receiver/redisreceiver/factory.go +++ b/receiver/redisreceiver/factory.go @@ -32,7 +32,7 @@ func createDefaultConfig() component.Config { AddrConfig: confignet.AddrConfig{ Transport: confignet.TransportTypeTCP, }, - TLS: configtls.TLSClientSetting{ + TLS: configtls.ClientConfig{ Insecure: true, }, ScraperControllerSettings: scs, diff --git a/receiver/redisreceiver/redis_scraper_test.go b/receiver/redisreceiver/redis_scraper_test.go index a7da4f803a681..b46a679f74bf8 100644 --- a/receiver/redisreceiver/redis_scraper_test.go +++ b/receiver/redisreceiver/redis_scraper_test.go @@ -45,8 +45,8 @@ func TestNewReceiver_invalid_endpoint(t *testing.T) { func TestNewReceiver_invalid_auth_error(t *testing.T) { c := createDefaultConfig().(*Config) - c.TLS = configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + c.TLS = configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/invalid", }, } diff --git a/receiver/riakreceiver/client_test.go b/receiver/riakreceiver/client_test.go index e9ebe738e6ac4..e1b0e57e1c003 100644 --- a/receiver/riakreceiver/client_test.go +++ b/receiver/riakreceiver/client_test.go @@ -37,8 +37,8 @@ func TestNewClient(t *testing.T) { cfg: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: defaultEndpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, @@ -50,7 +50,7 @@ func TestNewClient(t *testing.T) { desc: "Valid Configuration", cfg: &Config{ ClientConfig: confighttp.ClientConfig{ - TLSSetting: configtls.TLSClientSetting{}, + TLSSetting: configtls.ClientConfig{}, Endpoint: defaultEndpoint, }, }, diff --git a/receiver/riakreceiver/scraper_test.go b/receiver/riakreceiver/scraper_test.go index 87792b40d3457..24d39dd4ce079 100644 --- a/receiver/riakreceiver/scraper_test.go +++ b/receiver/riakreceiver/scraper_test.go @@ -38,8 +38,8 @@ func TestScraperStart(t *testing.T) { cfg: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: defaultEndpoint, - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "/non/existent", }, }, @@ -55,7 +55,7 @@ func TestScraperStart(t *testing.T) { scraper: &riakScraper{ cfg: &Config{ ClientConfig: confighttp.ClientConfig{ - TLSSetting: configtls.TLSClientSetting{}, + TLSSetting: configtls.ClientConfig{}, Endpoint: defaultEndpoint, }, }, diff --git a/receiver/saphanareceiver/client.go b/receiver/saphanareceiver/client.go index 2c725f23e47e8..0462fa0d1bfc2 100644 --- a/receiver/saphanareceiver/client.go +++ b/receiver/saphanareceiver/client.go @@ -107,7 +107,7 @@ func (c *sapHanaClient) Connect(ctx context.Context) error { return fmt.Errorf("error generating DSN for SAP HANA connection: %w", err) } - tls, err := c.receiverConfig.TLSClientSetting.LoadTLSConfig() + tls, err := c.receiverConfig.ClientConfig.LoadTLSConfig() if err != nil { return fmt.Errorf("error generating TLS config for SAP HANA connection: %w", err) } diff --git a/receiver/saphanareceiver/config.go b/receiver/saphanareceiver/config.go index 5d7a923ae18e6..14c15f4f9a0ba 100644 --- a/receiver/saphanareceiver/config.go +++ b/receiver/saphanareceiver/config.go @@ -24,7 +24,7 @@ const ( type Config struct { scraperhelper.ScraperControllerSettings `mapstructure:",squash"` confignet.TCPAddrConfig `mapstructure:",squash"` - configtls.TLSClientSetting `mapstructure:"tls,omitempty"` + configtls.ClientConfig `mapstructure:"tls,omitempty"` // MetricsBuilderConfig defines which metrics/attributes to enable for the scraper metadata.MetricsBuilderConfig `mapstructure:",squash"` diff --git a/receiver/saphanareceiver/factory.go b/receiver/saphanareceiver/factory.go index b9d3bd4bd8401..d9e3eb5200733 100644 --- a/receiver/saphanareceiver/factory.go +++ b/receiver/saphanareceiver/factory.go @@ -37,7 +37,7 @@ func createDefaultConfig() component.Config { TCPAddrConfig: confignet.TCPAddrConfig{ Endpoint: defaultEndpoint, }, - TLSClientSetting: configtls.TLSClientSetting{ + ClientConfig: configtls.ClientConfig{ Insecure: true, }, ScraperControllerSettings: scs, diff --git a/receiver/sapmreceiver/config_test.go b/receiver/sapmreceiver/config_test.go index 8dda68c3e374c..12793588a7b6b 100644 --- a/receiver/sapmreceiver/config_test.go +++ b/receiver/sapmreceiver/config_test.go @@ -45,8 +45,8 @@ func TestLoadConfig(t *testing.T) { expected: &Config{ ServerConfig: confighttp.ServerConfig{ Endpoint: "0.0.0.0:7276", - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "/test.crt", KeyFile: "/test.key", }, diff --git a/receiver/sapmreceiver/trace_receiver_test.go b/receiver/sapmreceiver/trace_receiver_test.go index 247c3c44274bc..2446b4f02676b 100644 --- a/receiver/sapmreceiver/trace_receiver_test.go +++ b/receiver/sapmreceiver/trace_receiver_test.go @@ -174,8 +174,8 @@ func sendSapm( client := &http.Client{} if tlsEnabled { - tlscs := configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + tlscs := configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "./testdata/ca.crt", CertFile: "./testdata/client.crt", KeyFile: "./testdata/client.key", @@ -310,8 +310,8 @@ func TestReception(t *testing.T) { config: &Config{ ServerConfig: confighttp.ServerConfig{ Endpoint: tlsAddress, - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CAFile: "./testdata/ca.crt", CertFile: "./testdata/server.crt", KeyFile: "./testdata/server.key", diff --git a/receiver/signalfxreceiver/config_test.go b/receiver/signalfxreceiver/config_test.go index e1d3f55cca043..1ae28b779f17a 100644 --- a/receiver/signalfxreceiver/config_test.go +++ b/receiver/signalfxreceiver/config_test.go @@ -48,8 +48,8 @@ func TestLoadConfig(t *testing.T) { expected: &Config{ ServerConfig: confighttp.ServerConfig{ Endpoint: "0.0.0.0:9943", - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "/test.crt", KeyFile: "/test.key", }, diff --git a/receiver/signalfxreceiver/receiver_test.go b/receiver/signalfxreceiver/receiver_test.go index 442c570f0a425..07004c0cdc6ba 100644 --- a/receiver/signalfxreceiver/receiver_test.go +++ b/receiver/signalfxreceiver/receiver_test.go @@ -616,8 +616,8 @@ func Test_sfxReceiver_TLS(t *testing.T) { addr := testutil.GetAvailableLocalAddress(t) cfg := createDefaultConfig().(*Config) cfg.Endpoint = addr - cfg.ServerConfig.TLSSetting = &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + cfg.ServerConfig.TLSSetting = &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "./testdata/server.crt", KeyFile: "./testdata/server.key", }, @@ -666,8 +666,8 @@ func Test_sfxReceiver_TLS(t *testing.T) { require.NoErrorf(t, err, "should have no errors with new request: %v", err) req.Header.Set("Content-Type", "application/x-protobuf") - tlscs := configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + tlscs := configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "./testdata/ca.crt", CertFile: "./testdata/client.crt", KeyFile: "./testdata/client.key", diff --git a/receiver/simpleprometheusreceiver/config_test.go b/receiver/simpleprometheusreceiver/config_test.go index 9e4f331323198..2e1190da56b45 100644 --- a/receiver/simpleprometheusreceiver/config_test.go +++ b/receiver/simpleprometheusreceiver/config_test.go @@ -38,8 +38,8 @@ func TestLoadConfig(t *testing.T) { expected: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: "localhost:1234", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "path", CertFile: "path", KeyFile: "path", @@ -58,7 +58,7 @@ func TestLoadConfig(t *testing.T) { expected: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: "localhost:1234", - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, }, diff --git a/receiver/simpleprometheusreceiver/factory.go b/receiver/simpleprometheusreceiver/factory.go index 976ad36d5cc5c..ec7cf2f779dde 100644 --- a/receiver/simpleprometheusreceiver/factory.go +++ b/receiver/simpleprometheusreceiver/factory.go @@ -36,7 +36,7 @@ func createDefaultConfig() component.Config { return &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: defaultEndpoint, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, }, diff --git a/receiver/simpleprometheusreceiver/receiver.go b/receiver/simpleprometheusreceiver/receiver.go index 7fed4cd52ee04..bb885c9dad873 100644 --- a/receiver/simpleprometheusreceiver/receiver.go +++ b/receiver/simpleprometheusreceiver/receiver.go @@ -56,8 +56,8 @@ func (prw *prometheusReceiverWrapper) Start(ctx context.Context, host component. func getPrometheusConfigWrapper(cfg *Config, params receiver.CreateSettings) (*prometheusreceiver.Config, error) { if cfg.TLSEnabled { params.Logger.Warn("the `tls_config` and 'tls_enabled' settings are deprecated, please use `tls` instead") - cfg.ClientConfig.TLSSetting = configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + cfg.ClientConfig.TLSSetting = configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: cfg.TLSConfig.CAFile, CertFile: cfg.TLSConfig.CertFile, KeyFile: cfg.TLSConfig.KeyFile, diff --git a/receiver/simpleprometheusreceiver/receiver_test.go b/receiver/simpleprometheusreceiver/receiver_test.go index 87e40f01ff0c9..f03f234055426 100644 --- a/receiver/simpleprometheusreceiver/receiver_test.go +++ b/receiver/simpleprometheusreceiver/receiver_test.go @@ -77,7 +77,7 @@ func TestGetPrometheusConfig(t *testing.T) { config: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: "localhost:1234", - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, }, @@ -115,8 +115,8 @@ func TestGetPrometheusConfig(t *testing.T) { config: &Config{ ClientConfig: confighttp.ClientConfig{ Endpoint: "localhost:1234", - TLSSetting: configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "./testdata/test_cert.pem", }, InsecureSkipVerify: true, @@ -221,7 +221,7 @@ func TestGetPrometheusConfigWrapper(t *testing.T) { }, ClientConfig: confighttp.ClientConfig{ Endpoint: defaultEndpoint, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, }, @@ -268,7 +268,7 @@ func TestGetPrometheusConfigWrapper(t *testing.T) { }, ClientConfig: confighttp.ClientConfig{ Endpoint: defaultEndpoint, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: true, }, }, @@ -309,7 +309,7 @@ func TestGetPrometheusConfigWrapper(t *testing.T) { }, ClientConfig: confighttp.ClientConfig{ Endpoint: defaultEndpoint, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: false, }, }, @@ -350,9 +350,9 @@ func TestGetPrometheusConfigWrapper(t *testing.T) { }, ClientConfig: confighttp.ClientConfig{ Endpoint: defaultEndpoint, - TLSSetting: configtls.TLSClientSetting{ + TLSSetting: configtls.ClientConfig{ Insecure: false, - TLSSetting: configtls.TLSSetting{ + TLSSetting: configtls.Config{ CAFile: "./testdata/test_cert.pem", }, }, diff --git a/receiver/skywalkingreceiver/factory_test.go b/receiver/skywalkingreceiver/factory_test.go index d9a1649826ca2..b9a150372c52f 100644 --- a/receiver/skywalkingreceiver/factory_test.go +++ b/receiver/skywalkingreceiver/factory_test.go @@ -109,8 +109,8 @@ func TestCreateTLSGPRCEndpoint(t *testing.T) { Endpoint: "0.0.0.0:11800", Transport: confignet.TransportTypeTCP, }, - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "./testdata/server.crt", KeyFile: "./testdata/server.key", }, @@ -128,8 +128,8 @@ func TestCreateTLSHTTPEndpoint(t *testing.T) { cfg.(*Config).Protocols.HTTP = &confighttp.ServerConfig{ Endpoint: "0.0.0.0:12800", - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "./testdata/server.crt", KeyFile: "./testdata/server.key", }, diff --git a/receiver/solacereceiver/config.go b/receiver/solacereceiver/config.go index 40e75a25efd4b..2e4316c1c986d 100644 --- a/receiver/solacereceiver/config.go +++ b/receiver/solacereceiver/config.go @@ -37,7 +37,7 @@ type Config struct { // The maximum number of unacknowledged messages the Solace broker can transmit, to configure AMQP Link MaxUnacked int32 `mapstructure:"max_unacknowledged"` - TLS configtls.TLSClientSetting `mapstructure:"tls,omitempty"` + TLS configtls.ClientConfig `mapstructure:"tls,omitempty"` Auth Authentication `mapstructure:"auth"` diff --git a/receiver/solacereceiver/config_test.go b/receiver/solacereceiver/config_test.go index 3c6a66e48b47d..c3746a417c5ad 100644 --- a/receiver/solacereceiver/config_test.go +++ b/receiver/solacereceiver/config_test.go @@ -40,7 +40,7 @@ func TestLoadConfig(t *testing.T) { }, Queue: "queue://#trace-profile123", MaxUnacked: 1234, - TLS: configtls.TLSClientSetting{ + TLS: configtls.ClientConfig{ Insecure: false, InsecureSkipVerify: false, }, diff --git a/receiver/solacereceiver/factory.go b/receiver/solacereceiver/factory.go index 574aaf522446e..6e75725747f93 100644 --- a/receiver/solacereceiver/factory.go +++ b/receiver/solacereceiver/factory.go @@ -37,7 +37,7 @@ func createDefaultConfig() component.Config { Broker: []string{defaultHost}, MaxUnacked: defaultMaxUnaked, Auth: Authentication{}, - TLS: configtls.TLSClientSetting{ + TLS: configtls.ClientConfig{ InsecureSkipVerify: false, Insecure: false, }, diff --git a/receiver/solacereceiver/messaging_service_test.go b/receiver/solacereceiver/messaging_service_test.go index 678ad4f5666d7..f2099f5ab95d5 100644 --- a/receiver/solacereceiver/messaging_service_test.go +++ b/receiver/solacereceiver/messaging_service_test.go @@ -85,7 +85,7 @@ func TestNewAMQPMessagingServiceFactory(t *testing.T) { name: "expecting authentication errors", cfg: &Config{ // no password Auth: Authentication{PlainText: &SaslPlainTextConfig{Username: "set"}}, - TLS: configtls.TLSClientSetting{Insecure: false, InsecureSkipVerify: false}, + TLS: configtls.ClientConfig{Insecure: false, InsecureSkipVerify: false}, Broker: []string{broker}, Queue: queue, MaxUnacked: maxUnacked, @@ -97,7 +97,7 @@ func TestNewAMQPMessagingServiceFactory(t *testing.T) { name: "expecting tls errors", cfg: &Config{ // invalid to only provide a key file Auth: Authentication{PlainText: &SaslPlainTextConfig{Username: "user", Password: "password"}}, - TLS: configtls.TLSClientSetting{TLSSetting: configtls.TLSSetting{KeyFile: "someKeyFile"}, Insecure: false}, + TLS: configtls.ClientConfig{TLSSetting: configtls.Config{KeyFile: "someKeyFile"}, Insecure: false}, Broker: []string{broker}, Queue: queue, MaxUnacked: maxUnacked, @@ -109,7 +109,7 @@ func TestNewAMQPMessagingServiceFactory(t *testing.T) { name: "expecting success with TLS expecting an amqps connection", cfg: &Config{ // invalid to only provide a key file Auth: Authentication{PlainText: &SaslPlainTextConfig{Username: "user", Password: "password"}}, - TLS: configtls.TLSClientSetting{Insecure: false}, + TLS: configtls.ClientConfig{Insecure: false}, Broker: []string{broker}, Queue: queue, MaxUnacked: maxUnacked, @@ -133,7 +133,7 @@ func TestNewAMQPMessagingServiceFactory(t *testing.T) { name: "expecting success without TLS expecting an amqp connection", cfg: &Config{ // invalid to only provide a key file Auth: Authentication{PlainText: &SaslPlainTextConfig{Username: "user", Password: "password"}}, - TLS: configtls.TLSClientSetting{Insecure: true}, + TLS: configtls.ClientConfig{Insecure: true}, Broker: []string{broker}, Queue: queue, MaxUnacked: maxUnacked, diff --git a/receiver/splunkhecreceiver/config_test.go b/receiver/splunkhecreceiver/config_test.go index 22a73fbd3a0d4..595968959d286 100644 --- a/receiver/splunkhecreceiver/config_test.go +++ b/receiver/splunkhecreceiver/config_test.go @@ -57,8 +57,8 @@ func TestLoadConfig(t *testing.T) { expected: &Config{ ServerConfig: confighttp.ServerConfig{ Endpoint: "0.0.0.0:8088", - TLSSetting: &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + TLSSetting: &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "/test.crt", KeyFile: "/test.key", }, diff --git a/receiver/splunkhecreceiver/receiver_test.go b/receiver/splunkhecreceiver/receiver_test.go index b87c26305619a..5f85cd8277e0b 100644 --- a/receiver/splunkhecreceiver/receiver_test.go +++ b/receiver/splunkhecreceiver/receiver_test.go @@ -442,8 +442,8 @@ func Test_splunkhecReceiver_TLS(t *testing.T) { addr := testutil.GetAvailableLocalAddress(t) cfg := createDefaultConfig().(*Config) cfg.Endpoint = addr - cfg.TLSSetting = &configtls.TLSServerSetting{ - TLSSetting: configtls.TLSSetting{ + cfg.TLSSetting = &configtls.ServerConfig{ + TLSSetting: configtls.Config{ CertFile: "./testdata/server.crt", KeyFile: "./testdata/server.key", }, @@ -494,8 +494,8 @@ func Test_splunkhecReceiver_TLS(t *testing.T) { req, err := http.NewRequestWithContext(context.Background(), "POST", url, bytes.NewReader(body)) require.NoErrorf(t, err, "should have no errors with new request: %v", err) - tlscs := configtls.TLSClientSetting{ - TLSSetting: configtls.TLSSetting{ + tlscs := configtls.ClientConfig{ + TLSSetting: configtls.Config{ CAFile: "./testdata/ca.crt", CertFile: "./testdata/client.crt", KeyFile: "./testdata/client.key", diff --git a/receiver/vcenterreceiver/README.md b/receiver/vcenterreceiver/README.md index 3534169ecba83..184e27529c363 100644 --- a/receiver/vcenterreceiver/README.md +++ b/receiver/vcenterreceiver/README.md @@ -34,7 +34,7 @@ A “Read Only” user assigned to a vSphere with permissions to the vCenter ser | endpoint | | String | Endpoint to the vCenter Server or ESXi host that has the sdk path enabled. Required. The expected format is `://`

i.e: `https://vcsa.hostname.localnet` | | username | | String | Required | | password | | String | Required | -| tls | | TLSClientSetting | Not Required. Will use defaults for [configtls.TLSClientSetting](https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/configtls/README.md). By default insecure settings are rejected and certificate verification is on. | +| tls | | TLSClientSetting | Not Required. Will use defaults for [configtls.ClientConfig](https://github.com/open-telemetry/opentelemetry-collector/blob/main/config/configtls/README.md). By default insecure settings are rejected and certificate verification is on. | | collection_interval | 2m | Duration | This receiver collects metrics on an interval. If the vCenter is fairly large, this value may need to be increased. Valid time units are `ns`, `us` (or `µs`), `ms`, `s`, `m`, `h` | | initial_delay | 1s | Duration | Defines how long this receiver waits before starting. | diff --git a/receiver/vcenterreceiver/client_test.go b/receiver/vcenterreceiver/client_test.go index fd42d979d6e42..fb3cf28ce1a3f 100644 --- a/receiver/vcenterreceiver/client_test.go +++ b/receiver/vcenterreceiver/client_test.go @@ -73,7 +73,7 @@ func TestSessionReestablish(t *testing.T) { Username: simulator.DefaultLogin.Username(), Password: configopaque.String(pw), Endpoint: fmt.Sprintf("%s://%s", c.URL().Scheme, c.URL().Host), - TLSClientSetting: configtls.TLSClientSetting{ + ClientConfig: configtls.ClientConfig{ Insecure: true, }, }, diff --git a/receiver/vcenterreceiver/config.go b/receiver/vcenterreceiver/config.go index 40f31e0fd73d6..9cfb0b984b034 100644 --- a/receiver/vcenterreceiver/config.go +++ b/receiver/vcenterreceiver/config.go @@ -19,7 +19,7 @@ import ( // Config is the configuration of the receiver type Config struct { scraperhelper.ScraperControllerSettings `mapstructure:",squash"` - configtls.TLSClientSetting `mapstructure:"tls,omitempty"` + configtls.ClientConfig `mapstructure:"tls,omitempty"` metadata.MetricsBuilderConfig `mapstructure:",squash"` Endpoint string `mapstructure:"endpoint"` Username string `mapstructure:"username"` diff --git a/receiver/vcenterreceiver/config_test.go b/receiver/vcenterreceiver/config_test.go index 13297408db204..54639e7f56f40 100644 --- a/receiver/vcenterreceiver/config_test.go +++ b/receiver/vcenterreceiver/config_test.go @@ -53,7 +53,7 @@ func TestConfigValidation(t *testing.T) { desc: "unparseable URL", cfg: Config{ Endpoint: "h" + string(rune(0x7f)), - TLSClientSetting: configtls.TLSClientSetting{}, + ClientConfig: configtls.ClientConfig{}, ScraperControllerSettings: scraperhelper.NewDefaultScraperControllerSettings(metadata.Type), }, expectedErr: errors.New("unable to parse url"), diff --git a/receiver/vcenterreceiver/factory.go b/receiver/vcenterreceiver/factory.go index 673d40d088a3b..5775cc49414fb 100644 --- a/receiver/vcenterreceiver/factory.go +++ b/receiver/vcenterreceiver/factory.go @@ -32,7 +32,7 @@ func createDefaultConfig() component.Config { return &Config{ ScraperControllerSettings: cfg, - TLSClientSetting: configtls.TLSClientSetting{}, + ClientConfig: configtls.ClientConfig{}, MetricsBuilderConfig: metadata.DefaultMetricsBuilderConfig(), } } diff --git a/receiver/vcenterreceiver/integration_test.go b/receiver/vcenterreceiver/integration_test.go index 44191affcc236..49f08eb1c1501 100644 --- a/receiver/vcenterreceiver/integration_test.go +++ b/receiver/vcenterreceiver/integration_test.go @@ -61,7 +61,7 @@ func TestIntegration(t *testing.T) { rCfg.Endpoint = fmt.Sprintf("%s://%s", c.URL().Scheme, c.URL().Host) rCfg.Username = simulator.DefaultLogin.Username() rCfg.Password = configopaque.String(pw) - rCfg.TLSClientSetting = configtls.TLSClientSetting{ + rCfg.ClientConfig = configtls.ClientConfig{ Insecure: true, } }), diff --git a/testbed/datasenders/jaeger.go b/testbed/datasenders/jaeger.go index 39f380c5a7047..5de7c6d5616b0 100644 --- a/testbed/datasenders/jaeger.go +++ b/testbed/datasenders/jaeger.go @@ -98,7 +98,7 @@ func (cfg *jaegerConfig) Validate() error { func (je *jaegerGRPCDataSender) newTracesExporter(set exporter.CreateSettings) (exporter.Traces, error) { cfg := jaegerConfig{} cfg.Endpoint = je.GetEndpoint().String() - cfg.TLSSetting = configtls.TLSClientSetting{ + cfg.TLSSetting = configtls.ClientConfig{ Insecure: true, } diff --git a/testbed/datasenders/opencensus.go b/testbed/datasenders/opencensus.go index bbaca73391794..458938518e76b 100644 --- a/testbed/datasenders/opencensus.go +++ b/testbed/datasenders/opencensus.go @@ -23,7 +23,7 @@ type ocDataSender struct { func (ods *ocDataSender) fillConfig(cfg *opencensusexporter.Config) *opencensusexporter.Config { cfg.Endpoint = ods.GetEndpoint().String() - cfg.TLSSetting = configtls.TLSClientSetting{ + cfg.TLSSetting = configtls.ClientConfig{ Insecure: true, } return cfg diff --git a/testbed/testbed/senders.go b/testbed/testbed/senders.go index 684763501004c..8501f22b08f30 100644 --- a/testbed/testbed/senders.go +++ b/testbed/testbed/senders.go @@ -87,7 +87,7 @@ func (ods *otlpHTTPDataSender) fillConfig(cfg *otlphttpexporter.Config) *otlphtt cfg.RetryConfig.Enabled = false // Disable sending queue, we should push data from the caller goroutine. cfg.QueueConfig.Enabled = false - cfg.TLSSetting = configtls.TLSClientSetting{ + cfg.TLSSetting = configtls.ClientConfig{ Insecure: true, } cfg.Compression = ods.compression @@ -219,7 +219,7 @@ func (ods *otlpDataSender) fillConfig(cfg *otlpexporter.Config) *otlpexporter.Co cfg.RetryConfig.Enabled = false // Disable sending queue, we should push data from the caller goroutine. cfg.QueueConfig.Enabled = false - cfg.TLSSetting = configtls.TLSClientSetting{ + cfg.TLSSetting = configtls.ClientConfig{ Insecure: true, } return cfg