]> git.apps.os.sepia.ceph.com Git - ceph.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>
Wed, 10 Apr 2024 16:53:04 +0000 (12:53 -0400)
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_common.cc
src/rgw/rgw_common.h

index b47b1ba749d586b43f856eb11e5c16bd889260b8..538f8d50b33fa39f5a7c5e0539fb935344f297fe 100644 (file)
@@ -2794,6 +2794,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)
@@ -2845,6 +2846,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 cb613b23b8d9ff28bbe844b8984fccd1cb09888d..f9adb2d1a83383be53536e9a0bb3d4c9f0b58ee6 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;