} else {
/* list users in groups of max-keys, then perform user-bucket
* limit-check on each group */
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->list_keys_init(metadata_key, &handle);
+ ret = store->meta_list_keys_init(metadata_key, string(), &handle);
if (ret < 0) {
cerr << "ERROR: buckets limit check can't get user metadata_key: "
<< cpp_strerror(-ret) << std::endl;
}
do {
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->list_keys_next(handle, max, user_ids,
+ ret = store->meta_list_keys_next(handle, max, user_ids,
&truncated);
if (ret < 0 && ret != -ENOENT) {
cerr << "ERROR: buckets limit check lists_keys_next(): "
}
user_ids.clear();
} while (truncated);
- static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->list_keys_complete(handle);
+ store->meta_list_keys_complete(handle);
}
return -ret;
} /* OPT::BUCKET_LIMIT_CHECK */
if (opt_cmd == OPT::BUCKET_STATS) {
if (bucket_name.empty() && !bucket_id.empty()) {
rgw_bucket bucket;
- if (!rgw_find_bucket_by_id(store->ctx(), static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr, marker, bucket_id, &bucket)) {
+ if (!rgw_find_bucket_by_id(store->ctx(), store, marker, bucket_id, &bucket)) {
cerr << "failure: no such bucket id" << std::endl;
return -ENOENT;
}
}
void *handle;
int max = 1000;
- int ret = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->list_keys_init(metadata_key, marker, &handle);
+ int ret = store->meta_list_keys_init(metadata_key, marker, &handle);
if (ret < 0) {
cerr << "ERROR: can't get key: " << cpp_strerror(-ret) << std::endl;
return -ret;
do {
list<string> keys;
left = (max_entries_specified ? max_entries - count : max);
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->list_keys_next(handle, left, keys, &truncated);
+ ret = store->meta_list_keys_next(handle, left, keys, &truncated);
if (ret < 0 && ret != -ENOENT) {
cerr << "ERROR: lists_keys_next(): " << cpp_strerror(-ret) << std::endl;
return -ret;
encode_json("truncated", truncated, formatter.get());
encode_json("count", count, formatter.get());
if (truncated) {
- encode_json("marker", static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->get_marker(handle), formatter.get());
+ encode_json("marker", store->meta_get_marker(handle), formatter.get());
}
formatter->close_section();
}
formatter->flush(cout);
- static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->list_keys_complete(handle);
+ store->meta_list_keys_complete(handle);
}
if (opt_cmd == OPT::MDLOG_LIST) {
return 0;
}
-bool rgw_find_bucket_by_id(CephContext *cct, RGWMetadataManager *mgr,
+bool rgw_find_bucket_by_id(CephContext *cct, rgw::sal::RGWStore* store,
const string& marker, const string& bucket_id, rgw_bucket* bucket_out)
{
void *handle = NULL;
bool truncated = false;
string s;
- int ret = mgr->list_keys_init("bucket.instance", marker, &handle);
+ int ret = store->meta_list_keys_init("bucket.instance", marker, &handle);
if (ret < 0) {
cerr << "ERROR: can't get key: " << cpp_strerror(-ret) << std::endl;
- mgr->list_keys_complete(handle);
+ store->meta_list_keys_complete(handle);
return -ret;
}
do {
list<string> keys;
- ret = mgr->list_keys_next(handle, 1000, keys, &truncated);
+ ret = store->meta_list_keys_next(handle, 1000, keys, &truncated);
if (ret < 0) {
cerr << "ERROR: lists_keys_next(): " << cpp_strerror(-ret) << std::endl;
- mgr->list_keys_complete(handle);
+ store->meta_list_keys_complete(handle);
return -ret;
}
for (list<string>::iterator iter = keys.begin(); iter != keys.end(); ++iter) {
continue;
}
if (bucket_id == bucket_out->bucket_id) {
- mgr->list_keys_complete(handle);
+ store->meta_list_keys_complete(handle);
return true;
}
}
} while (truncated);
- mgr->list_keys_complete(handle);
+ store->meta_list_keys_complete(handle);
return false;
}
bool truncated = true;
formatter->open_array_section("buckets");
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->list_keys_init("bucket", &handle);
+ ret = store->meta_list_keys_init("bucket", string(), &handle);
while (ret == 0 && truncated) {
std::list<std::string> buckets;
constexpr int max_keys = 1000;
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->list_keys_next(handle, max_keys, buckets,
+ ret = store->meta_list_keys_next(handle, max_keys, buckets,
&truncated);
for (auto& bucket_name : buckets) {
if (show_stats) {
}
}
}
- static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->list_keys_complete(handle);
+ store->meta_list_keys_complete(handle);
formatter->close_section();
}
Formatter *formatter = flusher.get_formatter();
static constexpr auto default_max_keys = 1000;
- int ret = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->list_keys_init("bucket.instance", marker, &handle);
+ int ret = store->meta_list_keys_init("bucket.instance", marker, &handle);
if (ret < 0) {
cerr << "ERROR: can't get key: " << cpp_strerror(-ret) << std::endl;
return ret;
formatter->open_array_section("keys");
auto g = make_scope_guard([&store, &handle, &formatter]() {
- static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->list_keys_complete(handle);
+ store->meta_list_keys_complete(handle);
formatter->close_section(); // keys
formatter->flush(cout);
});
do {
list<std::string> keys;
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->list_keys_next(handle, default_max_keys, keys, &truncated);
+ ret = store->meta_list_keys_next(handle, default_max_keys, keys, &truncated);
if (ret < 0 && ret != -ENOENT) {
cerr << "ERROR: lists_keys_next(): " << cpp_strerror(-ret) << std::endl;
return ret;
int ret = purge_bucket_instance(store, binfo, dpp);
if (ret == 0){
auto md_key = "bucket.instance:" + binfo.bucket.get_key();
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->remove(md_key, null_yield, dpp);
+ ret = store->meta_remove(dpp, md_key, null_yield);
}
formatter->open_object_section("delete_status");
formatter->dump_string("bucket_instance", binfo.bucket.get_key());
process_single_lc_entry(store, formatter, user_id.tenant, bucket_name, dpp);
formatter->flush(cout);
} else {
- int ret = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->list_keys_init("bucket", marker, &handle);
+ int ret = store->meta_list_keys_init("bucket", marker, &handle);
if (ret < 0) {
std::cerr << "ERROR: can't get key: " << cpp_strerror(-ret) << std::endl;
return ret;
{
formatter->open_array_section("lc_fix_status");
auto sg = make_scope_guard([&store, &handle, &formatter](){
- static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->list_keys_complete(handle);
+ store->meta_list_keys_complete(handle);
formatter->close_section(); // lc_fix_status
formatter->flush(cout);
});
do {
list<std::string> keys;
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->list_keys_next(handle, default_max_keys, keys, &truncated);
+ ret = store->meta_list_keys_next(handle, default_max_keys, keys, &truncated);
if (ret < 0 && ret != -ENOENT) {
std::cerr << "ERROR: lists_keys_next(): " << cpp_strerror(-ret) << std::endl;
return ret;
};
-bool rgw_find_bucket_by_id(CephContext *cct, RGWMetadataManager *mgr, const string& marker,
+bool rgw_find_bucket_by_id(CephContext *cct, rgw::sal::RGWStore* store, const string& marker,
const string& bucket_id, rgw_bucket* bucket_out);
#endif
void *handle;
int max = 1000;
string section = "bucket.instance";
- int ret = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->list_keys_init(section, &handle);
+ int ret = store->meta_list_keys_init(section, string(), &handle);
if (ret < 0) {
lderr(store->ctx()) << "ERROR: can't get key: " << cpp_strerror(-ret) << dendl;
return ret;
do {
list<string> keys;
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->list_keys_next(handle, max, keys, &truncated);
+ ret = store->meta_list_keys_next(handle, max, keys, &truncated);
if (ret < 0) {
lderr(store->ctx()) << "ERROR: lists_keys_next(): " << cpp_strerror(-ret) << dendl;
return ret;
} while (truncated);
+ store->meta_list_keys_complete(handle);
+
ret = log_oids(buckets_instance_index, instances);
if (ret < 0) {
lderr(store->ctx()) << __func__ << ": ERROR: log_oids() returned ret=" << ret << dendl;
return ret;
}
- static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->list_keys_complete(handle);
return 0;
}
int ret;
void* handle = nullptr;
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->list_keys_init("bucket", &handle);
+ ret = store->meta_list_keys_init("bucket", string(), &handle);
if (ret < 0) {
lderr(store->ctx()) << "RGWRadosList::" << __func__ <<
" ERROR: list_keys_init returned " <<
do {
std::list<std::string> buckets;
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->list_keys_next(handle, max_keys,
- buckets, &truncated);
+ ret = store->meta_list_keys_next(handle, max_keys, buckets, &truncated);
for (std::string& bucket_id : buckets) {
ret = run(dpp, bucket_id);
string key = "user";
void *handle;
- int ret = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->list_keys_init(key, &handle);
+ int ret = store->meta_list_keys_init(key, string(), &handle);
if (ret < 0) {
ldout(store->ctx(), 10) << "ERROR: can't get key: ret=" << ret << dendl;
return ret;
do {
list<string> keys;
- ret = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->list_keys_next(handle, max, keys, &truncated);
+ ret = store->meta_list_keys_next(handle, max, keys, &truncated);
if (ret < 0) {
ldout(store->ctx(), 0) << "ERROR: lists_keys_next(): ret=" << ret << dendl;
goto done;
ret = 0;
done:
- static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->list_keys_complete(handle);
+ store->meta_list_keys_complete(handle);
return ret;
}
marker = "3:bf885d8f:root::sorry_janefonda_665:head";
*/
- op_ret = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr->list_keys_init(metadata_key, marker, &handle);
+ op_ret = store->meta_list_keys_init(metadata_key, marker, &handle);
if (op_ret < 0) {
dout(5) << "ERROR: can't get key: " << cpp_strerror(op_ret) << dendl;
return;
s->formatter->open_array_section("keys");
- auto meta_mgr = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr;
-
uint64_t left;
do {
list<string> keys;
left = (max_entries_specified ? max_entries - count : max);
- op_ret = meta_mgr->list_keys_next(handle, left, keys, &truncated);
+ op_ret = store->meta_list_keys_next(handle, left, keys, &truncated);
if (op_ret < 0) {
dout(5) << "ERROR: lists_keys_next(): " << cpp_strerror(op_ret)
<< dendl;
encode_json("count", count, s->formatter);
if (truncated) {
string esc_marker =
- rgw::to_base64(meta_mgr->get_marker(handle));
+ rgw::to_base64(store->meta_get_marker(handle));
encode_json("marker", esc_marker, s->formatter);
}
s->formatter->close_section();
}
- meta_mgr->list_keys_complete(handle);
+ store->meta_list_keys_complete(handle);
op_ret = 0;
}
boost::optional<obj_version> refresh_version = boost::none) = 0;
virtual int delete_system_obj(const rgw_pool& pool, const string& oid,
RGWObjVersionTracker *objv_tracker, optional_yield y) = 0;
+ virtual int meta_list_keys_init(const string& section, const string& marker, void** phandle) = 0;
+ virtual int meta_list_keys_next(void* handle, int max, list<string>& keys, bool* truncated) = 0;
+ virtual void meta_list_keys_complete(void* handle) = 0;
+ virtual std::string meta_get_marker(void *handle) = 0;
+ virtual int meta_remove(const DoutPrefixProvider *dpp, string& metadata_key, optional_yield y) = 0;
+
virtual void finalize(void) = 0;
virtual CephContext *ctx(void) = 0;
{
return rgw_delete_system_obj(svc()->sysobj, pool, oid, objv_tracker, y);
}
+
+int RGWRadosStore::meta_list_keys_init(const string& section, const string& marker, void** phandle)
+{
+ return ctl()->meta.mgr->list_keys_init(section, marker, phandle);
+}
+
+int RGWRadosStore::meta_list_keys_next(void* handle, int max, list<string>& keys, bool* truncated)
+{
+ return ctl()->meta.mgr->list_keys_next(handle, max, keys, truncated);
+}
+
+void RGWRadosStore::meta_list_keys_complete(void* handle)
+{
+ ctl()->meta.mgr->list_keys_complete(handle);
+}
+
+std::string RGWRadosStore::meta_get_marker(void* handle)
+{
+ return ctl()->meta.mgr->get_marker(handle);
+}
+
+int RGWRadosStore::meta_remove(const DoutPrefixProvider *dpp, string& metadata_key, optional_yield y)
+{
+ return ctl()->meta.mgr->remove(metadata_key, y, dpp);
+}
+
void RGWRadosStore::finalize(void)
{
if (rados)
boost::optional<obj_version> refresh_version = boost::none) override;
virtual int delete_system_obj(const rgw_pool& pool, const string& oid,
RGWObjVersionTracker *objv_tracker, optional_yield y) override;
+ virtual int meta_list_keys_init(const string& section, const string& marker, void** phandle) override;
+ virtual int meta_list_keys_next(void* handle, int max, list<string>& keys, bool* truncated) override;
+ virtual void meta_list_keys_complete(void* handle) override;
+ virtual std::string meta_get_marker(void *handle) override;
+ virtual int meta_remove(const DoutPrefixProvider *dpp, string& metadata_key, optional_yield y) override;
+
virtual void finalize(void) override;
virtual CephContext *ctx(void) override { return rados->ctx(); }
return 0;
}
-/**
- * Save the given user information to storage.
- * Returns: 0 on success, -ERR# on failure.
- */
-int rgw_store_user_info(const DoutPrefixProvider *dpp,
- RGWUserCtl *user_ctl,
- RGWUserInfo& info,
- RGWUserInfo *old_info,
- RGWObjVersionTracker *objv_tracker,
- real_time mtime,
- bool exclusive,
- optional_yield y,
- map<string, bufferlist> *pattrs)
-{
- return user_ctl->store_info(dpp, info, y,
- RGWUserCtl::PutParams()
- .set_old_info(old_info)
- .set_objv_tracker(objv_tracker)
- .set_mtime(mtime)
- .set_exclusive(exclusive)
- .set_attrs(pattrs));
-}
-
-/**
- * Given a uid, finds the user info associated with it.
- * returns: 0 on success, -ERR# on failure (including nonexistence)
- */
-int rgw_get_user_info_by_uid(const DoutPrefixProvider *dpp,
- RGWUserCtl *user_ctl,
- const rgw_user& uid,
- RGWUserInfo& info,
- optional_yield y,
- RGWObjVersionTracker * const objv_tracker,
- real_time * const pmtime,
- rgw_cache_entry_info * const cache_info,
- map<string, bufferlist> * const pattrs)
-{
- return user_ctl->get_info_by_uid(dpp, uid, &info, y,
- RGWUserCtl::GetParams()
- .set_objv_tracker(objv_tracker)
- .set_mtime(pmtime)
- .set_cache_info(cache_info)
- .set_attrs(pattrs));
-}
-
-/**
- * Given an email, finds the user info associated with it.
- * returns: 0 on success, -ERR# on failure (including nonexistence)
- */
-int rgw_get_user_info_by_email(const DoutPrefixProvider *dpp,
- RGWUserCtl *user_ctl, string& email,
- RGWUserInfo& info, optional_yield y,
- RGWObjVersionTracker *objv_tracker,
- real_time *pmtime)
-{
- return user_ctl->get_info_by_email(dpp, email, &info, y,
- RGWUserCtl::GetParams()
- .set_objv_tracker(objv_tracker)
- .set_mtime(pmtime));
-}
-
-/**
- * Given an swift username, finds the user_info associated with it.
- * returns: 0 on success, -ERR# on failure (including nonexistence)
- */
-int rgw_get_user_info_by_swift(const DoutPrefixProvider *dpp,
- RGWUserCtl *user_ctl,
- const string& swift_name,
- RGWUserInfo& info, /* out */
- optional_yield y,
- RGWObjVersionTracker * const objv_tracker,
- real_time * const pmtime)
-{
- return user_ctl->get_info_by_swift(dpp, swift_name, &info, y,
- RGWUserCtl::GetParams()
- .set_objv_tracker(objv_tracker)
- .set_mtime(pmtime));
-}
-
-/**
- * Given an access key, finds the user info associated with it.
- * returns: 0 on success, -ERR# on failure (including nonexistence)
- */
-extern int rgw_get_user_info_by_access_key(const DoutPrefixProvider *dpp,
- RGWUserCtl *user_ctl,
- const std::string& access_key,
- RGWUserInfo& info,
- optional_yield y,
- RGWObjVersionTracker* objv_tracker,
- real_time *pmtime)
-{
- return user_ctl->get_info_by_access_key(dpp, access_key, &info, y,
- RGWUserCtl::GetParams()
- .set_objv_tracker(objv_tracker)
- .set_mtime(pmtime));
-}
-
static bool char_is_unreserved_url(char c)
{
if (isalnum(c))
user = usr;
store = user->get_store();
- user_ctl = user->get_user_ctl();
}
int RGWAccessKeyPool::init(RGWUserAdminOpState& op_state)
std::pair<std::string, RGWAccessKey> key_pair;
RGWAccessKey new_key;
- RGWUserInfo duplicate_check;
+ std::unique_ptr<rgw::sal::RGWUser> duplicate_check;
int key_type = op_state.get_key_type();
bool gen_access = op_state.will_gen_access();
if (!id.empty()) {
switch (key_type) {
case KEY_TYPE_SWIFT:
- if (rgw_get_user_info_by_swift(dpp, user_ctl, id, duplicate_check, y) >= 0) {
+ if (store->get_user_by_swift(dpp, id, y, &duplicate_check) >= 0) {
set_err_msg(err_msg, "existing swift key in RGW system:" + id);
return -ERR_KEY_EXIST;
}
break;
case KEY_TYPE_S3:
- if (rgw_get_user_info_by_access_key(dpp, user_ctl, id, duplicate_check, y) >= 0) {
+ if (store->get_user_by_access_key(dpp, id, y, &duplicate_check) >= 0) {
set_err_msg(err_msg, "existing S3 key in RGW system:" + id);
return -ERR_KEY_EXIST;
}
if (!validate_access_key(id))
continue;
- } while (!rgw_get_user_info_by_access_key(dpp, user_ctl, id, duplicate_check, y));
+ } while (!store->get_user_by_access_key(dpp, id, y, &duplicate_check));
}
if (key_type == KEY_TYPE_SWIFT) {
}
// check that the access key doesn't exist
- if (rgw_get_user_info_by_swift(dpp, user_ctl, id, duplicate_check, y) >= 0) {
+ if (store->get_user_by_swift(dpp, id, y, &duplicate_check) >= 0) {
set_err_msg(err_msg, "cannot create existing swift key");
return -ERR_KEY_EXIST;
}
subusers_allowed = true;
store = user->get_store();
- user_ctl = user->get_user_ctl();
}
int RGWSubUserPool::init(RGWUserAdminOpState& op_state)
}
store = storage;
- user_ctl = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->user;
clear_populated();
{
int ret;
std::string subprocess_msg;
- RGWUserInfo user_info = op_state.get_user_info();
+ rgw::sal::RGWUser* user = op_state.get_user();
if (!store) {
set_err_msg(err_msg, "couldn't initialize storage");
RGWUserInfo *pold_info = (is_populated() ? &old_info : nullptr);
- ret = rgw_store_user_info(dpp, user_ctl, user_info, pold_info, &op_state.objv,
- real_time(), false, y);
+ ret = user->store_info(dpp, y, RGWUserCtl::PutParams()
+ .set_old_info(pold_info)
+ .set_objv_tracker(&op_state.objv));
if (ret < 0) {
set_err_msg(err_msg, "unable to store user info");
return ret;
}
- old_info = user_info;
+ old_info = user->get_info();
set_populated();
return 0;
}
// create a stub user and write only the uid index and buckets object
- RGWUserInfo stub_user_info;
- stub_user_info.user_id = new_user->get_id();
+ std::unique_ptr<rgw::sal::RGWUser> user;
+ user = store->get_user(new_user->get_id());
RGWObjVersionTracker objv;
const bool exclusive = !op_state.get_overwrite_new_user(); // overwrite if requested
- ret = user_ctl->store_info(dpp, stub_user_info, y,
- RGWUserCtl::PutParams()
- .set_objv_tracker(&objv)
- .set_exclusive(exclusive));
+ ret = user->store_info(dpp, y, RGWUserCtl::PutParams()
+ .set_objv_tracker(&objv)
+ .set_exclusive(exclusive));
if (ret == -EEXIST) {
set_err_msg(err_msg, "user name given by --new-uid already exists");
return ret;
int ret;
bool purge_data = op_state.will_purge_data();
- std::unique_ptr<rgw::sal::RGWUser> user = store->get_user(op_state.get_user_id());
- RGWUserInfo user_info = op_state.get_user_info();
+ rgw::sal::RGWUser* user = op_state.get_user();
if (!op_state.has_existing_user()) {
set_err_msg(err_msg, "user does not exist");
} while (buckets.is_truncated());
- ret = user_ctl->remove_info(dpp, user_info, y, RGWUserCtl::RemoveParams()
- .set_objv_tracker(&op_state.objv));
+ ret = user->remove_info(dpp, y, RGWUserCtl::RemoveParams().set_objv_tracker(&op_state.objv));
if (ret < 0) {
set_err_msg(err_msg, "unable to remove user from RADOS");
return ret;
std::string display_name = op_state.get_display_name();
RGWUserInfo user_info;
- RGWUserInfo duplicate_check;
+ std::unique_ptr<rgw::sal::RGWUser> duplicate_check;
// ensure that the user info has been populated or is populate-able
if (!op_state.has_existing_user() && !populated) {
if (!op_email.empty()) {
// make sure we are not adding a duplicate email
if (old_email != op_email) {
- ret = rgw_get_user_info_by_email(dpp, user_ctl, op_email, duplicate_check,y );
- if (ret >= 0 && duplicate_check.user_id.compare(user_id) != 0) {
+ ret = store->get_user_by_email(dpp, op_email, y, &duplicate_check);
+ if (ret >= 0 && duplicate_check->get_id().compare(user_id) != 0) {
set_err_msg(err_msg, "cannot add duplicate email");
return -ERR_EMAIL_EXIST;
}
op_state.max_entries = 1000;
}
- auto meta_mgr = static_cast<rgw::sal::RGWRadosStore*>(store)->ctl()->meta.mgr;
-
- int ret = meta_mgr->list_keys_init(metadata_key, op_state.marker, &handle);
+ int ret = store->meta_list_keys_init(metadata_key, op_state.marker, &handle);
if (ret < 0) {
return ret;
}
do {
std::list<std::string> keys;
left = op_state.max_entries - count;
- ret = meta_mgr->list_keys_next(handle, left, keys, &truncated);
+ ret = store->meta_list_keys_next(handle, left, keys, &truncated);
if (ret < 0 && ret != -ENOENT) {
return ret;
} if (ret != -ENOENT) {
formatter->dump_bool("truncated", truncated);
formatter->dump_int("count", count);
if (truncated) {
- formatter->dump_string("marker", meta_mgr->get_marker(handle));
+ formatter->dump_string("marker", store->meta_get_marker(handle));
}
// close result object section
formatter->close_section();
- meta_mgr->list_keys_complete(handle);
+ store->meta_list_keys_complete(handle);
flusher.flush();
return 0;
*/
extern void rgw_get_anon_user(RGWUserInfo& info);
-/**
- * Save the given user information to storage.
- * Returns: 0 on success, -ERR# on failure.
- */
-extern int rgw_store_user_info(const DoutPrefixProvider *dpp,
- RGWUserCtl *user_ctl,
- RGWUserInfo& info,
- RGWUserInfo *old_info,
- RGWObjVersionTracker *objv_tracker,
- real_time mtime,
- bool exclusive,
- optional_yield y,
- map<string, bufferlist> *pattrs = nullptr);
-
-/**
- * Given an user_id, finds the user info associated with it.
- * returns: 0 on success, -ERR# on failure (including nonexistence)
- */
-extern int rgw_get_user_info_by_uid(const DoutPrefixProvider *dpp,
- RGWUserCtl *user_ctl,
- const rgw_user& user_id,
- RGWUserInfo& info,
- optional_yield y,
- RGWObjVersionTracker *objv_tracker = nullptr,
- real_time *pmtime = nullptr,
- rgw_cache_entry_info *cache_info = nullptr,
- map<string, bufferlist> *pattrs = nullptr);
-/**
- * Given an email, finds the user info associated with it.
- * returns: 0 on success, -ERR# on failure (including nonexistence)
- */
-extern int rgw_get_user_info_by_email(const DoutPrefixProvider *dpp,
- RGWUserCtl *user_ctl,
- string& email, RGWUserInfo& info,
- optional_yield y,
- RGWObjVersionTracker *objv_tracker = NULL,
- real_time *pmtime = nullptr);
-/**
- * Given an swift username, finds the user info associated with it.
- * returns: 0 on success, -ERR# on failure (including nonexistence)
- */
-extern int rgw_get_user_info_by_swift(const DoutPrefixProvider *dpp,
- RGWUserCtl *user_ctl,
- const string& swift_name,
- RGWUserInfo& info, /* out */
- optional_yield y,
- RGWObjVersionTracker *objv_tracker = nullptr,
- real_time *pmtime = nullptr);
-/**
- * Given an access key, finds the user info associated with it.
- * returns: 0 on success, -ERR# on failure (including nonexistence)
- */
-extern int rgw_get_user_info_by_access_key(const DoutPrefixProvider *dpp,
- RGWUserCtl *user_ctl,
- const std::string& access_key,
- RGWUserInfo& info,
- optional_yield y,
- RGWObjVersionTracker* objv_tracker = nullptr,
- real_time* pmtime = nullptr);
-
extern void rgw_perm_to_str(uint32_t mask, char *buf, int len);
extern uint32_t rgw_str_to_perm(const char *str);
RGWQuotaInfo& get_user_quota() { return user_quota; }
set<string>& get_mfa_ids() { return mfa_ids; }
+ rgw::sal::RGWUser* get_user() { return user.get(); }
const rgw_user& get_user_id();
std::string get_subuser() { return subuser; }
std::string get_access_key() { return id; }
std::map<std::string, int, ltstr_nocase> key_type_map;
rgw_user user_id;
rgw::sal::RGWStore *store{nullptr};
- RGWUserCtl *user_ctl{nullptr};
map<std::string, RGWAccessKey> *swift_keys{nullptr};
map<std::string, RGWAccessKey> *access_keys{nullptr};
rgw_user user_id;
rgw::sal::RGWStore *store{nullptr};
- RGWUserCtl *user_ctl{nullptr};
bool subusers_allowed{false};
map<string, RGWSubUser> *subuser_map{nullptr};
private:
RGWUserInfo old_info;
rgw::sal::RGWStore *store{nullptr};
- RGWUserCtl *user_ctl{nullptr};
rgw_user user_id;
bool info_stored{false};
int init_members(RGWUserAdminOpState& op_state);
rgw::sal::RGWStore *get_store() { return store; }
- RGWUserCtl *get_user_ctl() { return user_ctl; }
/* API Contracted Members */
RGWUserCapPool caps;