# HG changeset patch # User Kim Alvefur # Date 1595672523 -7200 # Node ID ec6919401790ad3162697bc338956ecc296030ea # Parent efefdf71373b7501a425a17c7c508758cb4fa3b6 mod_external_services: Allow specifying a credential generation callback This is especially targeted at services added via the items API. More involved credential generation should use the event hook. diff -r efefdf71373b -r ec6919401790 plugins/mod_external_services.lua --- a/plugins/mod_external_services.lua Sat Jul 25 12:09:19 2020 +0200 +++ b/plugins/mod_external_services.lua Sat Jul 25 12:22:03 2020 +0200 @@ -84,7 +84,7 @@ srv.expires = os.time() + item.ttl; end if (item.secret == true and default_secret) or type(item.secret) == "string" then - local secret_cb = algorithms[item.algorithm] or algorithms[srv.type]; + local secret_cb = item.credentials_cb or algorithms[item.algorithm] or algorithms[srv.type]; local secret = item.secret; if secret == true then secret = default_secret;