mirror of https://github.com/status-im/consul.git
Update mesh config tests
Signed-off-by: Mark Anderson <manderson@hashicorp.com>
This commit is contained in:
parent
05dc5a26b7
commit
6430af1c0e
|
@ -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,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
},
|
||||
},
|
||||
} {
|
||||
|
|
|
@ -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)
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue