]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: start using role_ctl
authorAbhishek Lekshmanan <abhishek@suse.com>
Thu, 1 Oct 2020 08:58:54 +0000 (10:58 +0200)
committerPritha Srivastava <prsrivas@redhat.com>
Mon, 6 Jun 2022 10:49:42 +0000 (16:19 +0530)
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
src/rgw/rgw_role.cc
src/rgw/rgw_role.h

index dd0114d5a84f754b97394972f724c4c345780e39..5398c900be88c625baa92a81b71410704ee204dd 100644 (file)
@@ -34,6 +34,16 @@ const string RGWRole::role_oid_prefix = "roles.";
 const string RGWRole::role_path_oid_prefix = "role_paths.";
 const string RGWRole::role_arn_prefix = "arn:aws:iam::";
 
+int RGWRole::store_info(const DoutPrefixProvider *dpp, bool exclusive, optional_yield y)
+{
+
+  return role_ctl->store_info(this,
+                             y,
+            dpp,
+                             RGWRoleCtl::PutParams().
+                             set_exclusive(exclusive));
+}
+
 int RGWRole::get(const DoutPrefixProvider *dpp, optional_yield y)
 {
   int ret = read_name(dpp, y);
index c1ac9a8756c64bf0da2034a58d7c7fb0465ec7b1..2fc39b1374852e2787c262ed589afd98f98fdd60 100644 (file)
@@ -17,6 +17,7 @@ class RGWRados;
 class RGWRoleMetadataHandler;
 class RGWSI_Role;
 class RGWSI_MetaBackend_Handler;
+class RGWRoleCtl;
 
 namespace rgw { namespace sal {
 class RGWRole
@@ -32,6 +33,8 @@ public:
   static constexpr uint64_t SESSION_DURATION_MAX = 43200; // in seconds
 protected:
 
+  RGWRoleCtl *role_ctl;
+
   std::string id;
   std::string name;
   std::string path;
@@ -44,7 +47,7 @@ protected:
   std::multimap<std::string,std::string> tags;
 
 public:
-  virtual int store_info(const DoutPrefixProvider *dpp, bool exclusive, optional_yield y) = 0;
+  virtual int store_info(const DoutPrefixProvider *dpp, bool exclusive, optional_yield y);
   virtual int store_name(const DoutPrefixProvider *dpp, bool exclusive, optional_yield y) = 0;
   virtual int store_path(const DoutPrefixProvider *dpp, bool exclusive, optional_yield y) = 0;
   virtual int read_id(const DoutPrefixProvider *dpp, const std::string& role_name, const std::string& tenant, std::string& role_id, optional_yield y) = 0;