Changeset

11039:ec6919401790

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.
author Kim Alvefur <zash@zash.se>
date Sat, 25 Jul 2020 12:22:03 +0200
parents 11038:efefdf71373b
children 11040:c560531d9a6e
files plugins/mod_external_services.lua
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- 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;