This plugin is very similar to the existing request-transformer
plugin.
We can expose a Dhall helper to generate this plugin configuration as
the other plugins.
< CorrelationId :
{ header_name : Text, echo_downstream : Bool, generator : Text }
| RequestTransformer : { add : { headers : List Text } }
+| ResponseTransformer : { add : { headers : List Text } }
| RequestTermination :
{ status_code : Natural, content_type : Text, body : Text }
| IPRestriction : { whitelist : Text }
{ mkRequestTermination = ./mkRequestTermination.dhall
, mkRequestTransformer = ./mkRequestTransformer.dhall
+, mkResponseTransformer = ./mkResponseTransformer.dhall
, mkIPRestriction = ./mkIPRestriction.dhall
, correlationId = ./correlationId.dhall
, mkPreFunction = ./mkPreFunction.dhall
--- /dev/null
+let Plugin = ./Plugin.dhall
+
+let config = ./Config.dhall
+
+in λ(header : Text) →
+ { name = "response-transformer"
+ , config = config.ResponseTransformer { add.headers = [ header ] }
+ }
+ : Plugin