0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-25 16:22:35 +01:00

ircd:Ⓜ️:keys: Improve pretty(m::keys) output order.

This commit is contained in:
Jason Volk 2020-10-15 21:36:45 -07:00
parent b9905a06a6
commit f0803714e5

View file

@ -20,14 +20,6 @@ ircd::m::pretty_oneline(std::ostream &s,
<< " (" << json::get<"valid_until_ts"_>(keys) << ")"
<< ' ';
for(const auto &[domain, signature_] : json::get<"signatures"_>(keys))
{
s << "sig[ " << domain << ' ';
for(const auto &[key_id, signature] : json::object(signature_))
s << key_id << ' ';
s << "] ";
}
for(const auto &[domain, verify_key_] : json::get<"verify_keys"_>(keys))
{
s << "key[ " << domain << ' ';
@ -36,6 +28,14 @@ ircd::m::pretty_oneline(std::ostream &s,
s << "] ";
}
for(const auto &[domain, signature_] : json::get<"signatures"_>(keys))
{
s << "sig[ " << domain << ' ';
for(const auto &[key_id, signature] : json::object(signature_))
s << key_id << ' ';
s << "] ";
}
return s;
}
@ -53,13 +53,6 @@ ircd::m::pretty(std::ostream &s,
<< " (" << json::get<"valid_until_ts"_>(keys) << ")"
<< '\n';
for(const auto &[domain, signature_] : json::get<"signatures"_>(keys))
for(const auto &[key_id, signature] : json::object(signature_))
s << std::setw(16) << std::right << "[signature] "
<< domain << ' '
<< key_id << ' '
<< unquote(signature) << '\n';
for(const auto &[domain, verify_key_] : json::get<"verify_keys"_>(keys))
for(const auto &[key_id, verify_key] : json::object(verify_key_))
s << std::setw(16) << std::right << "[verify_key] "
@ -67,6 +60,13 @@ ircd::m::pretty(std::ostream &s,
<< key_id << ' '
<< unquote(verify_key) << '\n';
for(const auto &[domain, signature_] : json::get<"signatures"_>(keys))
for(const auto &[key_id, signature] : json::object(signature_))
s << std::setw(16) << std::right << "[signature] "
<< domain << ' '
<< key_id << ' '
<< unquote(signature) << '\n';
for(const auto &[domain, old_verify_key_] : json::get<"old_verify_keys"_>(keys))
for(const auto &[key_id, old_verify_key] : json::object(old_verify_key_))
s << std::setw(16) << std::right << "[old_verify_key] "