Comparison

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
comparison
equal deleted inserted replaced
5260:a9c1cc91d3d6 5261:6526b670e66d
206 return handle_status(session, "failure", "invalid-mechanism"); 206 return handle_status(session, "failure", "invalid-mechanism");
207 end 207 end
208 local user_agent = auth:get_child("user-agent"); 208 local user_agent = auth:get_child("user-agent");
209 if user_agent then 209 if user_agent then
210 session.client_id = user_agent.attr.id; 210 session.client_id = user_agent.attr.id;
211 sasl_handler.user_agent = {
212 software = user_agent:get_child_text("software");
213 device = user_agent:get_child_text("device");
214 };
211 end 215 end
212 local initial = auth:get_child_text("initial-response"); 216 local initial = auth:get_child_text("initial-response");
213 return process_cdata(session, initial); 217 return process_cdata(session, initial);
214 end); 218 end);
215 219