if (ret < 0) {
return ret;
}
+
+ return 0;
}
int RGWRole::update()
return false;
}
- std::regex regex_path("(\/[!-~]+\/)|(\/)");
+ std::regex regex_path("(/[!-~]+/)|(/)");
if (! std::regex_match(path,regex_path)) {
ldout(cct, 0) << "ERROR: Invalid chars in path " << dendl;
return false;
}
+
+ return true;
+}
+
+void RGWRole::extract_name_tenant(const std::string& str)
+{
+ size_t pos = str.find('$');
+ if (pos != std::string::npos) {
+ tenant = str.substr(0, pos);
+ name = str.substr(pos + 1);
+ }
}
void RGWRole::update_trust_policy(string& trust_policy)
int read_info();
void set_id(const string& id) { this->id = id; }
bool validate_input();
+ void extract_name_tenant(const std::string& str);
public:
RGWRole(CephContext *cct,
tenant(std::move(tenant)) {
if (this->path.empty())
this->path = "/";
+ extract_name_tenant(this->name);
}
RGWRole(CephContext *cct,
: cct(cct),
store(store),
name(std::move(name)),
- tenant(std::move(tenant)) {}
+ tenant(std::move(tenant)) {
+ extract_name_tenant(this->name);
+ }
RGWRole(CephContext *cct,
RGWRados *store,