2020-10-06 22:09:13 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
set -euo pipefail
|
|
|
|
|
2022-11-07 16:02:04 +00:00
|
|
|
upsert_config_entry primary '
|
|
|
|
kind = "service-defaults"
|
|
|
|
name = "s2"
|
|
|
|
protocol = "http"
|
|
|
|
'
|
|
|
|
|
|
|
|
upsert_config_entry primary '
|
|
|
|
kind = "service-intentions"
|
|
|
|
name = "s2"
|
|
|
|
sources {
|
|
|
|
name = "s1"
|
|
|
|
permissions = [
|
|
|
|
// paths
|
|
|
|
{
|
|
|
|
action = "allow"
|
|
|
|
http { path_exact = "/exact" }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
action = "allow"
|
|
|
|
http { path_prefix = "/prefix" }
|
|
|
|
},
|
|
|
|
{
|
|
|
|
action = "allow"
|
|
|
|
http { path_regex = "/reg[ex]{2}" }
|
|
|
|
},
|
|
|
|
// headers
|
|
|
|
{
|
|
|
|
action = "allow"
|
|
|
|
http {
|
|
|
|
path_exact = "/hdr-present"
|
|
|
|
header = [{
|
|
|
|
name = "x-test-debug"
|
|
|
|
present = true
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
action = "allow"
|
|
|
|
http {
|
|
|
|
path_exact = "/hdr-exact"
|
|
|
|
header = [{
|
|
|
|
name = "x-test-debug"
|
|
|
|
exact = "exact"
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
action = "allow"
|
|
|
|
http {
|
|
|
|
path_exact = "/hdr-prefix"
|
|
|
|
header = [{
|
|
|
|
name = "x-test-debug"
|
|
|
|
prefix = "prefi"
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
action = "allow"
|
|
|
|
http {
|
|
|
|
path_exact = "/hdr-suffix"
|
|
|
|
header = [{
|
|
|
|
name = "x-test-debug"
|
|
|
|
suffix = "uffix"
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{
|
|
|
|
action = "allow"
|
|
|
|
http {
|
|
|
|
path_exact = "/hdr-regex"
|
|
|
|
header = [{
|
|
|
|
name = "x-test-debug"
|
|
|
|
regex = "reg[ex]{2}"
|
|
|
|
}]
|
|
|
|
}
|
|
|
|
},
|
|
|
|
// methods
|
|
|
|
{
|
|
|
|
action = "allow"
|
|
|
|
http {
|
|
|
|
path_exact = "/method-match"
|
|
|
|
methods = ["GET", "PUT"]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
'
|
2020-10-06 22:09:13 +00:00
|
|
|
|
2020-11-09 19:59:46 +00:00
|
|
|
register_services primary
|
|
|
|
|
2020-10-06 22:09:13 +00:00
|
|
|
gen_envoy_bootstrap s1 19000
|
|
|
|
gen_envoy_bootstrap s2 19001
|