< CorrelationId :
- { header_name : Text, echo_downstream : Bool, generator : Text }
-| RequestTransformer :
- { add : { headers : List Text } }
+ { header_name : Text, echo_downstream : Bool, generator : Text }
+| RequestTransformer : { add : { headers : List Text } }
| RequestTermination :
- { status_code : Natural, content_type : Text, body : Text }
-| IPRestriction :
- { whitelist : Text }
+ { status_code : Natural, content_type : Text, body : Text }
+| IPRestriction : { whitelist : Text }
+| PreFunction : { functions : List Text }
>
--- /dev/null
+{ mkRequestTermination = ./mkRequestTermination.dhall
+, mkRequestTransformer = ./mkRequestTransformer.dhall
+, mkIPRestriction = ./mkIPRestriction.dhall
+, correlationId = ./correlationId.dhall
+, mkPreFunction = ./mkPreFunction.dhall
+}
--- /dev/null
+let Plugin = ./Plugin.dhall
+
+let config = ./Config.dhall
+
+in λ(functions : List Text)
+ → { name = "pre-function"
+ , config = config.PreFunction { functions = functions }
+ }
+ : Plugin
-{ Type = ./Plugin.dhall
-, mkRequestTermination = ./mkRequestTermination.dhall
-, mkRequestTransformer = ./mkRequestTransformer.dhall
-, mkIPRestriction = ./mkIPRestriction.dhall
-, correlationId = ./correlationId.dhall
-}
+{ Type = ./Plugin.dhall, functions = ./functions.dhall }