diff --git a/config/configgrpc/configgrpc.go b/config/configgrpc/configgrpc.go index c3b6afee9cae..5d23b55b78aa 100644 --- a/config/configgrpc/configgrpc.go +++ b/config/configgrpc/configgrpc.go @@ -117,7 +117,7 @@ type GRPCServerSettings struct { // Configures the protocol to use TLS. // The default value is nil, which will cause the protocol to not use TLS. - TLSCredentials *configtls.TLSServerSetting `mapstructure:"tls_credentials,omitempty"` + TLSSetting *configtls.TLSServerSetting `mapstructure:"tls_settings,omitempty"` // MaxRecvMsgSizeMiB sets the maximum size (in MiB) of messages accepted by the server. MaxRecvMsgSizeMiB uint64 `mapstructure:"max_recv_msg_size_mib"` @@ -193,8 +193,8 @@ func (gss *GRPCServerSettings) ToListener() (net.Listener, error) { func (gss *GRPCServerSettings) ToServerOption() ([]grpc.ServerOption, error) { var opts []grpc.ServerOption - if gss.TLSCredentials != nil { - tlsCfg, err := gss.TLSCredentials.LoadTLSConfig() + if gss.TLSSetting != nil { + tlsCfg, err := gss.TLSSetting.LoadTLSConfig() if err != nil { return nil, err } diff --git a/config/configgrpc/configgrpc_test.go b/config/configgrpc/configgrpc_test.go index 0ca0c2469119..37ea6d204471 100644 --- a/config/configgrpc/configgrpc_test.go +++ b/config/configgrpc/configgrpc_test.go @@ -72,7 +72,7 @@ func TestDefaultGrpcServerSettings(t *testing.T) { func TestAllGrpcServerSettings(t *testing.T) { gss := &GRPCServerSettings{ Endpoint: "localhost:1234", - TLSCredentials: &configtls.TLSServerSetting{ + TLSSetting: &configtls.TLSServerSetting{ TLSSetting: configtls.TLSSetting{}, ClientCAFile: "", }, @@ -167,7 +167,7 @@ func TestGRPCServerSettingsError(t *testing.T) { err: "^failed to load TLS config: failed to load CA CertPool: failed to load CA /doesnt/exist:", settings: GRPCServerSettings{ Endpoint: "", - TLSCredentials: &configtls.TLSServerSetting{ + TLSSetting: &configtls.TLSServerSetting{ TLSSetting: configtls.TLSSetting{ CAFile: "/doesnt/exist", }, @@ -179,7 +179,7 @@ func TestGRPCServerSettingsError(t *testing.T) { err: "^failed to load TLS config: for auth via TLS, either both certificate and key must be supplied, or neither", settings: GRPCServerSettings{ Endpoint: "", - TLSCredentials: &configtls.TLSServerSetting{ + TLSSetting: &configtls.TLSServerSetting{ TLSSetting: configtls.TLSSetting{ CertFile: "/doesnt/exist", }, @@ -191,7 +191,7 @@ func TestGRPCServerSettingsError(t *testing.T) { err: "^failed to load TLS config: failed to load client CA CertPool: failed to load CA /doesnt/exist:", settings: GRPCServerSettings{ Endpoint: "", - TLSCredentials: &configtls.TLSServerSetting{ + TLSSetting: &configtls.TLSServerSetting{ ClientCAFile: "/doesnt/exist", }, }, @@ -208,7 +208,7 @@ func TestGRPCServerSettingsError(t *testing.T) { func TestGRPCServerSettings_ToListener_Error(t *testing.T) { settings := GRPCServerSettings{ Endpoint: "127.0.0.1:1234567", - TLSCredentials: &configtls.TLSServerSetting{ + TLSSetting: &configtls.TLSServerSetting{ TLSSetting: configtls.TLSSetting{ CertFile: "/doesnt/exist", }, @@ -341,8 +341,8 @@ func TestHttpReception(t *testing.T) { for _, tt := range tests { t.Run(tt.name, func(t *testing.T) { gss := &GRPCServerSettings{ - Endpoint: "localhost:0", - TLSCredentials: tt.tlsServerCreds, + Endpoint: "localhost:0", + TLSSetting: tt.tlsServerCreds, } ln, err := gss.ToListener() assert.NoError(t, err) diff --git a/config/configprotocol/configprotocol.go b/config/configprotocol/configprotocol.go index 6d40198739b4..8e034cf0e2c6 100644 --- a/config/configprotocol/configprotocol.go +++ b/config/configprotocol/configprotocol.go @@ -27,5 +27,5 @@ type ProtocolServerSettings struct { // Configures the protocol to use TLS. // The default value is nil, which will cause the protocol to not use TLS. - TLSCredentials *configtls.TLSServerSetting `mapstructure:"tls_credentials, omitempty"` + TLSSettings *configtls.TLSServerSetting `mapstructure:"tls_settings, omitempty"` } diff --git a/receiver/jaegerreceiver/README.md b/receiver/jaegerreceiver/README.md index b3eacc6eb4e9..fd55c4cdbcb0 100644 --- a/receiver/jaegerreceiver/README.md +++ b/receiver/jaegerreceiver/README.md @@ -28,13 +28,13 @@ documented [here](./config.go). ## Communicating over TLS The Jaeger receiver supports communication using Transport Layer Security (TLS), but only using the gRPC protocol. It can be configured by specifying a -`tls_credentials` object in the gRPC receiver configuration. +`tls_settings` object in the gRPC receiver configuration. ```yaml receivers: jaeger: protocols: grpc: - tls_credentials: + tls_settings: key_file: /key.pem # path to private key cert_file: /cert.pem # path to certificate endpoint: "0.0.0.0:9876" diff --git a/receiver/jaegerreceiver/config_test.go b/receiver/jaegerreceiver/config_test.go index 1b87b12d39cf..0744c3448bef 100644 --- a/receiver/jaegerreceiver/config_test.go +++ b/receiver/jaegerreceiver/config_test.go @@ -123,7 +123,7 @@ func TestLoadConfig(t *testing.T) { Protocols: Protocols{ GRPC: &configgrpc.GRPCServerSettings{ Endpoint: "localhost:9876", - TLSCredentials: &configtls.TLSServerSetting{ + TLSSetting: &configtls.TLSServerSetting{ TLSSetting: configtls.TLSSetting{ CertFile: "/test.crt", KeyFile: "/test.key", diff --git a/receiver/jaegerreceiver/factory_test.go b/receiver/jaegerreceiver/factory_test.go index bad249831752..81e8b7e8e50b 100644 --- a/receiver/jaegerreceiver/factory_test.go +++ b/receiver/jaegerreceiver/factory_test.go @@ -83,7 +83,7 @@ func TestCreateTLSGPRCEndpoint(t *testing.T) { cfg.(*Config).Protocols.GRPC = &configgrpc.GRPCServerSettings{ Endpoint: defaultGRPCBindEndpoint, - TLSCredentials: &configtls.TLSServerSetting{ + TLSSetting: &configtls.TLSServerSetting{ TLSSetting: configtls.TLSSetting{ CertFile: "./testdata/certificate.pem", KeyFile: "./testdata/key.pem", diff --git a/receiver/jaegerreceiver/testdata/config.yaml b/receiver/jaegerreceiver/testdata/config.yaml index 61f515035892..386193873b5c 100644 --- a/receiver/jaegerreceiver/testdata/config.yaml +++ b/receiver/jaegerreceiver/testdata/config.yaml @@ -37,7 +37,7 @@ receivers: jaeger/tls: protocols: grpc: - tls_credentials: + tls_settings: cert_file: /test.crt key_file: /test.key endpoint: "localhost:9876" diff --git a/receiver/opencensusreceiver/README.md b/receiver/opencensusreceiver/README.md index 75f00bdcc5dc..3e1de40b1837 100644 --- a/receiver/opencensusreceiver/README.md +++ b/receiver/opencensusreceiver/README.md @@ -17,12 +17,12 @@ with detailed sample configurations [here](./testdata/config.yaml). ## Communicating over TLS This receiver supports communication using Transport Layer Security (TLS). TLS -can be configured by specifying a `tls_credentials` object in the receiver +can be configured by specifying a `tls_settings` object in the receiver configuration for receivers that support it. ```yaml receivers: opencensus: - tls_credentials: + tls_settings: key_file: /key.pem # path to private key cert_file: /cert.pem # path to certificate ``` diff --git a/receiver/opencensusreceiver/config_test.go b/receiver/opencensusreceiver/config_test.go index a6829dfee5a2..c44cb4216400 100644 --- a/receiver/opencensusreceiver/config_test.go +++ b/receiver/opencensusreceiver/config_test.go @@ -119,7 +119,7 @@ func TestLoadConfig(t *testing.T) { GRPCServerSettings: configgrpc.GRPCServerSettings{ Endpoint: "0.0.0.0:55678", ReadBufferSize: 512 * 1024, - TLSCredentials: &configtls.TLSServerSetting{ + TLSSetting: &configtls.TLSServerSetting{ TLSSetting: configtls.TLSSetting{ CertFile: "test.crt", KeyFile: "test.key", @@ -165,7 +165,7 @@ func TestBuildOptions_TLSCredentials(t *testing.T) { NameVal: "IncorrectTLS", }, GRPCServerSettings: configgrpc.GRPCServerSettings{ - TLSCredentials: &configtls.TLSServerSetting{ + TLSSetting: &configtls.TLSServerSetting{ TLSSetting: configtls.TLSSetting{ CertFile: "willfail", }, @@ -175,7 +175,7 @@ func TestBuildOptions_TLSCredentials(t *testing.T) { _, err := cfg.buildOptions() assert.EqualError(t, err, `failed to load TLS config: for auth via TLS, either both certificate and key must be supplied, or neither`) - cfg.TLSCredentials = &configtls.TLSServerSetting{} + cfg.TLSSetting = &configtls.TLSServerSetting{} opt, err := cfg.buildOptions() assert.NoError(t, err) assert.NotNil(t, opt) diff --git a/receiver/opencensusreceiver/testdata/config.yaml b/receiver/opencensusreceiver/testdata/config.yaml index d271521af444..1de5dde787e6 100644 --- a/receiver/opencensusreceiver/testdata/config.yaml +++ b/receiver/opencensusreceiver/testdata/config.yaml @@ -39,7 +39,7 @@ receivers: # The following entry demonstrates how to specify TLS credentials for the server. # Note: These files do not exist. If the receiver is started with this configuration, it will fail. opencensus/tlscredentials: - tls_credentials: + tls_settings: cert_file: test.crt key_file: test.key # The following entry demonstrates how to specify a Unix Domain Socket for the server. diff --git a/receiver/otlpreceiver/README.md b/receiver/otlpreceiver/README.md index a2073583404c..42903e15191c 100644 --- a/receiver/otlpreceiver/README.md +++ b/receiver/otlpreceiver/README.md @@ -27,14 +27,14 @@ receivers: ## Communicating over TLS This receiver supports communication using Transport Layer Security (TLS). TLS -can be configured by specifying a `tls_credentials` object in the receiver +can be configured by specifying a `tls_settings` object in the receiver configuration for receivers that support it. ```yaml receivers: otlp: protocols: grpc: - tls_credentials: + tls_settings: key_file: /key.pem # path to private key cert_file: /cert.pem # path to certificate ``` diff --git a/receiver/otlpreceiver/config_test.go b/receiver/otlpreceiver/config_test.go index ece446d55fb3..308b784cbcf6 100644 --- a/receiver/otlpreceiver/config_test.go +++ b/receiver/otlpreceiver/config_test.go @@ -128,7 +128,7 @@ func TestLoadConfig(t *testing.T) { Protocols: Protocols{ GRPC: &configgrpc.GRPCServerSettings{ Endpoint: "0.0.0.0:55680", - TLSCredentials: &configtls.TLSServerSetting{ + TLSSetting: &configtls.TLSServerSetting{ TLSSetting: configtls.TLSSetting{ CertFile: "test.crt", KeyFile: "test.key", diff --git a/receiver/otlpreceiver/otlp_test.go b/receiver/otlpreceiver/otlp_test.go index a48fb0075218..6028f0cf22c6 100644 --- a/receiver/otlpreceiver/otlp_test.go +++ b/receiver/otlpreceiver/otlp_test.go @@ -398,7 +398,7 @@ func TestGRPCInvalidTLSCredentials(t *testing.T) { Protocols: Protocols{ GRPC: &configgrpc.GRPCServerSettings{ Endpoint: "localhost:50000", - TLSCredentials: &configtls.TLSServerSetting{ + TLSSetting: &configtls.TLSServerSetting{ TLSSetting: configtls.TLSSetting{ CertFile: "willfail", }, diff --git a/receiver/otlpreceiver/testdata/config.yaml b/receiver/otlpreceiver/testdata/config.yaml index 30aeded350ed..990cb2cbfe06 100644 --- a/receiver/otlpreceiver/testdata/config.yaml +++ b/receiver/otlpreceiver/testdata/config.yaml @@ -54,7 +54,7 @@ receivers: otlp/tlscredentials: protocols: grpc: - tls_credentials: + tls_settings: cert_file: test.crt key_file: test.key http: