Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[configtls] Removed deprecated structs #9786

Merged
merged 11 commits into from Mar 27, 2024
25 changes: 25 additions & 0 deletions .chloggen/configtls-remove-deprecated.yaml
@@ -0,0 +1,25 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
component: configtls

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Remove Deprecated `TLSSetting`, `TLSClientSetting`, and `TLSServerSetting`.

# One or more tracking issues or pull requests related to the change
issues: [9786]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: []
TylerHelmuth marked this conversation as resolved.
Show resolved Hide resolved
25 changes: 25 additions & 0 deletions .chloggen/configtls-remove-deprecated2.yaml
@@ -0,0 +1,25 @@
# Use this changelog template to create an entry for release notes.

# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: breaking

# The name of the component, or a single word describing the area of concern, (e.g. otlpreceiver)
component: configtls

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Rename `TLSSetting` to `Config` on `ClientConfig` and `ServerConfig`.

# One or more tracking issues or pull requests related to the change
issues: [9786]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:

# Optional: The change log or logs in which this entry should be included.
# e.g. '[user]' or '[user, api]'
# Include 'user' if the change is relevant to end users.
# Include 'api' if there is a change to a library API.
# Default: '[user]'
change_logs: [api]
30 changes: 15 additions & 15 deletions config/configgrpc/configgrpc_test.go
Expand Up @@ -197,7 +197,7 @@ func TestAllGrpcServerSettingsExceptAuth(t *testing.T) {
Transport: confignet.TransportTypeTCP,
},
TLSSetting: &configtls.ServerConfig{
TLSSetting: configtls.Config{},
Config: configtls.Config{},
ClientCAFile: "",
},
MaxRecvMsgSizeMiB: 1,
Expand Down Expand Up @@ -278,7 +278,7 @@ func TestGRPCClientSettingsError(t *testing.T) {
Endpoint: "",
Compression: "",
TLSSetting: configtls.ClientConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CAFile: "/doesnt/exist",
},
Insecure: false,
Expand All @@ -294,7 +294,7 @@ func TestGRPCClientSettingsError(t *testing.T) {
Endpoint: "",
Compression: "",
TLSSetting: configtls.ClientConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CertFile: "/doesnt/exist",
},
Insecure: false,
Expand Down Expand Up @@ -465,7 +465,7 @@ func TestGRPCServerSettingsError(t *testing.T) {
Transport: confignet.TransportTypeTCP,
},
TLSSetting: &configtls.ServerConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CAFile: "/doesnt/exist",
},
},
Expand All @@ -479,7 +479,7 @@ func TestGRPCServerSettingsError(t *testing.T) {
Transport: confignet.TransportTypeTCP,
},
TLSSetting: &configtls.ServerConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CertFile: "/doesnt/exist",
},
},
Expand Down Expand Up @@ -538,14 +538,14 @@ func TestHttpReception(t *testing.T) {
{
name: "TLS",
tlsServerCreds: &configtls.ServerConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
CertFile: filepath.Join("testdata", "server.crt"),
KeyFile: filepath.Join("testdata", "server.key"),
},
},
tlsClientCreds: &configtls.ClientConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
},
ServerName: "localhost",
Expand All @@ -554,12 +554,12 @@ func TestHttpReception(t *testing.T) {
{
name: "NoServerCertificates",
tlsServerCreds: &configtls.ServerConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
},
},
tlsClientCreds: &configtls.ClientConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
},
ServerName: "localhost",
Expand All @@ -569,15 +569,15 @@ func TestHttpReception(t *testing.T) {
{
name: "mTLS",
tlsServerCreds: &configtls.ServerConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
CertFile: filepath.Join("testdata", "server.crt"),
KeyFile: filepath.Join("testdata", "server.key"),
},
ClientCAFile: filepath.Join("testdata", "ca.crt"),
},
tlsClientCreds: &configtls.ClientConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
CertFile: filepath.Join("testdata", "client.crt"),
KeyFile: filepath.Join("testdata", "client.key"),
Expand All @@ -588,15 +588,15 @@ func TestHttpReception(t *testing.T) {
{
name: "NoClientCertificate",
tlsServerCreds: &configtls.ServerConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
CertFile: filepath.Join("testdata", "server.crt"),
KeyFile: filepath.Join("testdata", "server.key"),
},
ClientCAFile: filepath.Join("testdata", "ca.crt"),
},
tlsClientCreds: &configtls.ClientConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
},
ServerName: "localhost",
Expand All @@ -606,15 +606,15 @@ func TestHttpReception(t *testing.T) {
{
name: "WrongClientCA",
tlsServerCreds: &configtls.ServerConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
CertFile: filepath.Join("testdata", "server.crt"),
KeyFile: filepath.Join("testdata", "server.key"),
},
ClientCAFile: filepath.Join("testdata", "server.crt"),
},
tlsClientCreds: &configtls.ClientConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
CertFile: filepath.Join("testdata", "client.crt"),
KeyFile: filepath.Join("testdata", "client.key"),
Expand Down
38 changes: 19 additions & 19 deletions config/confighttp/confighttp_test.go
Expand Up @@ -311,7 +311,7 @@ func TestHTTPClientSettingsError(t *testing.T) {
settings: ClientConfig{
Endpoint: "",
TLSSetting: configtls.ClientConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CAFile: "/doesnt/exist",
},
Insecure: false,
Expand All @@ -324,7 +324,7 @@ func TestHTTPClientSettingsError(t *testing.T) {
settings: ClientConfig{
Endpoint: "",
TLSSetting: configtls.ClientConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CertFile: "/doesnt/exist",
},
Insecure: false,
Expand Down Expand Up @@ -494,7 +494,7 @@ func TestHTTPServerSettingsError(t *testing.T) {
settings: ServerConfig{
Endpoint: "localhost:0",
TLSSetting: &configtls.ServerConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CAFile: "/doesnt/exist",
},
},
Expand All @@ -505,7 +505,7 @@ func TestHTTPServerSettingsError(t *testing.T) {
settings: ServerConfig{
Endpoint: "localhost:0",
TLSSetting: &configtls.ServerConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CertFile: "/doesnt/exist",
},
},
Expand Down Expand Up @@ -586,14 +586,14 @@ func TestHttpReception(t *testing.T) {
{
name: "TLS",
tlsServerCreds: &configtls.ServerConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
CertFile: filepath.Join("testdata", "server.crt"),
KeyFile: filepath.Join("testdata", "server.key"),
},
},
tlsClientCreds: &configtls.ClientConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
},
ServerName: "localhost",
Expand All @@ -602,14 +602,14 @@ func TestHttpReception(t *testing.T) {
{
name: "TLS (HTTP/1.1)",
tlsServerCreds: &configtls.ServerConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
CertFile: filepath.Join("testdata", "server.crt"),
KeyFile: filepath.Join("testdata", "server.key"),
},
},
tlsClientCreds: &configtls.ClientConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
},
ServerName: "localhost",
Expand All @@ -619,12 +619,12 @@ func TestHttpReception(t *testing.T) {
{
name: "NoServerCertificates",
tlsServerCreds: &configtls.ServerConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
},
},
tlsClientCreds: &configtls.ClientConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
},
ServerName: "localhost",
Expand All @@ -634,15 +634,15 @@ func TestHttpReception(t *testing.T) {
{
name: "mTLS",
tlsServerCreds: &configtls.ServerConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
CertFile: filepath.Join("testdata", "server.crt"),
KeyFile: filepath.Join("testdata", "server.key"),
},
ClientCAFile: filepath.Join("testdata", "ca.crt"),
},
tlsClientCreds: &configtls.ClientConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
CertFile: filepath.Join("testdata", "client.crt"),
KeyFile: filepath.Join("testdata", "client.key"),
Expand All @@ -653,15 +653,15 @@ func TestHttpReception(t *testing.T) {
{
name: "NoClientCertificate",
tlsServerCreds: &configtls.ServerConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
CertFile: filepath.Join("testdata", "server.crt"),
KeyFile: filepath.Join("testdata", "server.key"),
},
ClientCAFile: filepath.Join("testdata", "ca.crt"),
},
tlsClientCreds: &configtls.ClientConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
},
ServerName: "localhost",
Expand All @@ -671,15 +671,15 @@ func TestHttpReception(t *testing.T) {
{
name: "WrongClientCA",
tlsServerCreds: &configtls.ServerConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
CertFile: filepath.Join("testdata", "server.crt"),
KeyFile: filepath.Join("testdata", "server.key"),
},
ClientCAFile: filepath.Join("testdata", "server.crt"),
},
tlsClientCreds: &configtls.ClientConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
CertFile: filepath.Join("testdata", "client.crt"),
KeyFile: filepath.Join("testdata", "client.key"),
Expand Down Expand Up @@ -1089,7 +1089,7 @@ func TestHttpClientHostHeader(t *testing.T) {
serverURL, _ := url.Parse(server.URL)
setting := ClientConfig{
Endpoint: serverURL.String(),
TLSSetting: configtls.TLSClientSetting{},
TLSSetting: configtls.ClientConfig{},
ReadBufferSize: 0,
WriteBufferSize: 0,
Timeout: 0,
Expand Down Expand Up @@ -1340,14 +1340,14 @@ func BenchmarkHttpRequest(b *testing.B) {
}

tlsServerCreds := &configtls.ServerConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
CertFile: filepath.Join("testdata", "server.crt"),
KeyFile: filepath.Join("testdata", "server.key"),
},
}
tlsClientCreds := &configtls.ClientConfig{
TLSSetting: configtls.Config{
Config: configtls.Config{
CAFile: filepath.Join("testdata", "ca.crt"),
},
ServerName: "localhost",
Expand Down