From 42e5588b7feb13e90964b5371fb9f1bdcfaf793a Mon Sep 17 00:00:00 2001 From: Paul Bonaud Date: Thu, 8 Aug 2019 15:51:47 +0200 Subject: config(dhall): add parameter 'generator' to CorrelationID plugin This PR adds possibility to define a custom `generator` to use in the CorrelationID plugin. The default value ("uuid#counter") is taken from Kong directly https://docs.konghq.com/hub/kong-inc/correlation-id/#parameters --- dhall/server/service/plugin/CorrelationId.dhall | 26 ++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'dhall/server/service/plugin/CorrelationId.dhall') diff --git a/dhall/server/service/plugin/CorrelationId.dhall b/dhall/server/service/plugin/CorrelationId.dhall index 655cd8d..fc69f4f 100644 --- a/dhall/server/service/plugin/CorrelationId.dhall +++ b/dhall/server/service/plugin/CorrelationId.dhall @@ -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 -- cgit v1.2.3