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);
/* 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 {
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;
}
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;
}
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) {
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);
}