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.
--- 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;