]> git.immae.eu Git - github/fretlink/ansible-kong-app.git/commitdiff
Merge pull request #16 from paulrbr-fl/add-default-correlation-id v0.10
authorpaulrbr-fl <43074087+paulrbr-fl@users.noreply.github.com>
Thu, 8 Aug 2019 14:07:12 +0000 (16:07 +0200)
committerGitHub <noreply@github.com>
Thu, 8 Aug 2019 14:07:12 +0000 (16:07 +0200)
config(dhall): add parameter 'generator' to CorrelationID plugin

dhall/server/service/plugin/Config.dhall
dhall/server/service/plugin/CorrelationId.dhall

index d54436b065fe3edebd1875a4903f28f66d978c2d..ea53361976a12621e75edcecc4f94c6a5f133d5e 100644 (file)
@@ -1,9 +1,9 @@
 < CorrelationId :
-       { header_name : Text, echo_downstream : Bool }
+       { 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 }
->
\ No newline at end of file
+>
index 655cd8d792a7b7db28bad5e91be900ce822f6b8c..fc69f4ffef7dce98a7fd23c4cd34992c640f44c0 100644 (file)
@@ -2,10 +2,22 @@ let Plugin = ./Plugin.dhall
 
 let config = ./Config.dhall
 
-in    { name =
-                 "correlation-id"
-         , config =
-                 config.CorrelationId
-                 { header_name = "X-correl", echo_downstream = True }
-         }
-       : Plugin
+in    λ(generator : Optional Text)
+       →   { name =
+                       "correlation-id"
+               , config =
+                       config.CorrelationId
+                       { header_name =
+                               "X-correl"
+                       , echo_downstream =
+                               True
+                       , generator =
+                               Optional/fold
+                               Text
+                               generator
+                               Text
+                               (λ(t : Text) → t)
+                               "uuid#counter"
+                       }
+               }
+         : Plugin