Changeset

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 5302:ba94a5301985
children 5304:717ff9468464
files mod_sasl2_fast/mod_sasl2_fast.lua
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/mod_sasl2_fast/mod_sasl2_fast.lua	Tue Apr 04 18:09:48 2023 +0100
+++ b/mod_sasl2_fast/mod_sasl2_fast.lua	Wed Apr 05 19:38:59 2023 +0100
@@ -245,3 +245,10 @@
 	end
 	return false;
 end
+
+function revoke_fast_tokens(username, client_id)
+	local client_id_hash = hash.sha256(client_id, true);
+	local cur_ok = token_store:set(username, client_id_hash.."-cur", nil);
+	local new_ok = token_store:set(username, client_id_hash.."-new", nil);
+	return cur_ok and new_ok;
+end