aboutsummaryrefslogtreecommitdiffhomepage
path: root/dhall/server/service
diff options
context:
space:
mode:
authorHussein Ait-Lahcen <hussein.ait-lahcen@fretlink.com>2018-11-19 15:51:21 +0100
committerHussein Ait-Lahcen <hussein.ait-lahcen@fretlink.com>2018-11-20 17:29:11 +0100
commit77e27a11c31fee82c2ff30613bc832f5171fa845 (patch)
treeca5b2bc2ea4c15d91476436ca4376108f5a78d88 /dhall/server/service
parent6bbc5a167fb43110a5b16746c112298f392be2b8 (diff)
downloadansible-kong-app-77e27a11c31fee82c2ff30613bc832f5171fa845.tar.gz
ansible-kong-app-77e27a11c31fee82c2ff30613bc832f5171fa845.tar.zst
ansible-kong-app-77e27a11c31fee82c2ff30613bc832f5171fa845.zip
add dhall interface
Diffstat (limited to 'dhall/server/service')
-rw-r--r--dhall/server/service/Service.dhall5
-rw-r--r--dhall/server/service/functions.dhall1
-rw-r--r--dhall/server/service/plugin/Config.dhall9
-rw-r--r--dhall/server/service/plugin/CorrelationId.dhall11
-rw-r--r--dhall/server/service/plugin/Plugin.dhall1
-rw-r--r--dhall/server/service/plugin/functions.dhall9
-rw-r--r--dhall/server/service/plugin/mkIPRestriction.dhall11
-rw-r--r--dhall/server/service/plugin/mkRequestTermination.dhall20
-rw-r--r--dhall/server/service/plugin/mkRequestTransformer.dhall11
-rw-r--r--dhall/server/service/route/Route.dhall1
10 files changed, 79 insertions, 0 deletions
diff --git a/dhall/server/service/Service.dhall b/dhall/server/service/Service.dhall
new file mode 100644
index 0000000..f238553
--- /dev/null
+++ b/dhall/server/service/Service.dhall
@@ -0,0 +1,5 @@
1 let Plugin = ./plugin/Plugin.dhall
2
3in let Route = ./route/Route.dhall
4
5in { name : Text, url : Text, plugins : List Plugin, routes : List Route }
diff --git a/dhall/server/service/functions.dhall b/dhall/server/service/functions.dhall
new file mode 100644
index 0000000..08f25c0
--- /dev/null
+++ b/dhall/server/service/functions.dhall
@@ -0,0 +1 @@
{ Plugin = ./plugin/functions.dhall }
diff --git a/dhall/server/service/plugin/Config.dhall b/dhall/server/service/plugin/Config.dhall
new file mode 100644
index 0000000..73a333f
--- /dev/null
+++ b/dhall/server/service/plugin/Config.dhall
@@ -0,0 +1,9 @@
1< CorrelationId :
2 { header_name : Text, echo_downstream : Bool }
3| RequestTransformer :
4 { `add.headers` : Text }
5| RequestTermination :
6 { status_code : Natural, content_type : Text, body : Text }
7| IPRestriction :
8 { whitelist : Text }
9>
diff --git a/dhall/server/service/plugin/CorrelationId.dhall b/dhall/server/service/plugin/CorrelationId.dhall
new file mode 100644
index 0000000..d96bfc9
--- /dev/null
+++ b/dhall/server/service/plugin/CorrelationId.dhall
@@ -0,0 +1,11 @@
1 let Plugin = ./Plugin.dhall
2
3in let config = constructors ./Config.dhall
4
5in { name =
6 "correlation-id"
7 , config =
8 config.CorrelationId
9 { header_name = "X-correl", echo_downstream = True }
10 }
11 : Plugin
diff --git a/dhall/server/service/plugin/Plugin.dhall b/dhall/server/service/plugin/Plugin.dhall
new file mode 100644
index 0000000..548061c
--- /dev/null
+++ b/dhall/server/service/plugin/Plugin.dhall
@@ -0,0 +1 @@
let Config = ./Config.dhall in { name : Text, config : Config }
diff --git a/dhall/server/service/plugin/functions.dhall b/dhall/server/service/plugin/functions.dhall
new file mode 100644
index 0000000..dcf2c9a
--- /dev/null
+++ b/dhall/server/service/plugin/functions.dhall
@@ -0,0 +1,9 @@
1{ mkRequestTermination =
2 ./mkRequestTermination.dhall
3, mkRequestTransformer =
4 ./mkRequestTransformer.dhall
5, mkIPRestriction =
6 ./mkIPRestriction.dhall
7, CorrelationId =
8 ./CorrelationId.dhall
9}
diff --git a/dhall/server/service/plugin/mkIPRestriction.dhall b/dhall/server/service/plugin/mkIPRestriction.dhall
new file mode 100644
index 0000000..f803769
--- /dev/null
+++ b/dhall/server/service/plugin/mkIPRestriction.dhall
@@ -0,0 +1,11 @@
1 let Plugin = ./Plugin.dhall
2
3in let config = constructors ./Config.dhall
4
5in λ(whiteList : Text)
6 → { name =
7 "ip-restriction"
8 , config =
9 config.IPRestriction { whitelist = whiteList }
10 }
11 : Plugin
diff --git a/dhall/server/service/plugin/mkRequestTermination.dhall b/dhall/server/service/plugin/mkRequestTermination.dhall
new file mode 100644
index 0000000..aff538f
--- /dev/null
+++ b/dhall/server/service/plugin/mkRequestTermination.dhall
@@ -0,0 +1,20 @@
1 let Plugin = ./Plugin.dhall
2
3in let config = constructors ./Config.dhall
4
5in λ(statusCode : Natural)
6 → λ(contentType : Text)
7 → λ(body : Text)
8 → { name =
9 "request-termination"
10 , config =
11 config.RequestTermination
12 { status_code =
13 statusCode
14 , content_type =
15 contentType
16 , body =
17 body
18 }
19 }
20 : Plugin
diff --git a/dhall/server/service/plugin/mkRequestTransformer.dhall b/dhall/server/service/plugin/mkRequestTransformer.dhall
new file mode 100644
index 0000000..90789c8
--- /dev/null
+++ b/dhall/server/service/plugin/mkRequestTransformer.dhall
@@ -0,0 +1,11 @@
1 let Plugin = ./Plugin.dhall
2
3in let config = constructors ./Config.dhall
4
5in λ(header : Text)
6 → { name =
7 "request-transformer"
8 , config =
9 config.RequestTransformer { `add.headers` = header }
10 }
11 : Plugin
diff --git a/dhall/server/service/route/Route.dhall b/dhall/server/service/route/Route.dhall
new file mode 100644
index 0000000..c0fa1a9
--- /dev/null
+++ b/dhall/server/service/route/Route.dhall
@@ -0,0 +1 @@
{ paths : List Text, protocols : List Text, hosts : List Text }