return ret;
}
-
-RGWOp *RGWHandler::get_op(RGWRados *store)
-{
- RGWOp *op;
- switch (s->op) {
- case OP_GET:
- op = op_get();
- break;
- case OP_PUT:
- op = op_put();
- break;
- case OP_DELETE:
- op = op_delete();
- break;
- case OP_HEAD:
- op = op_head();
- break;
- case OP_POST:
- op = op_post();
- break;
- case OP_COPY:
- op = op_copy();
- break;
- case OP_OPTIONS:
- op = op_options();
- break;
- default:
- return NULL;
- }
-
- if (op) {
- op->init(store, s, this);
- }
- return op;
-}
-
-void RGWHandler::put_op(RGWOp *op)
-{
- delete op;
-}
-
int RGWOp::error_handler(int err_no, string *error_content) {
return dialect_handler->error_handler(err_no, error_content);
}
int do_init_permissions();
int do_read_permissions(RGWOp *op, bool only_bucket);
- virtual RGWOp *op_get() { return NULL; }
- virtual RGWOp *op_put() { return NULL; }
- virtual RGWOp *op_delete() { return NULL; }
- virtual RGWOp *op_head() { return NULL; }
- virtual RGWOp *op_post() { return NULL; }
- virtual RGWOp *op_copy() { return NULL; }
- virtual RGWOp *op_options() { return NULL; }
public:
RGWHandler() : store(NULL), s(NULL) {}
virtual ~RGWHandler();
- virtual int init(RGWRados *store, struct req_state *_s, RGWClientIO *cio);
- virtual RGWOp *get_op(RGWRados *store);
- virtual void put_op(RGWOp *op);
+ virtual int init(RGWRados* store, struct req_state* _s, RGWClientIO* cio);
+
virtual int init_permissions(RGWOp *op) {
return 0;
}
+
virtual int retarget(RGWOp *op, RGWOp **new_op) {
*new_op = op;
return 0;
}
+
virtual int read_permissions(RGWOp *op) = 0;
virtual int authorize() = 0;
virtual int postauth_init() = 0;
RGWOp* op = NULL;
int init_error = 0;
bool should_log = false;
-
- RGWRESTMgr* mgr;
- RGWHandler* handler = rest->get_handler(store, s, client_io, &mgr,
- &init_error);
+ RGWRESTMgr *mgr;
+ RGWHandler_REST *handler = rest->get_handler(store, s, client_io, &mgr,
+ &init_error);
if (init_error != 0) {
abort_early(s, NULL, init_error, NULL);
goto done;
return check_caps(s->user.caps);
}
-int RGWHandler_ObjStore::allocate_formatter(struct req_state *s,
- int default_type,
- bool configurable)
+RGWOp* RGWHandler_REST::get_op(RGWRados* store)
+{
+ RGWOp *op;
+ switch (s->op) {
+ case OP_GET:
+ op = op_get();
+ break;
+ case OP_PUT:
+ op = op_put();
+ break;
+ case OP_DELETE:
+ op = op_delete();
+ break;
+ case OP_HEAD:
+ op = op_head();
+ break;
+ case OP_POST:
+ op = op_post();
+ break;
+ case OP_COPY:
+ op = op_copy();
+ break;
+ case OP_OPTIONS:
+ op = op_options();
+ break;
+ default:
+ return NULL;
+ }
+
+ if (op) {
+ op->init(store, s, this);
+ }
+ return op;
+} /* get_op */
+
+void RGWHandler_REST::put_op(RGWOp* op)
+{
+ delete op;
+} /* put_op */
+
+int RGWHandler_REST::allocate_formatter(struct req_state *s,
+ int default_type,
+ bool configurable)
{
s->format = default_type;
if (configurable) {
return 0;
}
-int RGWHandler_ObjStore::validate_tenant_name(string const& t)
+int RGWHandler_REST::validate_tenant_name(string const& t)
{
- const char *p = t.c_str();
- for (unsigned int i = 0; i < t.size(); i++) {
- char ch = p[i];
- if (!(isalnum(ch) || ch == '_'))
- return -ERR_INVALID_TENANT_NAME;
- }
- return 0;
+ struct tench {
+ static bool is_good(char ch) {
+ return isalnum(ch) || ch == '_';
+ }
+ };
+ std::string::const_iterator it =
+ std::find_if_not(t.begin(), t.end(), tench::is_good);
+ return (it == t.end())? 0: -ERR_INVALID_TENANT_NAME;
}
// This function enforces Amazon's spec for bucket names.
// (The requirements, not the recommendations.)
-int RGWHandler_ObjStore::validate_bucket_name(const string& bucket)
+int RGWHandler_REST::validate_bucket_name(const string& bucket)
{
int len = bucket.size();
if (len < 3) {
// is at most 1024 bytes long."
// However, we can still have control characters and other nasties in there.
// Just as long as they're utf-8 nasties.
-int RGWHandler_ObjStore::validate_object_name(const string& object)
+int RGWHandler_REST::validate_object_name(const string& object)
{
int len = object.size();
if (len > 1024) {
return OP_UNKNOWN;
}
-int RGWHandler_ObjStore::init_permissions(RGWOp *op)
+int RGWHandler_REST::init_permissions(RGWOp* op)
{
if (op->get_type() == RGW_OP_CREATE_BUCKET)
return 0;
return do_init_permissions();
}
-int RGWHandler_ObjStore::read_permissions(RGWOp *op_obj)
+int RGWHandler_REST::read_permissions(RGWOp* op_obj)
{
bool only_bucket;
return 0;
}
-RGWHandler *RGWREST::get_handler(RGWRados *store, struct req_state *s,
- RGWStreamIO *sio, RGWRESTMgr **pmgr,
- int *init_error)
+RGWHandler_REST* RGWREST::get_handler(RGWRados *store, struct req_state *s,
+ RGWStreamIO *sio, RGWRESTMgr **pmgr,
+ int *init_error)
{
- RGWHandler *handler;
+ RGWHandler_REST* handler;
*init_error = preprocess(s, sio);
if (*init_error < 0)
virtual int verify_permission();
};
-class RGWHandler_ObjStore : public RGWHandler {
+class RGWHandler_REST : public RGWHandler {
protected:
virtual bool is_obj_update_op() { return false; }
virtual RGWOp *op_get() { return NULL; }
static int allocate_formatter(struct req_state *s, int default_formatter,
bool configurable);
public:
- RGWHandler_ObjStore() {}
- virtual ~RGWHandler_ObjStore() {}
- int init_permissions(RGWOp *op);
- int read_permissions(RGWOp *op);
- virtual int retarget(RGWOp *op, RGWOp **new_op) {
+ RGWHandler_REST() {}
+ virtual ~RGWHandler_REST() {}
+
+ int init_permissions(RGWOp* op);
+ int read_permissions(RGWOp* op);
+
+ virtual RGWOp* get_op(RGWRados* store);
+ virtual void put_op(RGWOp* op);
+
+ virtual int retarget(RGWOp* op, RGWOp** new_op) {
*new_op = op;
return 0;
}
// virtual int postauth_init(struct req_init_state *t) = 0;
};
-class RGWHandler_ObjStore_SWIFT;
+class RGWHandler_REST_SWIFT;
class RGWHandler_SWIFT_Auth;
-class RGWHandler_ObjStore_S3;
+class RGWHandler_REST_S3;
class RGWRESTMgr {
virtual RGWRESTMgr *get_resource_mgr(struct req_state *s, const string& uri,
string *out_uri);
- virtual RGWHandler *get_handler(struct req_state *s) { return NULL; }
- virtual void put_handler(RGWHandler *handler) { delete handler; }
+ virtual RGWHandler_REST *get_handler(struct req_state *s) { return NULL; }
+ virtual void put_handler(RGWHandler_REST *handler) { delete handler; }
void set_logging(bool _should_log) { should_log = _should_log; }
bool get_logging() { return should_log; }
static int preprocess(struct req_state *s, RGWClientIO *sio);
public:
RGWREST() {}
- RGWHandler *get_handler(RGWRados *store, struct req_state *s,
- RGWStreamIO *sio,
- RGWRESTMgr **pmgr, int *init_error);
+ RGWHandler_REST *get_handler(RGWRados *store, struct req_state *s,
+ RGWStreamIO *sio,
+ RGWRESTMgr **pmgr, int *init_error);
+#if 0
RGWHandler *get_handler(RGWRados *store, struct req_state *s,
RGWLibIO *io, RGWRESTMgr **pmgr,
int *init_error);
- void put_handler(RGWHandler *handler) {
+#endif
+ void put_handler(RGWHandler_REST *handler) {
mgr.put_handler(handler);
}
RGWRESTMgr_Bucket() {}
virtual ~RGWRESTMgr_Bucket() {}
- RGWHandler *get_handler(struct req_state *s) {
+ RGWHandler_REST* get_handler(struct req_state *s) {
return new RGWHandler_Bucket;
}
};
* Foundation. See file COPYING.
*
*/
-#ifndef CEPH_RGW_REST_CONFIG_H
-#define CEPH_RGW_REST_CONFIG_H
+
+#ifndef RGW_REST_CONFIG_H
+#define RGW_REST_CONFIG_H
class RGWOp_RegionMap_Get : public RGWRESTOp {
RGWRegionMap regionmap;
RGWRESTMgr_Config() {}
virtual ~RGWRESTMgr_Config() {}
- virtual RGWHandler *get_handler(struct req_state *s){
+ virtual RGWHandler_REST* get_handler(struct req_state *s){
return new RGWHandler_Config;
}
};
-#endif
+#endif /* RGW_REST_CONFIG_H */
/* XXX going away ! */
/* static */
-int RGWHandler_ObjStore_Lib::init_from_header(struct req_state *s)
+int RGWHandler_REST_Lib::init_from_header(struct req_state *s)
{
string req;
string first;
public:
RGWRESTMgr_Lib() {}
virtual ~RGWRESTMgr_Lib() {}
+ #warning remove this
+#if 0
virtual RGWHandler* get_handler(struct req_state* s) { return nullptr; }
+#endif
}; /* RGWRESTMgr_Lib */
/* rgw_lib RGWHandler */
-class RGWHandler_ObjStore_Lib : public RGWHandler_ObjStore {
+class RGWHandler_REST_Lib : public RGWHandler_REST {
friend class RGWRESTMgr_Lib;
public:
return RGW_Auth_S3::authorize(store, s);
}
- RGWHandler_ObjStore_Lib() {}
- virtual ~RGWHandler_ObjStore_Lib() {}
+ RGWHandler_REST_Lib() {}
+ virtual ~RGWHandler_REST_Lib() {}
static int init_from_header(struct req_state *s);
-}; /* RGWHandler_ObjStore_Lib */
+}; /* RGWHandler_REST_Lib */
/* RGWOps */
* Foundation. See file COPYING.
*
*/
-#ifndef CEPH_RGW_REST_LOG_H
-#define CEPH_RGW_REST_LOG_H
+
+#ifndef RGW_REST_LOG_H
+#define RGW_REST_LOG_H
#include "rgw_metadata.h"
RGWRESTMgr_Log() {}
virtual ~RGWRESTMgr_Log() {}
- virtual RGWHandler *get_handler(struct req_state *s){
+ virtual RGWHandler_REST* get_handler(struct req_state *s){
return new RGWHandler_Log;
}
};
-#endif
-
+#endif /* RGW_REST_LOG_H */
* Foundation. See file COPYING.
*
*/
-#ifndef CEPH_RGW_REST_METADATA_H
-#define CEPH_RGW_REST_METADATA_H
+
+#ifndef RGW_REST_METADATA_H
+#define RGW_REST_METADATA_H
class RGWOp_Metadata_List : public RGWRESTOp {
public:
RGWRESTMgr_Metadata() {}
virtual ~RGWRESTMgr_Metadata() {}
- virtual RGWHandler *get_handler(struct req_state *s){
+ virtual RGWHandler_REST* get_handler(struct req_state *s){
return new RGWHandler_Metadata;
}
};
-
-#endif
+#endif /* RGW_REST_METADATA_H */
* Foundation. See file COPYING.
*
*/
-#ifndef CEPH_RGW_REST_OPSTATE_H
-#define CEPH_RGW_REST_OPSTATE_H
+
+#ifndef RGW_REST_OPSTATE_H
+#define RGW_REST_OPSTATE_H
class RGWOp_Opstate_List : public RGWRESTOp {
bool sent_header;
RGWRESTMgr_Opstate() {}
virtual ~RGWRESTMgr_Opstate() {}
- virtual RGWHandler *get_handler(struct req_state *s){
+ virtual RGWHandler_REST* get_handler(struct req_state *s){
return new RGWHandler_Opstate;
}
};
-#endif /*!CEPH_RGW_REST_OPSTATE_H*/
-
+#endif /*!RGW_REST_OPSTATE_H*/
return 0;
}
-
void RGWOp_OBJLog_SetBounds::execute() {
string id_str = s->info.args.get("id"),
marker = s->info.args.get("marker"),
* Foundation. See file COPYING.
*
*/
-#ifndef CEPH_RGW_REST_REPLICA_LOG_H
-#define CEPH_RGW_REST_REPLICA_LOG_H
+
+#ifndef RGW_REST_REPLICA_LOG_H
+#define RGW_REST_REPLICA_LOG_H
class RGWOp_OBJLog_GetBounds : public RGWRESTOp {
string prefix;
RGWRESTMgr_ReplicaLog() {}
virtual ~RGWRESTMgr_ReplicaLog() {}
- virtual RGWHandler *get_handler(struct req_state *s){
+ virtual RGWHandler_REST* get_handler(struct req_state *s){
return new RGWHandler_ReplicaLog;
}
};
-#endif /*!CEPH_RGW_REST_REPLICA_LOG_H*/
+#endif /*!RGW_REST_REPLICA_LOG_H*/
rgw_flush_formatter_and_reset(s, s->formatter);
}
-RGWOp *RGWHandler_ObjStore_Service_S3::op_get()
+RGWOp *RGWHandler_REST_Service_S3::op_get()
{
return new RGWListBuckets_ObjStore_S3;
}
-RGWOp *RGWHandler_ObjStore_Service_S3::op_head()
+RGWOp *RGWHandler_REST_Service_S3::op_head()
{
return new RGWListBuckets_ObjStore_S3;
}
-RGWOp *RGWHandler_ObjStore_Bucket_S3::get_obj_op(bool get_data)
+RGWOp *RGWHandler_REST_Bucket_S3::get_obj_op(bool get_data)
{
// Non-website mode
if (get_data)
return new RGWStatBucket_ObjStore_S3;
}
-RGWOp *RGWHandler_ObjStore_Bucket_S3::op_get()
+RGWOp *RGWHandler_REST_Bucket_S3::op_get()
{
if (s->info.args.sub_resource_exists("logging"))
return new RGWGetBucketLogging_ObjStore_S3;
return get_obj_op(true);
}
-RGWOp *RGWHandler_ObjStore_Bucket_S3::op_head()
+RGWOp *RGWHandler_REST_Bucket_S3::op_head()
{
if (is_acl_op()) {
return new RGWGetACLs_ObjStore_S3;
return get_obj_op(false);
}
-RGWOp *RGWHandler_ObjStore_Bucket_S3::op_put()
+RGWOp *RGWHandler_REST_Bucket_S3::op_put()
{
if (s->info.args.sub_resource_exists("logging"))
return NULL;
return new RGWCreateBucket_ObjStore_S3;
}
-RGWOp *RGWHandler_ObjStore_Bucket_S3::op_delete()
+RGWOp *RGWHandler_REST_Bucket_S3::op_delete()
{
if (is_cors_op()) {
return new RGWDeleteCORS_ObjStore_S3;
return new RGWDeleteBucket_ObjStore_S3;
}
-RGWOp *RGWHandler_ObjStore_Bucket_S3::op_post()
+RGWOp *RGWHandler_REST_Bucket_S3::op_post()
{
if ( s->info.request_params == "delete" ) {
return new RGWDeleteMultiObj_ObjStore_S3;
return new RGWPostObj_ObjStore_S3;
}
-RGWOp *RGWHandler_ObjStore_Bucket_S3::op_options()
+RGWOp *RGWHandler_REST_Bucket_S3::op_options()
{
return new RGWOptionsCORS_ObjStore_S3;
}
-RGWOp *RGWHandler_ObjStore_Obj_S3::get_obj_op(bool get_data)
+RGWOp *RGWHandler_REST_Obj_S3::get_obj_op(bool get_data)
{
if (is_acl_op()) {
return new RGWGetACLs_ObjStore_S3;
return get_obj_op;
}
-RGWOp *RGWHandler_ObjStore_Obj_S3::op_get()
+RGWOp *RGWHandler_REST_Obj_S3::op_get()
{
if (is_acl_op()) {
return new RGWGetACLs_ObjStore_S3;
return get_obj_op(true);
}
-RGWOp *RGWHandler_ObjStore_Obj_S3::op_head()
+RGWOp *RGWHandler_REST_Obj_S3::op_head()
{
if (is_acl_op()) {
return new RGWGetACLs_ObjStore_S3;
return get_obj_op(false);
}
-RGWOp *RGWHandler_ObjStore_Obj_S3::op_put()
+RGWOp *RGWHandler_REST_Obj_S3::op_put()
{
if (is_acl_op()) {
return new RGWPutACLs_ObjStore_S3;
return new RGWCopyObj_ObjStore_S3;
}
-RGWOp *RGWHandler_ObjStore_Obj_S3::op_delete()
+RGWOp *RGWHandler_REST_Obj_S3::op_delete()
{
string upload_id = s->info.args.get("uploadId");
return new RGWAbortMultipart_ObjStore_S3;
}
-RGWOp *RGWHandler_ObjStore_Obj_S3::op_post()
+RGWOp *RGWHandler_REST_Obj_S3::op_post()
{
if (s->info.args.exists("uploadId"))
return new RGWCompleteMultipart_ObjStore_S3;
return NULL;
}
-RGWOp *RGWHandler_ObjStore_Obj_S3::op_options()
+RGWOp *RGWHandler_REST_Obj_S3::op_options()
{
return new RGWOptionsCORS_ObjStore_S3;
}
-int RGWHandler_ObjStore_S3::init_from_header(struct req_state *s,
- int default_formatter,
- bool configurable_format)
+int RGWHandler_REST_S3::init_from_header(struct req_state* s,
+ int default_formatter,
+ bool configurable_format)
{
string req;
string first;
return 0;
}
-int RGWHandler_ObjStore_S3::postauth_init()
+int RGWHandler_REST_S3::postauth_init()
{
struct req_init_state *t = &s->init_state;
bool relaxed_names = s->cct->_conf->rgw_relaxed_s3_bucket_names;
return (num_periods == 3);
}
-int RGWHandler_ObjStore_S3::validate_bucket_name(const string& bucket,
+int RGWHandler_REST_S3::validate_bucket_name(const string& bucket,
bool relaxed_names)
{
- int ret = RGWHandler_ObjStore::validate_bucket_name(bucket);
+ int ret = RGWHandler_REST::validate_bucket_name(bucket);
if (ret < 0)
return ret;
return 0;
}
-int RGWHandler_ObjStore_S3::init(RGWRados *store, struct req_state *s,
+int RGWHandler_REST_S3::init(RGWRados *store, struct req_state *s,
RGWClientIO *cio)
{
int ret;
}
}
- return RGWHandler_ObjStore::init(store, s, cio);
+ return RGWHandler_REST::init(store, s, cio);
}
/*
int RGWHandler_Auth_S3::init(RGWRados *store, struct req_state *state,
RGWClientIO *cio)
{
- int ret = RGWHandler_ObjStore_S3::init_from_header(state, RGW_FORMAT_JSON,
+ int ret = RGWHandler_REST_S3::init_from_header(state, RGW_FORMAT_JSON,
true);
if (ret < 0)
return ret;
- return RGWHandler_ObjStore::init(store, state, cio);
+ return RGWHandler_REST::init(store, state, cio);
}
-RGWHandler *RGWRESTMgr_S3::get_handler(struct req_state *s)
+RGWHandler_REST* RGWRESTMgr_S3::get_handler(struct req_state *s)
{
bool is_s3website = enable_s3website && (s->prot_flags & RGW_REST_WEBSITE);
- int ret = RGWHandler_ObjStore_S3::init_from_header(s, is_s3website ? RGW_FORMAT_HTML : RGW_FORMAT_XML, false);
+ int ret =
+ RGWHandler_REST_S3::init_from_header(s,
+ is_s3website ? RGW_FORMAT_HTML :
+ RGW_FORMAT_XML, false);
if (ret < 0)
return NULL;
- RGWHandler* handler;
+ RGWHandler_REST* handler;
// TODO: Make this more readable
if (is_s3website) {
if (s->init_state.url_bucket.empty()) {
- handler = new RGWHandler_ObjStore_Service_S3Website;
+ handler = new RGWHandler_REST_Service_S3Website;
} else if (s->object.empty()) {
- handler = new RGWHandler_ObjStore_Bucket_S3Website;
+ handler = new RGWHandler_REST_Bucket_S3Website;
} else {
- handler = new RGWHandler_ObjStore_Obj_S3Website;
+ handler = new RGWHandler_REST_Obj_S3Website;
}
} else {
if (s->init_state.url_bucket.empty()) {
- handler = new RGWHandler_ObjStore_Service_S3;
+ handler = new RGWHandler_REST_Service_S3;
} else if (s->object.empty()) {
- handler = new RGWHandler_ObjStore_Bucket_S3;
+ handler = new RGWHandler_REST_Bucket_S3;
} else {
- handler = new RGWHandler_ObjStore_Obj_S3;
+ handler = new RGWHandler_REST_Obj_S3;
}
}
- ldout(s->cct, 20) << __func__ << " handler=" << typeid(*handler).name() << dendl;
+ ldout(s->cct, 20) << __func__ << " handler=" << typeid(*handler).name()
+ << dendl;
return handler;
}
-int RGWHandler_ObjStore_S3Website::retarget(RGWOp *op, RGWOp **new_op) {
+int RGWHandler_REST_S3Website::retarget(RGWOp* op, RGWOp** new_op) {
*new_op = op;
ldout(s->cct, 10) << __func__ << "Starting retarget" << dendl;
return 0;
RGWObjectCtx& obj_ctx = *static_cast<RGWObjectCtx *>(s->obj_ctx);
- int ret = store->get_bucket_info(obj_ctx, s->bucket_tenant, s->bucket_name, s->bucket_info, NULL, &s->bucket_attrs);
+ int ret = store->get_bucket_info(obj_ctx, s->bucket_tenant,
+ s->bucket_name, s->bucket_info, NULL,
+ &s->bucket_attrs);
if (ret < 0) {
// TODO-FUTURE: if the bucket does not exist, maybe expose it here?
return -ERR_NO_SUCH_BUCKET;
rgw_obj_key new_obj;
s->bucket_info.website_conf.get_effective_key(s->object.name, &new_obj.name);
- ldout(s->cct, 10) << "retarget get_effective_key " << s->object << " -> " << new_obj << dendl;
+ ldout(s->cct, 10) << "retarget get_effective_key " << s->object << " -> "
+ << new_obj << dendl;
RGWBWRoutingRule rrule;
- bool should_redirect = s->bucket_info.website_conf.should_redirect(new_obj.name, 0, &rrule);
+ bool should_redirect =
+ s->bucket_info.website_conf.should_redirect(new_obj.name, 0, &rrule);
if (should_redirect) {
const string& hostname = s->info.env->get("HTTP_HOST", "");
- const string& protocol = (s->info.env->get("SERVER_PORT_SECURE") ? "https" : "http");
+ const string& protocol =
+ (s->info.env->get("SERVER_PORT_SECURE") ? "https" : "http");
int redirect_code = 0;
- rrule.apply_rule(protocol, hostname, s->object.name, &s->redirect, &redirect_code);
+ rrule.apply_rule(protocol, hostname, s->object.name, &s->redirect,
+ &redirect_code);
// APply a custom HTTP response code
if (redirect_code > 0)
s->err.http_ret = redirect_code; // Apply a custom HTTP response code
- ldout(s->cct, 10) << "retarget redirect code=" << redirect_code << " proto+host:" << protocol << "://" << hostname << " -> " << s->redirect << dendl;
+ ldout(s->cct, 10) << "retarget redirect code=" << redirect_code
+ << " proto+host:" << protocol << "://" << hostname
+ << " -> " << s->redirect << dendl;
return -ERR_WEBSITE_REDIRECT;
}
/*
- * FIXME: if s->object != new_obj, drop op and create a new op to handle operation. Or
- * remove this comment if it's not applicable anymore
+ * FIXME: if s->object != new_obj, drop op and create a new op to handle
+ * operation. Or remove this comment if it's not applicable anymore
*/
s->object = new_obj;
return 0;
}
-RGWOp *RGWHandler_ObjStore_S3Website::op_get()
+RGWOp* RGWHandler_REST_S3Website::op_get()
{
return get_obj_op(true);
}
-RGWOp *RGWHandler_ObjStore_S3Website::op_head()
+RGWOp* RGWHandler_REST_S3Website::op_head()
{
return get_obj_op(false);
}
-int RGWHandler_ObjStore_S3Website::get_errordoc(const string& errordoc_key, string *error_content) {
- ldout(s->cct, 20) << "TODO Serve Custom error page here if bucket has <Error>" << dendl;
- *error_content = errordoc_key;
- // 1. Check if errordoc exists
- // 2. Check if errordoc is public
- // 3. Fetch errordoc content
- /*
- * FIXME maybe: need to make sure all of the fields for conditional requests are cleared
- */
- RGWGetObj_ObjStore_S3Website *getop = new RGWGetObj_ObjStore_S3Website(true);
- getop->set_get_data(true);
- getop->init(store, s, this);
-
- RGWGetObj_CB cb(getop);
- rgw_obj obj(s->bucket, errordoc_key);
- RGWObjectCtx rctx(store);
- //RGWRados::Object op_target(store, s->bucket_info, *static_cast<RGWObjectCtx *>(s->obj_ctx), obj);
- RGWRados::Object op_target(store, s->bucket_info, rctx, obj);
- RGWRados::Object::Read read_op(&op_target);
-
- int ret;
- int64_t ofs = 0;
- int64_t end = -1;
- ret = read_op.prepare(&ofs, &end);
- if (ret < 0) {
- goto done;
- }
+int RGWHandler_REST_S3Website::get_errordoc(const string& errordoc_key,
+ std::string* error_content) {
+ ldout(s->cct, 20) << "TODO Serve Custom error page here if bucket has "
+ "<Error>" << dendl;
+ *error_content = errordoc_key;
+ // 1. Check if errordoc exists
+ // 2. Check if errordoc is public
+ // 3. Fetch errordoc content
+ /*
+ * FIXME maybe: need to make sure all of the fields for conditional
+ * requests are cleared
+ */
+ RGWGetObj_ObjStore_S3Website* getop =
+ new RGWGetObj_ObjStore_S3Website(true);
+ getop->set_get_data(true);
+ getop->init(store, s, this);
+
+ RGWGetObj_CB cb(getop);
+ rgw_obj obj(s->bucket, errordoc_key);
+ RGWObjectCtx rctx(store);
+ //RGWRados::Object op_target(store, s->bucket_info, *static_cast<RGWObjectCtx *>(s->obj_ctx), obj);
+ RGWRados::Object op_target(store, s->bucket_info, rctx, obj);
+ RGWRados::Object::Read read_op(&op_target);
- ret = read_op.iterate(ofs, end, &cb); // FIXME: need to know the final size?
+ int ret;
+ int64_t ofs = 0;
+ int64_t end = -1;
+ ret = read_op.prepare(&ofs, &end);
+ if (ret < 0) {
+ goto done;
+ }
+
+ ret = read_op.iterate(ofs, end, &cb); // FIXME: need to know the final size?
done:
- delete getop;
- return ret;
+ delete getop;
+ return ret;
}
-int RGWHandler_ObjStore_S3Website::error_handler(int err_no, string *error_content) {
- const struct rgw_http_errors *r;
+int RGWHandler_REST_S3Website::error_handler(int err_no,
+ string* error_content) {
+ const struct rgw_http_errors* r;
int http_error_code = -1;
r = search_err(err_no, RGW_HTTP_ERRORS, ARRAY_LEN(RGW_HTTP_ERRORS));
if (r) {
}
RGWBWRoutingRule rrule;
- bool should_redirect = s->bucket_info.website_conf.should_redirect(s->object.name, http_error_code, &rrule);
+ bool should_redirect =
+ s->bucket_info.website_conf.should_redirect(s->object.name, http_error_code,
+ &rrule);
if (should_redirect) {
const string& hostname = s->info.env->get("HTTP_HOST", "");
- const string& protocol = (s->info.env->get("SERVER_PORT_SECURE") ? "https" : "http");
+ const string& protocol =
+ (s->info.env->get("SERVER_PORT_SECURE") ? "https" : "http");
int redirect_code = 0;
- rrule.apply_rule(protocol, hostname, s->object.name, &s->redirect, &redirect_code);
- // APply a custom HTTP response code
+ rrule.apply_rule(protocol, hostname, s->object.name, &s->redirect,
+ &redirect_code);
+ // Apply a custom HTTP response code
if (redirect_code > 0)
s->err.http_ret = redirect_code; // Apply a custom HTTP response code
- ldout(s->cct, 10) << "error handler redirect code=" << redirect_code << " proto+host:" << protocol << "://" << hostname << " -> " << s->redirect << dendl;
+ ldout(s->cct, 10) << "error handler redirect code=" << redirect_code
+ << " proto+host:" << protocol << "://" << hostname
+ << " -> " << s->redirect << dendl;
return -ERR_WEBSITE_REDIRECT;
} else if (!s->bucket_info.website_conf.error_doc.empty()) {
- RGWHandler_ObjStore_S3Website::get_errordoc(s->bucket_info.website_conf.error_doc, error_content);
+ RGWHandler_REST_S3Website::get_errordoc(
+ s->bucket_info.website_conf.error_doc, error_content);
} else {
ldout(s->cct, 20) << "No special error handling today!" << dendl;
}
return err_no;
}
-RGWOp *RGWHandler_ObjStore_Obj_S3Website::get_obj_op(bool get_data)
+RGWOp* RGWHandler_REST_Obj_S3Website::get_obj_op(bool get_data)
{
/** If we are in website mode, then it is explicitly impossible to run GET or
* HEAD on the actual directory. We must convert the request to run on the
* suffix object instead!
*/
- RGWGetObj_ObjStore_S3Website *op = new RGWGetObj_ObjStore_S3Website;
+ RGWGetObj_ObjStore_S3Website* op = new RGWGetObj_ObjStore_S3Website;
op->set_get_data(get_data);
return op;
}
-RGWOp *RGWHandler_ObjStore_Bucket_S3Website::get_obj_op(bool get_data)
+RGWOp* RGWHandler_REST_Bucket_S3Website::get_obj_op(bool get_data)
{
/** If we are in website mode, then it is explicitly impossible to run GET or
* HEAD on the actual directory. We must convert the request to run on the
* suffix object instead!
*/
- RGWGetObj_ObjStore_S3Website *op = new RGWGetObj_ObjStore_S3Website;
+ RGWGetObj_ObjStore_S3Website* op = new RGWGetObj_ObjStore_S3Website;
op->set_get_data(get_data);
return op;
}
-RGWOp *RGWHandler_ObjStore_Service_S3Website::get_obj_op(bool get_data)
+RGWOp* RGWHandler_REST_Service_S3Website::get_obj_op(bool get_data)
{
/** If we are in website mode, then it is explicitly impossible to run GET or
* HEAD on the actual directory. We must convert the request to run on the
* suffix object instead!
*/
- RGWGetObj_ObjStore_S3Website *op = new RGWGetObj_ObjStore_S3Website;
+ RGWGetObj_ObjStore_S3Website* op = new RGWGetObj_ObjStore_S3Website;
op->set_get_data(get_data);
return op;
}
static int authorize(RGWRados *store, struct req_state *s);
};
-class RGWHandler_Auth_S3 : public RGWHandler_ObjStore {
+class RGWHandler_Auth_S3 : public RGWHandler_REST {
friend class RGWRESTMgr_S3;
public:
- RGWHandler_Auth_S3() : RGWHandler_ObjStore() {}
+ RGWHandler_Auth_S3() : RGWHandler_REST() {}
virtual ~RGWHandler_Auth_S3() {}
virtual int validate_bucket_name(const string& bucket) {
int postauth_init() { return 0; }
};
-class RGWHandler_ObjStore_S3 : public RGWHandler_ObjStore {
+class RGWHandler_REST_S3 : public RGWHandler_REST {
friend class RGWRESTMgr_S3;
public:
static int init_from_header(struct req_state *s, int default_formatter, bool configurable_format);
- RGWHandler_ObjStore_S3() : RGWHandler_ObjStore() {}
- virtual ~RGWHandler_ObjStore_S3() {}
+ RGWHandler_REST_S3() : RGWHandler_REST() {}
+ virtual ~RGWHandler_REST_S3() {}
int validate_bucket_name(const string& bucket, bool relaxed_names);
- using RGWHandler_ObjStore::validate_bucket_name;
+ int get_errordoc(const string& errordoc_key, string* error_content);
+
+ using RGWHandler_REST::validate_bucket_name;
virtual int init(RGWRados *store, struct req_state *s, RGWClientIO *cio);
virtual int authorize() {
}
};
-class RGWHandler_ObjStore_Service_S3 : public RGWHandler_ObjStore_S3 {
+class RGWHandler_REST_Service_S3 : public RGWHandler_REST_S3 {
protected:
RGWOp *op_get();
RGWOp *op_head();
public:
- RGWHandler_ObjStore_Service_S3() {}
- virtual ~RGWHandler_ObjStore_Service_S3() {}
+ RGWHandler_REST_Service_S3() {}
+ virtual ~RGWHandler_REST_Service_S3() {}
};
-class RGWHandler_ObjStore_Bucket_S3 : public RGWHandler_ObjStore_S3 {
+class RGWHandler_REST_Bucket_S3 : public RGWHandler_REST_S3 {
protected:
bool is_acl_op() {
return s->info.args.exists("acl");
RGWOp *op_post();
RGWOp *op_options();
public:
- RGWHandler_ObjStore_Bucket_S3() {}
- virtual ~RGWHandler_ObjStore_Bucket_S3() {}
+ RGWHandler_REST_Bucket_S3() {}
+ virtual ~RGWHandler_REST_Bucket_S3() {}
};
-class RGWHandler_ObjStore_Obj_S3 : public RGWHandler_ObjStore_S3 {
+class RGWHandler_REST_Obj_S3 : public RGWHandler_REST_S3 {
protected:
bool is_acl_op() {
return s->info.args.exists("acl");
RGWOp *op_post();
RGWOp *op_options();
public:
- RGWHandler_ObjStore_Obj_S3() {}
- virtual ~RGWHandler_ObjStore_Obj_S3() {}
+ RGWHandler_REST_Obj_S3() {}
+ virtual ~RGWHandler_REST_Obj_S3() {}
};
class RGWRESTMgr_S3 : public RGWRESTMgr {
virtual ~RGWRESTMgr_S3() {}
- virtual RGWHandler *get_handler(struct req_state *s);
+ virtual RGWHandler_REST *get_handler(struct req_state *s);
};
-class RGWHandler_ObjStore_Obj_S3Website;
+class RGWHandler_REST_Obj_S3Website;
#endif
#include "rgw_rest_s3.h"
-class RGWHandler_ObjStore_S3Website : public RGWHandler_ObjStore_S3 {
+class RGWHandler_REST_S3Website : public RGWHandler_REST_S3 {
protected:
int retarget(RGWOp *op, RGWOp **new_op);
// TODO: this should be virtual I think, and ensure that it's always
int get_errordoc(const string& errordoc_key, string *error_content);
public:
- RGWHandler_ObjStore_S3Website() : RGWHandler_ObjStore_S3() {}
- virtual ~RGWHandler_ObjStore_S3Website() {}
+ RGWHandler_REST_S3Website() : RGWHandler_REST_S3() {}
+ virtual ~RGWHandler_REST_S3Website() {}
virtual int error_handler(int err_no, string *error_content);
};
-class RGWHandler_ObjStore_Service_S3Website : public RGWHandler_ObjStore_S3Website {
+class RGWHandler_REST_Service_S3Website : public RGWHandler_REST_S3Website {
protected:
virtual RGWOp *get_obj_op(bool get_data);
public:
- RGWHandler_ObjStore_Service_S3Website() {}
- virtual ~RGWHandler_ObjStore_Service_S3Website() {}
+ RGWHandler_REST_Service_S3Website() {}
+ virtual ~RGWHandler_REST_Service_S3Website() {}
};
-class RGWHandler_ObjStore_Obj_S3Website : public RGWHandler_ObjStore_S3Website {
+class RGWHandler_REST_Obj_S3Website : public RGWHandler_REST_S3Website {
protected:
virtual RGWOp *get_obj_op(bool get_data);
public:
- RGWHandler_ObjStore_Obj_S3Website() {}
- virtual ~RGWHandler_ObjStore_Obj_S3Website() {}
+ RGWHandler_REST_Obj_S3Website() {}
+ virtual ~RGWHandler_REST_Obj_S3Website() {}
};
/* The cross-inheritance from Obj to Bucket is deliberate!
* S3Websites do NOT support any bucket operations
*/
-class RGWHandler_ObjStore_Bucket_S3Website : public RGWHandler_ObjStore_S3Website {
+class RGWHandler_REST_Bucket_S3Website : public RGWHandler_REST_S3Website {
protected:
RGWOp *get_obj_op(bool get_data);
public:
- RGWHandler_ObjStore_Bucket_S3Website() {}
- virtual ~RGWHandler_ObjStore_Bucket_S3Website() {}
+ RGWHandler_REST_Bucket_S3Website() {}
+ virtual ~RGWHandler_REST_Bucket_S3Website() {}
};
// TODO: do we actually need this?
rgw_flush_formatter_and_reset(s, s->formatter);
}
-RGWOp *RGWHandler_ObjStore_Service_SWIFT::op_get()
+RGWOp *RGWHandler_REST_Service_SWIFT::op_get()
{
return new RGWListBuckets_ObjStore_SWIFT;
}
-RGWOp *RGWHandler_ObjStore_Service_SWIFT::op_head()
+RGWOp *RGWHandler_REST_Service_SWIFT::op_head()
{
return new RGWStatAccount_ObjStore_SWIFT;
}
-RGWOp *RGWHandler_ObjStore_Service_SWIFT::op_post()
+RGWOp *RGWHandler_REST_Service_SWIFT::op_post()
{
if (s->info.args.exists("bulk-delete")) {
return new RGWBulkDelete_ObjStore_SWIFT;
return new RGWPutMetadataAccount_ObjStore_SWIFT;
}
-RGWOp *RGWHandler_ObjStore_Service_SWIFT::op_delete()
+RGWOp *RGWHandler_REST_Service_SWIFT::op_delete()
{
if (s->info.args.exists("bulk-delete")) {
return new RGWBulkDelete_ObjStore_SWIFT;
return NULL;
}
-RGWOp *RGWHandler_ObjStore_Bucket_SWIFT::get_obj_op(bool get_data)
+RGWOp *RGWHandler_REST_Bucket_SWIFT::get_obj_op(bool get_data)
{
if (is_acl_op()) {
return new RGWGetACLs_ObjStore_SWIFT;
return new RGWStatBucket_ObjStore_SWIFT;
}
-RGWOp *RGWHandler_ObjStore_Bucket_SWIFT::op_get()
+RGWOp *RGWHandler_REST_Bucket_SWIFT::op_get()
{
if (is_acl_op()) {
return new RGWGetACLs_ObjStore_SWIFT;
return get_obj_op(true);
}
-RGWOp *RGWHandler_ObjStore_Bucket_SWIFT::op_head()
+RGWOp *RGWHandler_REST_Bucket_SWIFT::op_head()
{
if (is_acl_op()) {
return new RGWGetACLs_ObjStore_SWIFT;
return get_obj_op(false);
}
-RGWOp *RGWHandler_ObjStore_Bucket_SWIFT::op_put()
+RGWOp *RGWHandler_REST_Bucket_SWIFT::op_put()
{
if (is_acl_op()) {
return new RGWPutACLs_ObjStore_SWIFT;
return new RGWCreateBucket_ObjStore_SWIFT;
}
-RGWOp *RGWHandler_ObjStore_Bucket_SWIFT::op_delete()
+RGWOp *RGWHandler_REST_Bucket_SWIFT::op_delete()
{
return new RGWDeleteBucket_ObjStore_SWIFT;
}
-RGWOp *RGWHandler_ObjStore_Bucket_SWIFT::op_post()
+RGWOp *RGWHandler_REST_Bucket_SWIFT::op_post()
{
return new RGWPutMetadataBucket_ObjStore_SWIFT;
}
-RGWOp *RGWHandler_ObjStore_Bucket_SWIFT::op_options()
+RGWOp *RGWHandler_REST_Bucket_SWIFT::op_options()
{
return new RGWOptionsCORS_ObjStore_SWIFT;
}
-RGWOp *RGWHandler_ObjStore_Obj_SWIFT::get_obj_op(bool get_data)
+RGWOp *RGWHandler_REST_Obj_SWIFT::get_obj_op(bool get_data)
{
if (is_acl_op()) {
return new RGWGetACLs_ObjStore_SWIFT;
return get_obj_op;
}
-RGWOp *RGWHandler_ObjStore_Obj_SWIFT::op_get()
+RGWOp *RGWHandler_REST_Obj_SWIFT::op_get()
{
if (is_acl_op()) {
return new RGWGetACLs_ObjStore_SWIFT;
return get_obj_op(true);
}
-RGWOp *RGWHandler_ObjStore_Obj_SWIFT::op_head()
+RGWOp *RGWHandler_REST_Obj_SWIFT::op_head()
{
if (is_acl_op()) {
return new RGWGetACLs_ObjStore_SWIFT;
return get_obj_op(false);
}
-RGWOp *RGWHandler_ObjStore_Obj_SWIFT::op_put()
+RGWOp *RGWHandler_REST_Obj_SWIFT::op_put()
{
if (is_acl_op()) {
return new RGWPutACLs_ObjStore_SWIFT;
return new RGWCopyObj_ObjStore_SWIFT;
}
-RGWOp *RGWHandler_ObjStore_Obj_SWIFT::op_delete()
+RGWOp *RGWHandler_REST_Obj_SWIFT::op_delete()
{
return new RGWDeleteObj_ObjStore_SWIFT;
}
-RGWOp *RGWHandler_ObjStore_Obj_SWIFT::op_post()
+RGWOp *RGWHandler_REST_Obj_SWIFT::op_post()
{
return new RGWPutMetadataObject_ObjStore_SWIFT;
}
-RGWOp *RGWHandler_ObjStore_Obj_SWIFT::op_copy()
+RGWOp *RGWHandler_REST_Obj_SWIFT::op_copy()
{
return new RGWCopyObj_ObjStore_SWIFT;
}
-RGWOp *RGWHandler_ObjStore_Obj_SWIFT::op_options()
+RGWOp *RGWHandler_REST_Obj_SWIFT::op_options()
{
return new RGWOptionsCORS_ObjStore_SWIFT;
}
-int RGWHandler_ObjStore_SWIFT::authorize()
+int RGWHandler_REST_SWIFT::authorize()
{
if ((!s->os_auth_token && s->info.args.get("temp_url_sig").empty()) ||
(s->op == OP_OPTIONS)) {
return 0;
}
-int RGWHandler_ObjStore_SWIFT::postauth_init()
+int RGWHandler_REST_SWIFT::postauth_init()
{
- struct req_init_state *t = &s->init_state;
+ struct req_init_state* t = &s->init_state;
/* XXX Stub this until Swift Auth sets account into URL. */
s->bucket_tenant = s->user.user_id.tenant;
s->bucket_name = t->url_bucket;
- dout(10) << "s->object=" << (!s->object.empty() ? s->object : rgw_obj_key("<NULL>"))
- << " s->bucket=" << rgw_make_bucket_entry_name(s->bucket_tenant, s->bucket_name) << dendl;
+ dout(10) << "s->object=" <<
+ (!s->object.empty() ? s->object : rgw_obj_key("<NULL>"))
+ << " s->bucket="
+ << rgw_make_bucket_entry_name(s->bucket_tenant, s->bucket_name)
+ << dendl;
int ret;
ret = validate_tenant_name(s->bucket_tenant);
return 0;
}
-int RGWHandler_ObjStore_SWIFT::validate_bucket_name(const string& bucket)
+int RGWHandler_REST_SWIFT::validate_bucket_name(const string& bucket)
{
- int ret = RGWHandler_ObjStore::validate_bucket_name(bucket);
+ int ret = RGWHandler_REST::validate_bucket_name(bucket);
if (ret < 0)
return ret;
}
}
-int RGWHandler_ObjStore_SWIFT::init_from_header(struct req_state *s)
+int RGWHandler_REST_SWIFT::init_from_header(struct req_state *s)
{
string req;
string first;
/* verify that the request_uri conforms with what's expected */
char buf[g_conf->rgw_swift_url_prefix.length() + 16 + tenant_path.length()];
- int blen = sprintf(buf, "/%s/v1%s", g_conf->rgw_swift_url_prefix.c_str(), tenant_path.c_str());
+ int blen = sprintf(buf, "/%s/v1%s",
+ g_conf->rgw_swift_url_prefix.c_str(), tenant_path.c_str());
if (s->decoded_uri[0] != '/' ||
s->decoded_uri.compare(0, blen, buf) != 0) {
return -ENOENT;
s->init_state.url_bucket = first;
if (req.size()) {
- s->object = rgw_obj_key(req, s->info.env->get("HTTP_X_OBJECT_VERSION_ID", "")); /* rgw swift extension */
+ s->object =
+ rgw_obj_key(req, s->info.env->get("HTTP_X_OBJECT_VERSION_ID", "")); /* rgw swift extension */
s->info.effective_uri.append("/" + s->object.name);
}
return 0;
}
-int RGWHandler_ObjStore_SWIFT::init(RGWRados *store, struct req_state *s,
- RGWClientIO *cio)
+int RGWHandler_REST_SWIFT::init(RGWRados* store, struct req_state* s,
+ RGWClientIO *cio)
{
struct req_init_state *t = &s->init_state;
s->op = OP_PUT;
}
- return RGWHandler_ObjStore::init(store, s, cio);
+ return RGWHandler_REST::init(store, s, cio);
}
-RGWHandler *RGWRESTMgr_SWIFT::get_handler(struct req_state *s)
+RGWHandler_REST* RGWRESTMgr_SWIFT::get_handler(struct req_state *s)
{
- int ret = RGWHandler_ObjStore_SWIFT::init_from_header(s);
+ int ret = RGWHandler_REST_SWIFT::init_from_header(s);
if (ret < 0)
return NULL;
if (s->init_state.url_bucket.empty())
- return new RGWHandler_ObjStore_Service_SWIFT;
+ return new RGWHandler_REST_Service_SWIFT;
if (s->object.empty())
- return new RGWHandler_ObjStore_Bucket_SWIFT;
+ return new RGWHandler_REST_Bucket_SWIFT;
- return new RGWHandler_ObjStore_Obj_SWIFT;
+ return new RGWHandler_REST_Obj_SWIFT;
}
void send_response();
};
-class RGWHandler_ObjStore_SWIFT : public RGWHandler_ObjStore {
+class RGWHandler_REST_SWIFT : public RGWHandler_REST {
friend class RGWRESTMgr_SWIFT;
protected:
virtual bool is_acl_op() {
static int init_from_header(struct req_state *s);
public:
- RGWHandler_ObjStore_SWIFT() {}
- virtual ~RGWHandler_ObjStore_SWIFT() {}
+ RGWHandler_REST_SWIFT() {}
+ virtual ~RGWHandler_REST_SWIFT() {}
int validate_bucket_name(const string& bucket);
void free_policy(RGWAccessControlPolicy *policy) { delete policy; }
};
-class RGWHandler_ObjStore_Service_SWIFT : public RGWHandler_ObjStore_SWIFT {
+class RGWHandler_REST_Service_SWIFT : public RGWHandler_REST_SWIFT {
protected:
RGWOp *op_get();
RGWOp *op_head();
RGWOp *op_post();
RGWOp *op_delete();
public:
- RGWHandler_ObjStore_Service_SWIFT() {}
- virtual ~RGWHandler_ObjStore_Service_SWIFT() {}
+ RGWHandler_REST_Service_SWIFT() {}
+ virtual ~RGWHandler_REST_Service_SWIFT() {}
};
-class RGWHandler_ObjStore_Bucket_SWIFT : public RGWHandler_ObjStore_SWIFT {
+class RGWHandler_REST_Bucket_SWIFT : public RGWHandler_REST_SWIFT {
protected:
bool is_obj_update_op() {
return s->op == OP_POST;
RGWOp *op_post();
RGWOp *op_options();
public:
- RGWHandler_ObjStore_Bucket_SWIFT() {}
- virtual ~RGWHandler_ObjStore_Bucket_SWIFT() {}
+ RGWHandler_REST_Bucket_SWIFT() {}
+ virtual ~RGWHandler_REST_Bucket_SWIFT() {}
};
-class RGWHandler_ObjStore_Obj_SWIFT : public RGWHandler_ObjStore_SWIFT {
+class RGWHandler_REST_Obj_SWIFT : public RGWHandler_REST_SWIFT {
protected:
bool is_obj_update_op() {
return s->op == OP_POST;
RGWOp *op_post();
RGWOp *op_copy();
RGWOp *op_options();
+
public:
- RGWHandler_ObjStore_Obj_SWIFT() {}
- virtual ~RGWHandler_ObjStore_Obj_SWIFT() {}
+ RGWHandler_REST_Obj_SWIFT() {}
+ virtual ~RGWHandler_REST_Obj_SWIFT() {}
};
class RGWRESTMgr_SWIFT : public RGWRESTMgr {
RGWRESTMgr_SWIFT() {}
virtual ~RGWRESTMgr_SWIFT() {}
- virtual RGWHandler *get_handler(struct req_state *s);
+ virtual RGWHandler_REST *get_handler(struct req_state *s);
};
#endif
RGWRESTMgr_Usage() {}
virtual ~RGWRESTMgr_Usage() {}
- RGWHandler *get_handler(struct req_state *s) {
+ RGWHandler_REST* get_handler(struct req_state *s) {
return new RGWHandler_Usage;
}
};
-
#endif
RGWRESTMgr_User() {}
virtual ~RGWRESTMgr_User() {}
- RGWHandler *get_handler(struct req_state *s) {
+ RGWHandler_REST *get_handler(struct req_state *s) {
return new RGWHandler_User;
}
};
virtual const string name() { return "swift_auth_get"; }
};
-class RGWHandler_SWIFT_Auth : public RGWHandler {
+class RGWHandler_SWIFT_Auth : public RGWHandler_REST {
public:
RGWHandler_SWIFT_Auth() {}
~RGWHandler_SWIFT_Auth() {}
virtual RGWRESTMgr *get_resource_mgr(struct req_state *s, const string& uri, string *out_uri) {
return this;
}
- virtual RGWHandler *get_handler(struct req_state *s) {
+ virtual RGWHandler_REST* get_handler(struct req_state *s) {
return new RGWHandler_SWIFT_Auth;
}
};