comparison mod_admin_web/admin_web/mod_admin_web.lua @ 396:8cb21ef24e5d

mod_admin_web: Show S2S certificate validity
author Florian Zeitz <florob@babelmonkeys.de>
date Fri, 29 Jul 2011 22:26:02 +0200
parents 73001ddff453
children fc5df35a3fe4
comparison
equal deleted inserted replaced
395:77ca0947647b 396:8cb21ef24e5d
8 -- <encrypted/> 8 -- <encrypted/>
9 -- <compressed/> 9 -- <compressed/>
10 -- </session> 10 -- </session>
11 11
12 -- <session xmlns="http://prosody.im/streams/s2s" jid="example.com"> 12 -- <session xmlns="http://prosody.im/streams/s2s" jid="example.com">
13 -- <encrypted/> 13 -- <encrypted>
14 -- <valid/> / <invalid/>
15 -- </encrypted>
14 -- <compressed/> 16 -- <compressed/>
15 -- <in/> / <out/> 17 -- <in/> / <out/>
16 -- </session> 18 -- </session>
17 19
18 local st = require "util.stanza"; 20 local st = require "util.stanza";
84 idmap[name.."_"..type] = id; 86 idmap[name.."_"..type] = id;
85 end 87 end
86 local item = st.stanza("item", { id = id }):tag("session", {xmlns = xmlns_s2s_session, jid = name}) 88 local item = st.stanza("item", { id = id }):tag("session", {xmlns = xmlns_s2s_session, jid = name})
87 :tag(type):up(); 89 :tag(type):up();
88 if session.secure then 90 if session.secure then
89 item:tag("encrypted"):up(); 91 if session.cert_identity_status == "valid" then
92 item:tag("encrypted"):tag("valid"):up():up();
93 else
94 item:tag("encrypted"):tag("invalid"):up():up();
95 end
90 end 96 end
91 if session.compressed then 97 if session.compressed then
92 item:tag("compressed"):up(); 98 item:tag("compressed"):up();
93 end 99 end
94 service[host]:publish(xmlns_s2s_session, host, id, item); 100 service[host]:publish(xmlns_s2s_session, host, id, item);