]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/sts: AssumeRole no longer writes to user metadata
authorCasey Bodley <cbodley@redhat.com>
Thu, 20 Apr 2023 13:25:49 +0000 (09:25 -0400)
committerMykola Golub <mgolub@suse.com>
Wed, 14 Jun 2023 10:16:43 +0000 (13:16 +0300)
`storeARN()` was storing the role's ARN in `RGWUserInfo::assumed_role_arn`,
but that field was unused

Fixes: https://tracker.ceph.com/issues/59495
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 2f60200bf69b0814ce7d1ae7d217d5c37f99f80e)

Conflicts:
src/rgw/rgw_sts.cc (different storeARN signature)
src/rgw/rgw_sts.h (different storeARN signature)

src/rgw/rgw_sts.cc
src/rgw/rgw_sts.h

index f46d100354f0fa578c80c3f0a5e64fc3ebd08bde..22e067e0d77cc00a666506e8ba3f70c54b96b5a2 100644 (file)
@@ -316,24 +316,6 @@ std::tuple<int, RGWRole> STSService::getRoleInfo(const DoutPrefixProvider *dpp,
   }
 }
 
-int STSService::storeARN(const DoutPrefixProvider *dpp, string& arn, optional_yield y)
-{
-  int ret = 0;
-  RGWUserInfo info;
-  if (ret = rgw_get_user_info_by_uid(dpp, store->ctl()->user, user_id, info, y); ret < 0) {
-    return -ERR_NO_SUCH_ENTITY;
-  }
-
-  info.assumed_role_arn = arn;
-
-  RGWObjVersionTracker objv_tracker;
-  if (ret = rgw_store_user_info(dpp, store->ctl()->user, info, &info, &objv_tracker, real_time(),
-                               false, y); ret < 0) {
-    return -ERR_INTERNAL_ERROR;
-  }
-  return ret;
-}
-
 AssumeRoleWithWebIdentityResponse STSService::assumeRoleWithWebIdentity(AssumeRoleWithWebIdentityRequest& req)
 {
   AssumeRoleWithWebIdentityResponse response;
@@ -445,13 +427,6 @@ AssumeRoleResponse STSService::assumeRole(const DoutPrefixProvider *dpp,
     return response;
   }
 
-  //Save ARN with the user
-  string arn = response.user.getARN();
-  response.retCode = storeARN(dpp, arn, y);
-  if (response.retCode < 0) {
-    return response;
-  }
-
   response.retCode = 0;
   return response;
 }
index aca9e24d10dd1cd20752e5c40d32fb836d94da0c..d0326404ee848edb2839862b6b1668eb7195d365 100644 (file)
@@ -238,7 +238,6 @@ class STSService {
   rgw_user user_id;
   RGWRole role;
   rgw::auth::Identity* identity;
-  int storeARN(const DoutPrefixProvider *dpp, string& arn, optional_yield y);
 public:
   STSService() = default;
   STSService(CephContext* cct, rgw::sal::RGWRadosStore *store, rgw_user user_id,