comparison mod_sasl2_fast/mod_sasl2_fast.lua @ 5303:b10a7082b3c3

mod_sasl2_fast: Add API method to revoke FAST tokens for a given client
author Matthew Wild <mwild1@gmail.com>
date Wed, 05 Apr 2023 19:38:59 +0100
parents 4834eaf24fc1
children
comparison
equal deleted inserted replaced
5302:ba94a5301985 5303:b10a7082b3c3
243 if new and new.expires_at >= curr_time and (not last_password_change or last_password_change < new.issued_at) then 243 if new and new.expires_at >= curr_time and (not last_password_change or last_password_change < new.issued_at) then
244 return true; 244 return true;
245 end 245 end
246 return false; 246 return false;
247 end 247 end
248
249 function revoke_fast_tokens(username, client_id)
250 local client_id_hash = hash.sha256(client_id, true);
251 local cur_ok = token_store:set(username, client_id_hash.."-cur", nil);
252 local new_ok = token_store:set(username, client_id_hash.."-new", nil);
253 return cur_ok and new_ok;
254 end