]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: functionality to modify mfa entries in user metadata
authorYehuda Sadeh <yehuda@redhat.com>
Mon, 4 Dec 2017 08:06:35 +0000 (00:06 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Mon, 9 Apr 2018 14:01:02 +0000 (07:01 -0700)
Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_user.cc
src/rgw/rgw_user.h

index 2bf7bbe6a691199def910fe07af2dc76534a5a5d..f2d418612369415e3cf42d4e3abb775579b2cf90 100644 (file)
@@ -2255,6 +2255,10 @@ int RGWUser::execute_modify(RGWUserAdminOpState& op_state, std::string *err_msg)
 
     } while (is_truncated);
   }
+
+  if (op_state.mfa_ids_specified) {
+    user_info.mfa_ids = op_state.mfa_ids;
+  }
   op_state.set_user_info(user_info);
 
   // if we're supposed to modify keys, do so
index 99455105e0dbc2c00b07bfbbd4cf11503e2c49e0..c9bca868bd4e00f395bad85e0500af54857dc0a4 100644 (file)
@@ -180,6 +180,8 @@ struct RGWUserAdminOpState {
   std::string key; // secret key
   int32_t key_type;
 
+  std::set<string> mfa_ids;
+
   // operation attributes
   bool existing_user;
   bool existing_key;
@@ -209,6 +211,7 @@ struct RGWUserAdminOpState {
   bool found_by_uid; 
   bool found_by_email;  
   bool found_by_key;
+  bool mfa_ids_specified;
  
   // req parameters
   bool populated;
@@ -389,6 +392,11 @@ struct RGWUserAdminOpState {
     user_quota_specified = true;
   }
 
+  void set_mfa_ids(const std::set<string>& ids) {
+    mfa_ids = ids;
+    mfa_ids_specified = true;
+  }
+
   bool is_populated() { return populated; }
   bool is_initialized() { return initialized; }
   bool has_existing_user() { return existing_user; }
@@ -425,6 +433,7 @@ struct RGWUserAdminOpState {
   uint32_t get_op_mask() { return op_mask; }
   RGWQuotaInfo& get_bucket_quota() { return bucket_quota; }
   RGWQuotaInfo& get_user_quota() { return user_quota; }
+  set<string>& get_mfa_ids() { return mfa_ids; }
 
   rgw_user& get_user_id() { return user_id; }
   std::string get_subuser() { return subuser; }
@@ -524,6 +533,7 @@ struct RGWUserAdminOpState {
     found_by_uid = false;
     found_by_email = false;
     found_by_key = false;
+    mfa_ids_specified = false;
   }
 };