diff options
author | paulrbr-fl <43074087+paulrbr-fl@users.noreply.github.com> | 2020-08-24 13:18:06 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-08-24 13:18:06 +0200 |
commit | 258e0097c2bd26bd07887c9a27dc7d0548a03419 (patch) | |
tree | 05c889fa60f44042b92f04b7f0324ea3b2117e59 /dhall | |
parent | f131496c3e23d30c30dd597ab734b0f771f4a4d9 (diff) | |
parent | 2187c77a0f6b6d3e178e6d1a695bc954f57ecb72 (diff) | |
download | ansible-kong-app-0.32.tar.gz ansible-kong-app-0.32.tar.zst ansible-kong-app-0.32.zip |
Merge pull request #20 from paulrbr-fl/add-response-transformer-pluginv0.32
dhall(plugins): add binding for the 'response-transformer' plugin
Diffstat (limited to 'dhall')
-rw-r--r-- | dhall/server/service/plugin/Config.dhall | 1 | ||||
-rw-r--r-- | dhall/server/service/plugin/functions.dhall | 1 | ||||
-rw-r--r-- | dhall/server/service/plugin/mkResponseTransformer.dhall | 9 |
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 @@ | |||
1 | let Plugin = ./Plugin.dhall | ||
2 | |||
3 | let config = ./Config.dhall | ||
4 | |||
5 | in λ(header : Text) → | ||
6 | { name = "response-transformer" | ||
7 | , config = config.ResponseTransformer { add.headers = [ header ] } | ||
8 | } | ||
9 | : Plugin | ||