Software /
code /
prosody-modules
Comparison
mod_client_management/mod_client_management.lua @ 5516:f25df3af02c1
mod_client_management: Include client software version number in listing
Should you ever wish to revoke a client by version number, e.g. for
security reasons affecting certain versions, then it would be good to at
the very least see which version is used.
Also includes the OAuth2 software ID, an optional unique identifier that
should be the same for all installations of a particular software.
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Sat, 03 Jun 2023 19:21:39 +0200 |
parent | 5374:d9397d6a5513 |
child | 5582:825c6fb76c48 |
comparison
equal
deleted
inserted
replaced
5515:f5931ce9b6ca | 5516:f25df3af02c1 |
---|---|
33 local sasl_agent = sasl_handler and sasl_handler.user_agent; | 33 local sasl_agent = sasl_handler and sasl_handler.user_agent; |
34 local token_agent = token_info and token_info.data and token_info.data.oauth2_client; | 34 local token_agent = token_info and token_info.data and token_info.data.oauth2_client; |
35 if not (sasl_agent or token_agent) then return; end | 35 if not (sasl_agent or token_agent) then return; end |
36 return { | 36 return { |
37 software = sasl_agent and sasl_agent.software or token_agent and token_agent.name or nil; | 37 software = sasl_agent and sasl_agent.software or token_agent and token_agent.name or nil; |
38 software_id = token_agent and token_agent.id or nil; | |
39 software_version = token_agent and token_agent.version or nil; | |
38 uri = token_agent and token_agent.uri or nil; | 40 uri = token_agent and token_agent.uri or nil; |
39 device = sasl_agent and sasl_agent.device or nil; | 41 device = sasl_agent and sasl_agent.device or nil; |
40 }; | 42 }; |
41 end | 43 end |
42 | 44 |
346 end | 348 end |
347 | 349 |
348 local user_agent = st.stanza("user-agent"); | 350 local user_agent = st.stanza("user-agent"); |
349 if client.user_agent then | 351 if client.user_agent then |
350 if client.user_agent.software then | 352 if client.user_agent.software then |
351 user_agent:text_tag("software", client.user_agent.software); | 353 user_agent:text_tag("software", client.user_agent.software, { id = client.user_agent.software_id; version = client.user_agent.software_version }); |
352 end | 354 end |
353 if client.user_agent.device then | 355 if client.user_agent.device then |
354 user_agent:text_tag("device", client.user_agent.device); | 356 user_agent:text_tag("device", client.user_agent.device); |
355 end | 357 end |
356 if client.user_agent.uri then | 358 if client.user_agent.uri then |