#include "common/random_string.h"
#include "common/utf8.h"
+#include "rgw_arn.h"
#include "rgw_oidc_provider.h"
#include "rgw_quota.h"
#include "rgw_role.h"
return true;
}
+ARN root_arn(std::string id)
+{
+ const std::string region; // empty
+ return {Partition::aws, Service::iam, region, std::move(id), "root"};
+}
+
int create(const DoutPrefixProvider* dpp,
rgw::sal::Driver* driver,
class RGWFormatterFlusher;
class optional_yield;
+namespace rgw { class ARN; }
+
namespace rgw::account {
/// generate a randomized account id in a specific format
/// check an account name for any invalid characters
bool validate_name(std::string_view name, std::string* err_msg = nullptr);
+/// construct the account root arn
+ARN root_arn(std::string account_id);
+
struct AdminOpState {
std::string account_id;
// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:nil -*-
// vim: ts=8 sw=2 sts=2 expandtab ft=cpp
+#include "rgw_account.h"
#include "rgw_process_env.h"
#include "rgw_rest_iam_account.h"
} else {
return -ERR_METHOD_NOT_ALLOWED;
}
- const rgw::ARN arn{"", "root", account_id, true};
+ const auto arn = rgw::account::root_arn(account_id);
if (verify_user_permission(this, s, arn, rgw::IAM::iamGetAccountSummary)) {
return 0;
}