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
< 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
+>
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