Hi! There is a note in the <Webhooks and Callbacks...
# general
b
Hi! There is a note in the Webhooks and Callbacks documentation that says "_Webhook templates currently do not support system or environment variables."_ What does this actually mean in terms of the Java and JSON DSLs (or Handlebars if that's the case)?
t
It just means that you can’t access system or env vars via Handlebars templating in the webhook fields that support it. This might actually be obsolete now that webhooks has moved to the core, so worth giving it a try.
b
Thanks. I'll give it a try then.
t
Please let me know what you find out, because if it’s changed I’ll delete that from the docs
b
Sure, I'll send you my findings.
t
Thanks
b
I tried the
systemValue
Handlebars helper with a system property in the method field, and after calling
Webhooks.applyTemplating()
on the
WebhookDefinition
the method field value becomes
[ERROR: Access to my.custom.property is denied]
.
t
Did you permit that property to be used in your startup configuration?
b
I was not aware that that was needed. Let me look into that part.
As I see,
Webhooks
is always initialized with TemplateEngine.defaultTemplateEngine(), thus the
TemplateEngine
it uses is always initialized with null
permittedSystemKeys
. and never permits any keys.
t
Ah, I thought I’d updated it to use injection. We can change that in the next release, then this will work.]
👍 1