we need account root arns for various permission checks, and don't have
a consistent way to construct them
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit
ccdbebd925b77eb7c5d0ba9a3a175642babcf291)
Conflicts:
src/rgw/rgw_rest_iam_account.cc does not exist on tentacle
#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;