From: Casey Bodley Date: Wed, 1 Nov 2023 19:48:33 +0000 (-0400) Subject: rgw: add account_id to RGWUserInfo X-Git-Tag: v19.1.0~99^2~158 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=c7c68e22ea91f94bafc612ab09d05bc6efe58dc3;p=ceph.git rgw: add account_id to RGWUserInfo Signed-off-by: Casey Bodley (cherry picked from commit 3f1cd1b44a8ef60c6f8fd460df5559145a059930) --- diff --git a/src/rgw/rgw_common.cc b/src/rgw/rgw_common.cc index ea93ad889fb..e93efa12f89 100644 --- a/src/rgw/rgw_common.cc +++ b/src/rgw/rgw_common.cc @@ -2793,6 +2793,7 @@ void RGWUserInfo::dump(Formatter *f) const } encode_json("type", user_source_type, f); encode_json("mfa_ids", mfa_ids, f); + encode_json("account_id", account_id, f); } void RGWUserInfo::decode_json(JSONObj *obj) @@ -2844,6 +2845,7 @@ void RGWUserInfo::decode_json(JSONObj *obj) type = TYPE_NONE; } JSONDecoder::decode_json("mfa_ids", mfa_ids, obj); + JSONDecoder::decode_json("account_id", account_id, obj); } diff --git a/src/rgw/rgw_common.h b/src/rgw/rgw_common.h index 1b84391d713..8f023d1225e 100644 --- a/src/rgw/rgw_common.h +++ b/src/rgw/rgw_common.h @@ -579,6 +579,7 @@ struct RGWUserInfo RGWQuota quota; uint32_t type; std::set mfa_ids; + rgw_account_id account_id; RGWUserInfo() : suspended(0), @@ -601,7 +602,7 @@ struct RGWUserInfo } void encode(bufferlist& bl) const { - ENCODE_START(22, 9, bl); + ENCODE_START(23, 9, bl); encode((uint64_t)0, bl); // old auid std::string access_key; std::string secret_key; @@ -648,10 +649,11 @@ struct RGWUserInfo encode(assumed_role_arn, bl); } encode(user_id.ns, bl); + encode(account_id, bl); ENCODE_FINISH(bl); } void decode(bufferlist::const_iterator& bl) { - DECODE_START_LEGACY_COMPAT_LEN_32(22, 9, 9, bl); + DECODE_START_LEGACY_COMPAT_LEN_32(23, 9, 9, bl); if (struct_v >= 2) { uint64_t old_auid; decode(old_auid, bl); @@ -738,6 +740,9 @@ struct RGWUserInfo } else { user_id.ns.clear(); } + if (struct_v >= 23) { + decode(account_id, bl); + } DECODE_FINISH(bl); } void dump(Formatter *f) const;