]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: add account_id to RGWUserInfo
authorCasey Bodley <cbodley@redhat.com>
Wed, 1 Nov 2023 19:48:33 +0000 (15:48 -0400)
committerCasey Bodley <cbodley@redhat.com>
Fri, 12 Apr 2024 19:34:26 +0000 (15:34 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 3f1cd1b44a8ef60c6f8fd460df5559145a059930)

src/rgw/rgw_common.cc
src/rgw/rgw_common.h

index ea93ad889fbfa4d372a5cab7ad9e0c95b84c8737..e93efa12f8964562cbce638a69a9d22429f43498 100644 (file)
@@ -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);
 }
 
 
index 1b84391d7132e2df5e6f70d4d9ac52816960fe26..8f023d1225e67d2c9641059edcc62287723e57d8 100644 (file)
@@ -579,6 +579,7 @@ struct RGWUserInfo
   RGWQuota quota;
   uint32_t type;
   std::set<std::string> 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;