While the underlying Traefik "middleware" configuration is available to plugin biz logic via in hostConfig as Grain's Json* types, parsing out values should have some helpers.
Something like a Map be better. Perhaps collapsing the JSON in dot.strings to keep key,value of Map – just flatten names of any hierarchy, i.e. "actions.addResponseHeader.X-My-Header" from { "actions": { "addResponseHeader": { "X-My-Header": "some value" }}}
Right now it's way to much code to read one attributes from hostConfig using JsonObject()/match to add that as a header:
While the underlying Traefik "middleware" configuration is available to plugin biz logic via in
hostConfig
as Grain's Json* types, parsing out values should have some helpers.Something like a Map be better. Perhaps collapsing the JSON in dot.strings to keep key,value of Map – just flatten names of any hierarchy, i.e. "actions.addResponseHeader.X-My-Header" from
{ "actions": { "addResponseHeader": { "X-My-Header": "some value" }}}
Right now it's way to much code to read one attributes from
hostConfig
using JsonObject()/match
to add that as a header:Thinking adding
hostJson
for the "raw" JsonObject(), andhostConfig
be aMap
of the JSON.