| 136 | } |
| 137 | |
| 138 | void KeyRing::encode_formatted(string label, Formatter *f, bufferlist& bl) |
| 139 | { |
| 140 | f->open_array_section(label.c_str()); |
| 141 | for (const auto &[ename, eauth] : keys) { |
| 142 | f->open_object_section("auth_entities"); |
| 143 | f->dump_string("entity", ename.to_str().c_str()); |
| 144 | f->dump_string("key", stringify(eauth.key)); |
| 145 | if (!eauth.pending_key.empty()) { |
| 146 | f->dump_string("pending_key", stringify(eauth.pending_key)); |
| 147 | } |
| 148 | f->open_object_section("caps"); |
| 149 | for (auto& [sys, capsbl] : eauth.caps) { |
| 150 | auto dataiter = capsbl.cbegin(); |
| 151 | string caps; |
| 152 | ceph::decode(caps, dataiter); |
| 153 | f->dump_string(sys.c_str(), caps); |
| 154 | } |
| 155 | f->close_section(); /* caps */ |
| 156 | f->close_section(); /* auth_entities */ |
| 157 | } |
| 158 | f->close_section(); /* auth_dump */ |
| 159 | f->flush(bl); |
| 160 | } |
| 161 | |
| 162 | void KeyRing::decode(bufferlist::const_iterator& bli) |
| 163 | { |
nothing calls this directly
no test coverage detected