]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: support admin rest api get user info 22790/head
authoryuliyang <yuliyang@cmss.chinamobile.com>
Mon, 2 Jul 2018 11:15:39 +0000 (19:15 +0800)
committeryuliyang <yuliyang@cmss.chinamobile.com>
Mon, 2 Jul 2018 11:15:39 +0000 (19:15 +0800)
through user's access-key

Signed-off-by: yuliyang <yuliyang@cmss.chinamobile.com>
src/rgw/rgw_rest_user.cc

index d8f4339d1a457ea4c30144c926d12dda68b7d1a4..5efb6a75760e329e7a03aa7c1627711a01b913f0 100644 (file)
@@ -30,16 +30,17 @@ void RGWOp_User_Info::execute()
 {
   RGWUserAdminOpState op_state;
 
-  std::string uid_str;
+  std::string uid_str, access_key_str;
   bool fetch_stats;
   bool sync_stats;
 
   RESTArgs::get_string(s, "uid", uid_str, &uid_str);
+  RESTArgs::get_string(s, "access-key", access_key_str, &access_key_str);
 
   // if uid was not supplied in rest argument, error out now, otherwise we'll
   // end up initializing anonymous user, for which keys.init will eventually
   // return -EACESS
-  if (uid_str.empty()){
+  if (uid_str.empty() && access_key_str.empty()){
     http_ret=-EINVAL;
     return;
   }
@@ -51,6 +52,7 @@ void RGWOp_User_Info::execute()
   RESTArgs::get_bool(s, "sync", false, &sync_stats);
 
   op_state.set_user_id(uid);
+  op_state.set_access_key(access_key_str);
   op_state.set_fetch_stats(fetch_stats);
   op_state.set_sync_stats(sync_stats);