]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
auth: Update KeyRing.h to work without using namespace
authorAdam C. Emerson <aemerson@redhat.com>
Fri, 29 Mar 2019 01:57:54 +0000 (21:57 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Fri, 29 Mar 2019 14:30:38 +0000 (10:30 -0400)
Signed-off-by: Adam C. Emerson <aemerson@redhat.com>
src/auth/KeyRing.h

index df5ebecf66e081c8b418b67fb8b2c23858f12f6c..551ff7acc96d3a9dc9a909909806141c36e518e9 100644 (file)
 class CephContext;
 
 class KeyRing : public KeyStore {
-  map<EntityName, EntityAuth> keys;
+  std::map<EntityName, EntityAuth> keys;
 
-  int set_modifier(const char *type, const char *val, EntityName& name, map<string, bufferlist>& caps);
+  int set_modifier(const char *type, const char *val, EntityName& name, std::map<std::string, ceph::buffer::list>& 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<EntityName, EntityAuth>& get_keys() { return keys; }  // yuck
+  std::map<EntityName, EntityAuth>& 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<EntityName, EntityAuth>::const_iterator k = keys.find(name);
+    std::map<EntityName, EntityAuth>::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<EntityName, EntityAuth>::const_iterator k = keys.find(name);
+    std::map<EntityName, EntityAuth>::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<EntityName, EntityAuth>::const_iterator k = keys.find(name);
+    std::map<EntityName, EntityAuth>::const_iterator k = keys.find(name);
     if (k == keys.end())
       return false;
-    map<string,bufferlist>::const_iterator i = k->second.caps.find(type);
+    std::map<std::string,ceph::buffer::list>::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<string, bufferlist>& caps) {
+  void set_caps(EntityName& name, std::map<std::string, ceph::buffer::list>& 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);
 }