diff options
Diffstat (limited to 'dhall/server')
-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 | ||