}
if (apis_map.count("swift") > 0) {
- RGWRESTMgr_SWIFT* const swift_resource = new RGWRESTMgr_SWIFT;
+ static const rgw::auth::swift::DefaultStrategy auth_strategy(g_ceph_context,
+ store);
+
+ RGWRESTMgr_SWIFT* const swift_resource = new RGWRESTMgr_SWIFT(
+ &auth_strategy);
if (! g_conf->rgw_cross_domain_policy.empty()) {
swift_resource->register_resource("crossdomain.xml",
set_logging(new RGWRESTMgr_SWIFT_HealthCheck));
swift_resource->register_resource("info",
- set_logging(new RGWRESTMgr_SWIFT_Info));
+ set_logging(new RGWRESTMgr_SWIFT_Info(&auth_strategy)));
if (! swift_at_root) {
rest.register_resource(g_conf->rgw_swift_url_prefix,
friend class RGWRESTMgr_SWIFT;
friend class RGWRESTMgr_SWIFT_Info;
protected:
+ const rgw::auth::Strategy& auth_strategy;
+
virtual bool is_acl_op() {
return false;
}
static int init_from_header(struct req_state* s,
const std::string& frontend_prefix);
public:
- RGWHandler_REST_SWIFT() {}
- ~RGWHandler_REST_SWIFT() override {}
+ RGWHandler_REST_SWIFT(const rgw::auth::Strategy& auth_strategy)
+ : auth_strategy(auth_strategy) {
+ }
+ ~RGWHandler_REST_SWIFT() override = default;
static int validate_bucket_name(const string& bucket);
int authorize() override;
int postauth_init() override;
- RGWAccessControlPolicy *alloc_policy() { return NULL; /* return new RGWAccessControlPolicy_SWIFT; */ }
+ RGWAccessControlPolicy *alloc_policy() { return nullptr; /* return new RGWAccessControlPolicy_SWIFT; */ }
void free_policy(RGWAccessControlPolicy *policy) { delete policy; }
};
RGWOp *op_post() override;
RGWOp *op_delete() override;
public:
- RGWHandler_REST_Service_SWIFT() {}
- ~RGWHandler_REST_Service_SWIFT() override {}
+ using RGWHandler_REST_SWIFT::RGWHandler_REST_SWIFT;
+ ~RGWHandler_REST_Service_SWIFT() override = default;
};
class RGWHandler_REST_Bucket_SWIFT : public RGWHandler_REST_SWIFT {
RGWOp *op_post() override;
RGWOp *op_options() override;
public:
- RGWHandler_REST_Bucket_SWIFT() {}
- ~RGWHandler_REST_Bucket_SWIFT() override {}
+ using RGWHandler_REST_SWIFT::RGWHandler_REST_SWIFT;
+ ~RGWHandler_REST_Bucket_SWIFT() override = default;
int error_handler(int err_no, std::string *error_content) override {
return website_handler->error_handler(err_no, error_content);
RGWOp *op_options() override;
public:
- RGWHandler_REST_Obj_SWIFT() {}
- ~RGWHandler_REST_Obj_SWIFT() override {}
+ using RGWHandler_REST_SWIFT::RGWHandler_REST_SWIFT;
+ ~RGWHandler_REST_Obj_SWIFT() override = default;
int error_handler(int err_no, std::string *error_content) override {
return website_handler->error_handler(err_no, error_content);
};
class RGWRESTMgr_SWIFT : public RGWRESTMgr {
+ const rgw::auth::Strategy& auth_strategy;
+
protected:
RGWRESTMgr* get_resource_mgr_as_default(struct req_state* const s,
const std::string& uri,
}
public:
- RGWRESTMgr_SWIFT() = default;
+ RGWRESTMgr_SWIFT(const rgw::auth::Strategy* const auth_strategy)
+ : auth_strategy(*auth_strategy) {
+ }
~RGWRESTMgr_SWIFT() override = default;
RGWHandler_REST *get_handler(struct req_state *s,
class RGWHandler_REST_SWIFT_Info : public RGWHandler_REST_SWIFT {
public:
- RGWHandler_REST_SWIFT_Info() = default;
+ //using RGWHandler_REST_SWIFT::RGWHandler_REST_SWIFT;
+ RGWHandler_REST_SWIFT_Info(const rgw::auth::Strategy& auth_strategy)
+ : RGWHandler_REST_SWIFT(auth_strategy) {
+ }
~RGWHandler_REST_SWIFT_Info() override = default;
RGWOp *op_get() override {
};
class RGWRESTMgr_SWIFT_Info : public RGWRESTMgr {
+ const rgw::auth::Strategy& auth_strategy;
+
public:
- RGWRESTMgr_SWIFT_Info() = default;
+ RGWRESTMgr_SWIFT_Info(const rgw::auth::Strategy* const auth_strategy)
+ : auth_strategy(*auth_strategy) {
+ }
~RGWRESTMgr_SWIFT_Info() override = default;
RGWHandler_REST *get_handler(struct req_state* s,