Skip to content

Commit

Permalink
Merge pull request #20 from paulrbr-fl/add-response-transformer-plugin
Browse files Browse the repository at this point in the history
dhall(plugins): add binding for the 'response-transformer' plugin
  • Loading branch information
paulrbr-fl authored Aug 24, 2020
2 parents f131496 + 2187c77 commit 258e009
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions dhall/server/service/plugin/Config.dhall
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
< CorrelationId :
{ header_name : Text, echo_downstream : Bool, generator : Text }
| RequestTransformer : { add : { headers : List Text } }
| ResponseTransformer : { add : { headers : List Text } }
| RequestTermination :
{ status_code : Natural, content_type : Text, body : Text }
| IPRestriction : { whitelist : Text }
Expand Down
1 change: 1 addition & 0 deletions dhall/server/service/plugin/functions.dhall
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{ mkRequestTermination = ./mkRequestTermination.dhall
, mkRequestTransformer = ./mkRequestTransformer.dhall
, mkResponseTransformer = ./mkResponseTransformer.dhall
, mkIPRestriction = ./mkIPRestriction.dhall
, correlationId = ./correlationId.dhall
, mkPreFunction = ./mkPreFunction.dhall
Expand Down
9 changes: 9 additions & 0 deletions dhall/server/service/plugin/mkResponseTransformer.dhall
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
let Plugin = ./Plugin.dhall

let config = ./Config.dhall

in λ(header : Text)
{ name = "response-transformer"
, config = config.ResponseTransformer { add.headers = [ header ] }
}
: Plugin

0 comments on commit 258e009

Please sign in to comment.