Comparison

plugins/mod_external_services.lua @ 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
parent 11038:efefdf71373b
child 11040:c560531d9a6e
comparison
equal deleted inserted replaced
11038:efefdf71373b 11039:ec6919401790
82 srv.expires = item.expires; 82 srv.expires = item.expires;
83 elseif type(item.ttl) == "number" then 83 elseif type(item.ttl) == "number" then
84 srv.expires = os.time() + item.ttl; 84 srv.expires = os.time() + item.ttl;
85 end 85 end
86 if (item.secret == true and default_secret) or type(item.secret) == "string" then 86 if (item.secret == true and default_secret) or type(item.secret) == "string" then
87 local secret_cb = algorithms[item.algorithm] or algorithms[srv.type]; 87 local secret_cb = item.credentials_cb or algorithms[item.algorithm] or algorithms[srv.type];
88 local secret = item.secret; 88 local secret = item.secret;
89 if secret == true then 89 if secret == true then
90 secret = default_secret; 90 secret = default_secret;
91 end 91 end
92 if secret_cb then 92 if secret_cb then