Update mesh config tests

Signed-off-by: Mark Anderson <manderson@hashicorp.com>
This commit is contained in:
Mark Anderson 2022-05-03 13:29:45 -07:00
parent e6282c7c64
commit db0c61303f
3 changed files with 21 additions and 0 deletions

View File

@ -1694,6 +1694,9 @@ func TestDecodeConfigEntry(t *testing.T) {
]
}
}
http {
sanitize_x_forwarded_client_cert = true
}
`,
camel: `
Kind = "mesh"
@ -1722,6 +1725,9 @@ func TestDecodeConfigEntry(t *testing.T) {
]
}
}
HTTP {
SanitizeXForwardedClientCert = true
}
`,
expect: &MeshConfigEntry{
Meta: map[string]string{
@ -1749,6 +1755,9 @@ func TestDecodeConfigEntry(t *testing.T) {
},
},
},
HTTP: &MeshHTTPConfig{
SanitizeXForwardedClientCert: true,
},
},
},
{

View File

@ -1278,6 +1278,9 @@ func TestDecodeConfigEntry(t *testing.T) {
"TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256"
]
}
},
"HTTP": {
"SanitizeXForwardedClientCert": true
}
}
`,
@ -1307,6 +1310,9 @@ func TestDecodeConfigEntry(t *testing.T) {
},
},
},
HTTP: &MeshHTTPConfig{
SanitizeXForwardedClientCert: true,
},
},
},
} {

View File

@ -126,6 +126,9 @@ meta {
transparent_proxy {
mesh_destinations_only = true
}
http {
sanitize_x_forwarded_client_cert = true
}
`)
ui := cli.NewMockUi()
@ -143,6 +146,9 @@ transparent_proxy {
proxy, ok := entry.(*api.MeshConfigEntry)
require.True(t, ok)
require.Equal(t, map[string]string{"foo": "bar", "gir": "zim"}, proxy.Meta)
require.True(t, proxy.TransparentProxy.MeshDestinationsOnly)
require.True(t, proxy.HTTP.SanitizeXForwardedClientCert)
})
}