diff options
-rw-r--r-- | dhall/server/service/plugin/Config.dhall | 11 | ||||
-rw-r--r-- | dhall/server/service/plugin/functions.dhall | 6 | ||||
-rw-r--r-- | dhall/server/service/plugin/mkPreFunction.dhall | 9 | ||||
-rw-r--r-- | dhall/server/service/plugin/package.dhall | 7 |
4 files changed, 21 insertions, 12 deletions
diff --git a/dhall/server/service/plugin/Config.dhall b/dhall/server/service/plugin/Config.dhall index ea53361..1f60080 100644 --- a/dhall/server/service/plugin/Config.dhall +++ b/dhall/server/service/plugin/Config.dhall | |||
@@ -1,9 +1,8 @@ | |||
1 | < CorrelationId : | 1 | < CorrelationId : |
2 | { header_name : Text, echo_downstream : Bool, generator : Text } | 2 | { header_name : Text, echo_downstream : Bool, generator : Text } |
3 | | RequestTransformer : | 3 | | RequestTransformer : { add : { headers : List Text } } |
4 | { add : { headers : List Text } } | ||
5 | | RequestTermination : | 4 | | RequestTermination : |
6 | { status_code : Natural, content_type : Text, body : Text } | 5 | { status_code : Natural, content_type : Text, body : Text } |
7 | | IPRestriction : | 6 | | IPRestriction : { whitelist : Text } |
8 | { whitelist : Text } | 7 | | PreFunction : { functions : List Text } |
9 | > | 8 | > |
diff --git a/dhall/server/service/plugin/functions.dhall b/dhall/server/service/plugin/functions.dhall new file mode 100644 index 0000000..a7b1295 --- /dev/null +++ b/dhall/server/service/plugin/functions.dhall | |||
@@ -0,0 +1,6 @@ | |||
1 | { mkRequestTermination = ./mkRequestTermination.dhall | ||
2 | , mkRequestTransformer = ./mkRequestTransformer.dhall | ||
3 | , mkIPRestriction = ./mkIPRestriction.dhall | ||
4 | , correlationId = ./correlationId.dhall | ||
5 | , mkPreFunction = ./mkPreFunction.dhall | ||
6 | } | ||
diff --git a/dhall/server/service/plugin/mkPreFunction.dhall b/dhall/server/service/plugin/mkPreFunction.dhall new file mode 100644 index 0000000..ff4f734 --- /dev/null +++ b/dhall/server/service/plugin/mkPreFunction.dhall | |||
@@ -0,0 +1,9 @@ | |||
1 | let Plugin = ./Plugin.dhall | ||
2 | |||
3 | let config = ./Config.dhall | ||
4 | |||
5 | in λ(functions : List Text) | ||
6 | → { name = "pre-function" | ||
7 | , config = config.PreFunction { functions = functions } | ||
8 | } | ||
9 | : Plugin | ||
diff --git a/dhall/server/service/plugin/package.dhall b/dhall/server/service/plugin/package.dhall index 872c53b..c231bc6 100644 --- a/dhall/server/service/plugin/package.dhall +++ b/dhall/server/service/plugin/package.dhall | |||
@@ -1,6 +1 @@ | |||
1 | { Type = ./Plugin.dhall | { Type = ./Plugin.dhall, functions = ./functions.dhall } | |
2 | , mkRequestTermination = ./mkRequestTermination.dhall | ||
3 | , mkRequestTransformer = ./mkRequestTransformer.dhall | ||
4 | , mkIPRestriction = ./mkIPRestriction.dhall | ||
5 | , correlationId = ./correlationId.dhall | ||
6 | } | ||