aboutsummaryrefslogtreecommitdiffhomepage
path: root/dhall/server
diff options
context:
space:
mode:
authorPaul Bonaud <paul.bonaud@fretlink.com>2020-08-14 18:39:27 +0200
committerPaul Bonaud <paul.bonaud@fretlink.com>2020-08-14 18:41:10 +0200
commit2187c77a0f6b6d3e178e6d1a695bc954f57ecb72 (patch)
tree05c889fa60f44042b92f04b7f0324ea3b2117e59 /dhall/server
parentf131496c3e23d30c30dd597ab734b0f771f4a4d9 (diff)
downloadansible-kong-app-2187c77a0f6b6d3e178e6d1a695bc954f57ecb72.tar.gz
ansible-kong-app-2187c77a0f6b6d3e178e6d1a695bc954f57ecb72.tar.zst
ansible-kong-app-2187c77a0f6b6d3e178e6d1a695bc954f57ecb72.zip
dhall(plugins): add binding for the 'response-transformer' plugin
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.
Diffstat (limited to 'dhall/server')
-rw-r--r--dhall/server/service/plugin/Config.dhall1
-rw-r--r--dhall/server/service/plugin/functions.dhall1
-rw-r--r--dhall/server/service/plugin/mkResponseTransformer.dhall9
3 files changed, 11 insertions, 0 deletions
diff --git a/dhall/server/service/plugin/Config.dhall b/dhall/server/service/plugin/Config.dhall
index 1f60080..5ec90cf 100644
--- a/dhall/server/service/plugin/Config.dhall
+++ b/dhall/server/service/plugin/Config.dhall
@@ -1,6 +1,7 @@
1< CorrelationId : 1< CorrelationId :
2 { header_name : Text, echo_downstream : Bool, generator : Text } 2 { header_name : Text, echo_downstream : Bool, generator : Text }
3| RequestTransformer : { add : { headers : List Text } } 3| RequestTransformer : { add : { headers : List Text } }
4| ResponseTransformer : { add : { headers : List Text } }
4| RequestTermination : 5| RequestTermination :
5 { status_code : Natural, content_type : Text, body : Text } 6 { status_code : Natural, content_type : Text, body : Text }
6| IPRestriction : { whitelist : Text } 7| IPRestriction : { whitelist : Text }
diff --git a/dhall/server/service/plugin/functions.dhall b/dhall/server/service/plugin/functions.dhall
index 098fba7..d183dea 100644
--- a/dhall/server/service/plugin/functions.dhall
+++ b/dhall/server/service/plugin/functions.dhall
@@ -1,5 +1,6 @@
1{ mkRequestTermination = ./mkRequestTermination.dhall 1{ mkRequestTermination = ./mkRequestTermination.dhall
2, mkRequestTransformer = ./mkRequestTransformer.dhall 2, mkRequestTransformer = ./mkRequestTransformer.dhall
3, mkResponseTransformer = ./mkResponseTransformer.dhall
3, mkIPRestriction = ./mkIPRestriction.dhall 4, mkIPRestriction = ./mkIPRestriction.dhall
4, correlationId = ./correlationId.dhall 5, correlationId = ./correlationId.dhall
5, mkPreFunction = ./mkPreFunction.dhall 6, mkPreFunction = ./mkPreFunction.dhall
diff --git a/dhall/server/service/plugin/mkResponseTransformer.dhall b/dhall/server/service/plugin/mkResponseTransformer.dhall
new file mode 100644
index 0000000..d6a05e8
--- /dev/null
+++ b/dhall/server/service/plugin/mkResponseTransformer.dhall
@@ -0,0 +1,9 @@
1let Plugin = ./Plugin.dhall
2
3let config = ./Config.dhall
4
5in λ(header : Text) →
6 { name = "response-transformer"
7 , config = config.ResponseTransformer { add.headers = [ header ] }
8 }
9 : Plugin