From 7a2795f29320faf632d6c5b9ae3fde9d534eb477 Mon Sep 17 00:00:00 2001 From: Abhishek Lekshmanan Date: Thu, 1 Oct 2020 10:58:54 +0200 Subject: [PATCH] rgw: start using role_ctl Signed-off-by: Abhishek Lekshmanan --- src/rgw/rgw_role.cc | 10 ++++++++++ src/rgw/rgw_role.h | 5 ++++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_role.cc b/src/rgw/rgw_role.cc index dd0114d5a84..5398c900be8 100644 --- a/src/rgw/rgw_role.cc +++ b/src/rgw/rgw_role.cc @@ -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); diff --git a/src/rgw/rgw_role.h b/src/rgw/rgw_role.h index c1ac9a8756c..2fc39b13748 100644 --- a/src/rgw/rgw_role.h +++ b/src/rgw/rgw_role.h @@ -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 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; -- 2.39.5