goto done;
}
+#warning authorize step disabled
+#if 0
// just checks the HTTP header, and that the user can access the gateway
// may be able to skip this after MOUNT (revalidate the user info)
req->log(s, "authorizing");
abort_req(s, op, ret);
goto done;
}
+#endif
if (s->user.suspended) {
dout(10) << "user is suspended, uid=" << s->user.user_id << dendl;
CephContext* cct = static_cast<CephContext*>(rgw_fs->rgw);
-#if 1
/* TODO:
- * take actual, um, arguments
* deal with markers (continuation)
- * deal with sync vs async
+ * deal with authorization
* consider non-default tenancy/user and bucket layouts
*/
if (is_root(uri)) {
...
*/
}
-#else
- /* XXX current open-coded logic should move into librgw (need
- * functor mechanism wrapping callback */
- if (is_root(uri)) {
- /* get the bucket list */
- string start; // XXX need to match offset
- string end; // XXX need to match offset
- uint64_t nread, bucket_count, bucket_objcount;
- RGWUserBuckets buckets;
- uint64_t max_buckets = cct->_conf->rgw_list_buckets_max_chunk;
-
- /* XXX check offsets */
- uint64_t ix = 3;
- rgw_user uid(rgw_fs->user_id);
- rc = rgw_read_user_buckets(store, uid, buckets, start, end, max_buckets,
- true);
- if (rc < 0) {
- ldout(cct, 10) << "WARNING: failed on rgw_get_user_buckets uid="
- << rgw_fs->user_id << dendl;
- return rc;
- } else {
- bucket_count = 0;
- bucket_objcount = 0;
- map<string, RGWBucketEnt>& m = buckets.get_buckets();
- for (auto& ib : m) {
- RGWBucketEnt& bent = ib.second;
- bucket_objcount += bent.count;
- start = ib.first;
- (void) rcb(bent.bucket.name.c_str(), cb_arg, ix++);
- }
- bucket_count += m.size();
- }
- } else {
- /* !root uri */
-
- }
-#endif
- *eof = true;
+ *eof = true; // XXX move into RGGWListBucket(s)Request
return 0;
}
if (!sent_data)
return;
+ // XXX we can improve this
RGWListBucketsRequest* req
- = reinterpret_cast<RGWListBucketsRequest*>(this);
+ = dynamic_cast<RGWListBucketsRequest*>(this);
map<string, RGWBucketEnt>& m = buckets.get_buckets();
for (const auto& iter : m) {
using std::get;
bool eof = false;
- int ret = rgw_readdir(fs, &fs->root_fh, 0 /* offset */, r1_cb, &fids1, &eof);
+ uint64_t offset = 0;
+ int ret = rgw_readdir(fs, &fs->root_fh, &offset, r1_cb, &fids1, &eof);
for (auto& fid : fids1) {
std::cout << "fname: " << get<0>(fid) << " fid: " << get<1>(fid)
<< std::endl;