From 510bbe2eabf63a34f5f4eeb842eee21c69c38c83 Mon Sep 17 00:00:00 2001 From: "Adam C. Emerson" Date: Thu, 28 Mar 2019 21:57:54 -0400 Subject: [PATCH] auth: Update KeyRing.h to work without using namespace Signed-off-by: Adam C. Emerson --- src/auth/KeyRing.h | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/src/auth/KeyRing.h b/src/auth/KeyRing.h index df5ebecf66e..551ff7acc96 100644 --- a/src/auth/KeyRing.h +++ b/src/auth/KeyRing.h @@ -20,11 +20,11 @@ class CephContext; class KeyRing : public KeyStore { - map keys; + std::map keys; - int set_modifier(const char *type, const char *val, EntityName& name, map& caps); + int set_modifier(const char *type, const char *val, EntityName& name, std::map& caps); public: - void decode_plaintext(bufferlist::const_iterator& bl); + void decode_plaintext(ceph::buffer::list::const_iterator& bl); /* Create a KeyRing from a Ceph context. * We will use the configuration stored inside the context. */ int from_ceph_context(CephContext *cct); @@ -32,10 +32,10 @@ public: /* Create an empty KeyRing */ static KeyRing *create_empty(); - map& get_keys() { return keys; } // yuck + std::map& get_keys() { return keys; } // yuck int load(CephContext *cct, const std::string &filename); - void print(ostream& out); + void print(std::ostream& out); // accessors bool exists(const EntityName& name) const { @@ -43,14 +43,14 @@ public: return p != keys.end(); } bool get_auth(const EntityName& name, EntityAuth &a) const { - map::const_iterator k = keys.find(name); + std::map::const_iterator k = keys.find(name); if (k == keys.end()) return false; a = k->second; return true; } bool get_secret(const EntityName& name, CryptoKey& secret) const override { - map::const_iterator k = keys.find(name); + std::map::const_iterator k = keys.find(name); if (k == keys.end()) return false; secret = k->second.key; @@ -62,10 +62,10 @@ public: } bool get_caps(const EntityName& name, const std::string& type, AuthCapsInfo& caps) const { - map::const_iterator k = keys.find(name); + std::map::const_iterator k = keys.find(name); if (k == keys.end()) return false; - map::const_iterator i = k->second.caps.find(type); + std::map::const_iterator i = k->second.caps.find(type); if (i != k->second.caps.end()) { caps.caps = i->second; } @@ -87,7 +87,7 @@ public: void remove(const EntityName& name) { keys.erase(name); } - void set_caps(EntityName& name, map& caps) { + void set_caps(EntityName& name, std::map& caps) { keys[name].caps = caps; } void set_key(EntityName& ename, CryptoKey& key) { @@ -96,16 +96,16 @@ public: void import(CephContext *cct, KeyRing& other); // encoders - void decode(bufferlist::const_iterator& bl); + void decode(ceph::buffer::list::const_iterator& bl); - void encode_plaintext(bufferlist& bl); - void encode_formatted(string label, Formatter *f, bufferlist& bl); + void encode_plaintext(ceph::buffer::list& bl); + void encode_formatted(std::string label, ceph::Formatter *f, ceph::buffer::list& bl); }; // don't use WRITE_CLASS_ENCODER macro because we don't have an encode // macro. don't juse encode_plaintext in that case because it is not -// wrappable; it assumes it gets the entire bufferlist. -static inline void decode(KeyRing& kr, bufferlist::const_iterator& p) { +// wrappable; it assumes it gets the entire ceph::buffer::list. +static inline void decode(KeyRing& kr, ceph::buffer::list::const_iterator& p) { kr.decode(p); } -- 2.47.3