}
void dump(ceph::Formatter *f) const {
f->dump_object("key", key);
- encode_json("caps", caps, f);
f->dump_object("pending_key", pending_key);
+ f->open_array_section("caps");
+ for (auto const& [entity, cap] : caps) {
+ f->open_object_section("cap");
+ f->dump_string("service_name", entity);
+ f->dump_string("access_spec", cap.to_str());
+ f->close_section();
+ }
+ f->close_section();
}
static std::list<EntityAuth> generate_test_instances() {
std::list<EntityAuth> ls;
void dump();
void dump(ceph::Formatter *f) const {
- encode_json("secrets", secrets, f);
+ f->dump_int("max_ver", max_ver);
+ f->open_array_section("keys");
+ for (const auto& [id, key] : secrets) {
+ f->open_object_section("secret");
+ f->dump_int("id", id);
+ f->dump_object("expiring_key", key);
+ f->close_section();
+ }
+ f->close_section();
}
static std::list<RotatingSecrets> generate_test_instances() {
std::list<RotatingSecrets> ls;
*
*/
-#include <array>
-#include <sstream>
-#include <limits>
-#include <fcntl.h>
-
-#include <openssl/aes.h>
-#include <openssl/core_names.h>
#include "Crypto.h"
#include "include/ceph_assert.h"
+#include "include/ceph_fs.h"
+#include "include/compat.h"
+
#include "common/Clock.h"
+#include "common/Formatter.h"
#include "common/armor.h"
#include "common/ceph_context.h"
#include "common/ceph_crypto.h"
+#include "common/debug.h"
#include "common/hex.h"
#include "common/safe_io.h"
#include "include/ceph_fs.h"
#include <errno.h>
#include <boost/endian/conversion.hpp>
+#include <openssl/aes.h>
+#include <openssl/core_names.h>
+
+#include <array>
+#include <errno.h>
+#include <fcntl.h>
+#include <limits>
+#include <sstream>
#define dout_subsys ceph_subsys_auth
void CryptoKey::dump(Formatter *f) const
{
f->dump_int("type", type);
+ f->dump_string("type_str", CryptoManager::get_key_type_name(type));
f->dump_stream("created") << created;
- f->dump_int("secret.length", secret.length());
}
std::list<CryptoKey> CryptoKey::generate_test_instances()
void dump(ceph::Formatter *f) const {
f->dump_unsigned("version", version);
f->dump_unsigned("rotating_version", rotating_ver);
- encode_json("secrets", secrets, f);
- encode_json("rotating_secrets", rotating_secrets, f);
+ f->open_array_section("secrets");
+ for (auto const& [name, auth] : secrets) {
+ f->open_object_section("secret");
+ f->dump_object("entity", name);
+ f->dump_object("auth", auth);
+ f->close_section();
+ }
+ f->close_section();
+ f->open_array_section("rotating_secrets");
+ for (auto const& [entity_type, secrets] : rotating_secrets) {
+ f->open_object_section("rotating_secret");
+ auto name = EntityName(entity_type);
+ f->dump_object("entity", name);
+ f->dump_object("secrets", secrets);
+ f->close_section();
+ }
+ f->close_section();
}
static std::list<KeyServerData> generate_test_instances() {
std::list<KeyServerData> ls;