Open ajxchapman opened 3 years ago
The current route definition syntax mixes how route filters are applied, in an HTTP route the method filter is read from the root of the definition:
method
{ "protocol" : "http", "method" : "HEAD", "route" : "^/(.*)", "action" : {} }
Where as in a DNS route, the filters are read in the action object, e.g. the record key below:
action
record
{ "protocol" : "dns", "route" : "simple\\.cname\\.{{default_domain}}", "action" : { "record" : "CNAME", "response" : "www.{{default_domain}}" } }
I propose that these filters are moved into a new key filter, which will allow for much more robust filtering. The examples above would become:
filter
{ "protocol" : "http", "route" : "^/(.*)", "filter" : { "method" : "HEAD" }, "action" : {} }
{ "protocol" : "dns", "route" : "simple\\.cname\\.{{default_domain}}", "filter" : { "record" : "CNAME" }, "action" : { "response" : "www.{{default_domain}}" } }
An implementation detail of the DNS route would be that the record type would either have to be duplicated in the filter and in the action, or derived from the filter.
The current route definition syntax mixes how route filters are applied, in an HTTP route the
method
filter is read from the root of the definition:Where as in a DNS route, the filters are read in the
action
object, e.g. therecord
key below:I propose that these filters are moved into a new key
filter
, which will allow for much more robust filtering. The examples above would become:An implementation detail of the DNS route would be that the record type would either have to be duplicated in the filter and in the action, or derived from the filter.