diff options
author | Yehuda Sadeh <yehuda@inktank.com> | 2013-05-20 12:13:31 -0700 |
---|---|---|
committer | Yehuda Sadeh <yehuda@inktank.com> | 2013-05-20 12:13:31 -0700 |
commit | a7096f8f07607e1bb17666a0ec0d9f275ef332e9 (patch) | |
tree | a73a6abc5972f9b1953531c28abf541b0adb857d | |
parent | 0f4c67f1b5a4e6a870be56dfe268a018196d526f (diff) | |
download | ceph-a7096f8f07607e1bb17666a0ec0d9f275ef332e9.tar.gz |
rgw: add access key to zone info
Signed-off-by: Yehuda Sadeh <yehuda@inktank.com>
-rw-r--r-- | src/rgw/rgw_common.h | 1 | ||||
-rw-r--r-- | src/rgw/rgw_json_enc.cc | 15 | ||||
-rw-r--r-- | src/rgw/rgw_rados.h | 8 |
3 files changed, 22 insertions, 2 deletions
diff --git a/src/rgw/rgw_common.h b/src/rgw/rgw_common.h index 1403f655e8f..fcbef98fc7f 100644 --- a/src/rgw/rgw_common.h +++ b/src/rgw/rgw_common.h @@ -309,6 +309,7 @@ struct RGWAccessKey { DECODE_FINISH(bl); } void dump(Formatter *f) const; + void dump_plain(Formatter *f) const; void dump(Formatter *f, const string& user, bool swift) const; static void generate_test_instances(list<RGWAccessKey*>& o); diff --git a/src/rgw/rgw_json_enc.cc b/src/rgw/rgw_json_enc.cc index 03075458318..74042116967 100644 --- a/src/rgw/rgw_json_enc.cc +++ b/src/rgw/rgw_json_enc.cc @@ -176,6 +176,19 @@ void RGWAccessKey::dump(Formatter *f) const encode_json("subuser", subuser, f); } +void RGWAccessKey::dump_plain(Formatter *f) const +{ + encode_json("access_key", id, f); + encode_json("secret_key", key, f); +} + +void encode_json_plain(const char *name, const RGWAccessKey& val, Formatter *f) +{ + f->open_object_section(name); + val.dump_plain(f); + f->close_section(); +} + void RGWAccessKey::dump(Formatter *f, const string& user, bool swift) const { string u = user; @@ -464,6 +477,7 @@ void RGWZoneParams::dump(Formatter *f) const encode_json("user_email_pool", user_email_pool.data_pool, f); encode_json("user_swift_pool", user_swift_pool.data_pool, f); encode_json("user_uid_pool ", user_uid_pool.data_pool, f); + encode_json_plain("system_key", system_key, f); } static void decode_json(const char *field, rgw_bucket& bucket, JSONObj *obj) @@ -488,6 +502,7 @@ void RGWZoneParams::decode_json(JSONObj *obj) ::decode_json("user_email_pool", user_email_pool, obj); ::decode_json("user_swift_pool", user_swift_pool, obj); ::decode_json("user_uid_pool ", user_uid_pool, obj); + JSONDecoder::decode_json("system_key", system_key, obj); } void RGWZone::dump(Formatter *f) const diff --git a/src/rgw/rgw_rados.h b/src/rgw/rgw_rados.h index f487a98b7d5..d4733aef842 100644 --- a/src/rgw/rgw_rados.h +++ b/src/rgw/rgw_rados.h @@ -268,6 +268,8 @@ struct RGWZoneParams { string name; + RGWAccessKey system_key; + static string get_pool_name(CephContext *cct); void init_name(CephContext *cct, RGWRegion& region); int init(CephContext *cct, RGWRados *store, RGWRegion& region); @@ -275,7 +277,7 @@ struct RGWZoneParams { int store_info(CephContext *cct, RGWRados *store, RGWRegion& region); void encode(bufferlist& bl) const { - ENCODE_START(2, 1, bl); + ENCODE_START(3, 1, bl); ::encode(domain_root, bl); ::encode(control_pool, bl); ::encode(gc_pool, bl); @@ -291,7 +293,7 @@ struct RGWZoneParams { } void decode(bufferlist::iterator& bl) { - DECODE_START(2, bl); + DECODE_START(3, bl); ::decode(domain_root, bl); ::decode(control_pool, bl); ::decode(gc_pool, bl); @@ -304,6 +306,8 @@ struct RGWZoneParams { ::decode(user_uid_pool, bl); if (struct_v >= 2) ::decode(name, bl); + if (struct_v >= 3) + ::decode(system_key, bl); DECODE_FINISH(bl); } void dump(Formatter *f) const; |