summaryrefslogtreecommitdiffstats
path: root/src/rgw/driver/rados/rgw_rest_user.cc
diff options
context:
space:
mode:
authorCasey Bodley <cbodley@redhat.com>2023-12-17 17:11:13 +0100
committerCasey Bodley <cbodley@redhat.com>2024-04-10 19:09:14 +0200
commit828aa90a2b0070d043c67464a03529105d835db2 (patch)
treeae8a2f67dec6e7fe980c6f0a773328a2daf557bf /src/rgw/driver/rados/rgw_rest_user.cc
parentqa/rgw: create accounts for random s3test users (diff)
downloadceph-828aa90a2b0070d043c67464a03529105d835db2.tar.xz
ceph-828aa90a2b0070d043c67464a03529105d835db2.zip
rgw: add RGWIdentityType::TYPE_ROOT for account root user
Signed-off-by: Casey Bodley <cbodley@redhat.com>
Diffstat (limited to 'src/rgw/driver/rados/rgw_rest_user.cc')
-rw-r--r--src/rgw/driver/rados/rgw_rest_user.cc10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/rgw/driver/rados/rgw_rest_user.cc b/src/rgw/driver/rados/rgw_rest_user.cc
index 748a61c3f83..9f3ae2d03aa 100644
--- a/src/rgw/driver/rados/rgw_rest_user.cc
+++ b/src/rgw/driver/rados/rgw_rest_user.cc
@@ -159,6 +159,7 @@ void RGWOp_User_Create::execute(optional_yield y)
bool gen_key;
bool suspended;
bool system;
+ bool account_root = false;
bool exclusive;
int32_t max_buckets;
@@ -181,6 +182,7 @@ void RGWOp_User_Create::execute(optional_yield y)
RESTArgs::get_bool(s, "suspended", false, &suspended);
RESTArgs::get_int32(s, "max-buckets", default_max_buckets, &max_buckets);
RESTArgs::get_bool(s, "system", false, &system);
+ RESTArgs::get_bool(s, "account-root", false, &account_root);
RESTArgs::get_bool(s, "exclusive", false, &exclusive);
RESTArgs::get_string(s, "op-mask", op_mask_str, &op_mask_str);
RESTArgs::get_string(s, "default-placement", default_placement_str, &default_placement_str);
@@ -238,6 +240,9 @@ void RGWOp_User_Create::execute(optional_yield y)
if (s->info.args.exists("system"))
op_state.set_system(system);
+ if (s->info.args.exists("account-root"))
+ op_state.set_account_root(account_root);
+
if (s->info.args.exists("exclusive"))
op_state.set_exclusive(exclusive);
@@ -303,6 +308,7 @@ void RGWOp_User_Modify::execute(optional_yield y)
bool gen_key;
bool suspended;
bool system;
+ bool account_root = false;
bool email_set;
bool quota_set;
int32_t max_buckets;
@@ -322,6 +328,7 @@ void RGWOp_User_Modify::execute(optional_yield y)
RESTArgs::get_string(s, "key-type", key_type_str, &key_type_str);
RESTArgs::get_bool(s, "system", false, &system);
+ RESTArgs::get_bool(s, "account-root", false, &account_root);
RESTArgs::get_string(s, "op-mask", op_mask_str, &op_mask_str);
RESTArgs::get_string(s, "default-placement", default_placement_str, &default_placement_str);
RESTArgs::get_string(s, "placement-tags", placement_tags_str, &placement_tags_str);
@@ -375,6 +382,9 @@ void RGWOp_User_Modify::execute(optional_yield y)
if (s->info.args.exists("system"))
op_state.set_system(system);
+ if (s->info.args.exists("account-root"))
+ op_state.set_account_root(account_root);
+
if (!op_mask_str.empty()) {
uint32_t op_mask;
int ret = rgw_parse_op_type_list(op_mask_str, &op_mask);