mod_sasl2: Pull user-agent info into sasl_handler for later reference
It may be of interest to post-auth things. Putting it on the session was
another option considered, but that seemed unnecessary overhead for something
that might be rarely used. sasl_handler is cleared after successful
authentication.
--- a/mod_sasl2/mod_sasl2.lua Sun Mar 19 22:21:41 2023 +0100
+++ b/mod_sasl2/mod_sasl2.lua Tue Mar 21 15:26:03 2023 +0000
@@ -208,6 +208,10 @@
local user_agent = auth:get_child("user-agent");
if user_agent then
session.client_id = user_agent.attr.id;
+ sasl_handler.user_agent = {
+ software = user_agent:get_child_text("software");
+ device = user_agent:get_child_text("device");
+ };
end
local initial = auth:get_child_text("initial-response");
return process_cdata(session, initial);