Mercurial > prosody-modules
diff 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 | 563c2c70cb9f |
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