Diff

mod_sasl2/mod_sasl2.lua @ 5261:6526b670e66d

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.
author Matthew Wild <mwild1@gmail.com>
date Tue, 21 Mar 2023 15:26:03 +0000
parent 5249:828e5e443613
child 5913:2597e2113561
line wrap: on
line diff
--- 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);