]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw: implement the dynamic reconfiguration of auth strategies.
authorRadoslaw Zarzynski <rzarzynski@mirantis.com>
Mon, 20 Mar 2017 03:35:42 +0000 (04:35 +0100)
committerRadoslaw Zarzynski <rzarzynski@mirantis.com>
Fri, 24 Mar 2017 21:45:28 +0000 (22:45 +0100)
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
30 files changed:
src/rgw/rgw_asio_frontend.cc
src/rgw/rgw_asio_frontend.h
src/rgw/rgw_auth.h
src/rgw/rgw_auth_registry.h [new file with mode: 0644]
src/rgw/rgw_civetweb_frontend.cc
src/rgw/rgw_fcgi_process.cc
src/rgw/rgw_frontend.h
src/rgw/rgw_loadgen_process.cc
src/rgw/rgw_main.cc
src/rgw/rgw_op.h
src/rgw/rgw_process.cc
src/rgw/rgw_process.h
src/rgw/rgw_rest.cc
src/rgw/rgw_rest.h
src/rgw/rgw_rest_bucket.h
src/rgw/rgw_rest_config.h
src/rgw/rgw_rest_log.h
src/rgw/rgw_rest_metadata.h
src/rgw/rgw_rest_opstate.h
src/rgw/rgw_rest_realm.cc
src/rgw/rgw_rest_realm.h
src/rgw/rgw_rest_replica_log.h
src/rgw/rgw_rest_s3.cc
src/rgw/rgw_rest_s3.h
src/rgw/rgw_rest_s3website.h
src/rgw/rgw_rest_swift.cc
src/rgw/rgw_rest_swift.h
src/rgw/rgw_rest_usage.h
src/rgw/rgw_rest_user.h
src/rgw/rgw_swift_auth.h

index b785e7b07b7a59669ee0e210f90c2c6b592b15d2..ff2d78067594b9c03c2f9fc30e0fb1b88afcf715 100644 (file)
@@ -99,8 +99,8 @@ class AsioConnection : public std::enable_shared_from_this<AsioConnection> {
                                 rgw::io::add_conlen_controlling(
                                   &real_client))));
     RGWRestfulIO client(&real_client_io);
-    process_request(env.store, env.rest, &req, env.uri_prefix, &client,
-                    env.olog);
+    process_request(env.store, env.rest, &req, env.uri_prefix,
+                    *env.auth_registry, &client, env.olog);
   }
 
   void write_bad_request() {
@@ -160,7 +160,7 @@ class AsioFrontend {
   void stop();
   void join();
   void pause();
-  void unpause(RGWRados *store);
+  void unpause(RGWRados* store, rgw_auth_registry_ptr_t);
 };
 
 int AsioFrontend::init()
@@ -253,9 +253,11 @@ void AsioFrontend::pause()
   ldout(ctx(), 4) << "frontend paused" << dendl;
 }
 
-void AsioFrontend::unpause(RGWRados *store)
+void AsioFrontend::unpause(RGWRados* const store,
+                           rgw_auth_registry_ptr_t auth_registry)
 {
   env.store = store;
+  env.auth_registry = std::move(auth_registry);
   ldout(ctx(), 4) << "frontend unpaused" << dendl;
   service.reset();
   acceptor.async_accept(peer_socket,
@@ -304,7 +306,9 @@ void RGWAsioFrontend::pause_for_new_config()
   impl->pause();
 }
 
-void RGWAsioFrontend::unpause_with_new_config(RGWRados *store)
-{
-  impl->unpause(store);
+void RGWAsioFrontend::unpause_with_new_config(
+  RGWRados* const store,
+  rgw_auth_registry_ptr_t auth_registry
+) {
+  impl->unpause(store, std::move(auth_registry));
 }
index 1ffda891c25e7f141c6b67c30dfdf959806994d3..4c32cada640cbccd95c71e19ad05a801bab3440b 100644 (file)
@@ -20,7 +20,8 @@ public:
   void join() override;
 
   void pause_for_new_config() override;
-  void unpause_with_new_config(RGWRados *store) override;
+  void unpause_with_new_config(RGWRados *store,
+                               rgw_auth_registry_ptr_t auth_registry) override;
 };
 
 #endif // RGW_ASIO_FRONTEND_H
index b7346f65f5b1e609cb2ee28d3f2814282562d741..8dcd2e7b0561ab9a227d6087bab9378831c53c0a 100644 (file)
@@ -279,7 +279,10 @@ public:
  * Engine. It is responsible for ordering its sub-engines and managing
  * fall-backs between them. Derivatee is supposed to encapsulate engine
  * instances and add them using the add_engine() method in the order it
- * wants to be tried during the call to authenticate(). */
+ * wants to be tried during the call to authenticate().
+ *
+ * Each new Strategy should be exposed to StrategyRegistry for handling
+ * the dynamic reconfiguration. */
 class Strategy : public Engine {
 public:
   /* Specifiers controlling what happens when an associated engine fails.
@@ -321,6 +324,13 @@ protected:
 };
 
 
+/* A class aggregating the knowledge about all Strategies in RadosGW. It is
+ * responsible for handling the dynamic reconfiguration on e.g. realm update.
+ * The definition is in rgw/rgw_auth_registry.h,
+ *
+ * Each new Strategy should be exposed to it. */
+class StrategyRegistry;
+
 /* rgw::auth::RemoteApplier targets those authentication engines which don't
  * need to ask the RADOS store while performing the auth process. Instead,
  * they obtain credentials from an external source like Keystone or LDAP.
diff --git a/src/rgw/rgw_auth_registry.h b/src/rgw/rgw_auth_registry.h
new file mode 100644 (file)
index 0000000..18add9a
--- /dev/null
@@ -0,0 +1,71 @@
+// -*- mode:C++; tab-width:8; c-basic-offset:2; indent-tabs-mode:t -*-
+// vim: ts=8 sw=2 smarttab
+
+
+#ifndef CEPH_RGW_AUTH_REGISTRY_H
+#define CEPH_RGW_AUTH_REGISTRY_H
+
+#include <functional>
+#include <memory>
+#include <ostream>
+#include <type_traits>
+#include <utility>
+
+#include "rgw_auth.h"
+#include "rgw_auth_s3.h"
+#include "rgw_swift_auth.h"
+
+namespace rgw {
+namespace auth {
+
+/* A class aggregating the knowledge about all Strategies in RadosGW. It is
+ * responsible for handling the dynamic reconfiguration on e.g. realm update. */
+class StrategyRegistry {
+  template <class ExtractorT>
+  using s3_strategy_t = rgw::auth::s3::AWSv2AuthStrategy<ExtractorT>;
+
+  using s3_main_strategy_t = \
+    s3_strategy_t<rgw::auth::s3::RGWS3V2Extractor>;
+  using s3_post_strategy_t = \
+    s3_strategy_t<rgw::auth::s3::RGWGetPolicyV2Extractor>;
+
+  s3_main_strategy_t s3_main_strategy;
+  s3_post_strategy_t s3_post_strategy;
+
+  rgw::auth::swift::DefaultStrategy swift_strategy;
+
+public:
+  StrategyRegistry(CephContext* const cct,
+                   RGWRados* const store)
+    : s3_main_strategy(cct, store),
+      s3_post_strategy(cct, store),
+      swift_strategy(cct, store) {
+  }
+
+public:
+  const s3_main_strategy_t& get_s3_main() const {
+    return s3_main_strategy;
+  }
+
+  const s3_post_strategy_t& get_s3_post() const {
+    return s3_post_strategy;
+  }
+
+  const rgw::auth::swift::DefaultStrategy& get_swift() const {
+    return swift_strategy;
+  }
+
+  static std::shared_ptr<StrategyRegistry>
+  create(CephContext* const cct,
+         RGWRados* const store) {
+    return std::make_shared<StrategyRegistry>(cct, store);
+  }
+};
+
+} /* namespace auth */
+} /* namespace rgw */
+
+using rgw_auth_registry_t = rgw::auth::StrategyRegistry;
+using rgw_auth_registry_ptr_t = std::shared_ptr<rgw_auth_registry_t>;
+
+#endif /* CEPH_RGW_AUTH_REGISTRY_H */
index 977883dc74d273dc2ee59c6a64e10fc09c29e261..c564d0e492038448bd86947b8346755d1352e87b 100644 (file)
@@ -32,7 +32,7 @@ int RGWCivetWebFrontend::process(struct mg_connection*  const conn)
 
   RGWRequest req(env.store->get_new_req_id());
   int ret = process_request(env.store, env.rest, &req, env.uri_prefix,
-                            &client_io, env.olog);
+                            *env.auth_registry, &client_io, env.olog);
   if (ret < 0) {
     /* We don't really care about return code. */
     dout(20) << "process_request() returned " << ret << dendl;
index fb918b646c21d87fa86b9320427d4ae275f08776..332cde29719f3517268e0b887611ecd7f5c98d98 100644 (file)
@@ -124,7 +124,8 @@ void RGWFCGXProcess::handle_request(RGWRequest* r)
   RGWRestfulIO client_io(&real_client_io);
 
  
-  int ret = process_request(store, rest, req, uri_prefix, &client_io, olog);
+  int ret = process_request(store, rest, req, uri_prefix,
+                            *auth_registry, &client_io, olog);
   if (ret < 0) {
     /* we don't really care about return code */
     dout(20) << "process_request() returned " << ret << dendl;
index c496d4fe1bdd74160c129fa83e6e93947a25fb7d..1c999b4d68fe4cfa77faef800d0ffd6785468e06 100644 (file)
@@ -15,6 +15,8 @@
 #include "rgw_civetweb_log.h"
 #include "civetweb/civetweb.h"
 
+#include "rgw_auth_registry.h"
+
 #define dout_context g_ceph_context
 #define dout_subsys ceph_subsys_rgw
 
@@ -68,7 +70,8 @@ public:
   virtual void join() = 0;
 
   virtual void pause_for_new_config() = 0;
-  virtual void unpause_with_new_config(RGWRados* store) = 0;
+  virtual void unpause_with_new_config(RGWRados* store,
+                                       rgw_auth_registry_ptr_t auth_registry) = 0;
 };
 
 
@@ -129,8 +132,10 @@ public:
     env.mutex.get_write();
   }
 
-  void unpause_with_new_config(RGWRados *store) override {
+  void unpause_with_new_config(RGWRados* const store,
+                               rgw_auth_registry_ptr_t auth_registry) override {
     env.store = store;
+    env.auth_registry = std::move(auth_registry);
     // unpause callbacks
     env.mutex.put_write();
   }
@@ -170,9 +175,11 @@ public:
     pprocess->pause();
   }
 
-  void unpause_with_new_config(RGWRados *store) override {
+  void unpause_with_new_config(RGWRados* const store,
+                               rgw_auth_registry_ptr_t auth_registry) override {
     env.store = store;
-    pprocess->unpause_with_new_config(store);
+    env.auth_registry = auth_registry;
+    pprocess->unpause_with_new_config(store, std::move(auth_registry));
   }
 }; /* RGWProcessFrontend */
 
@@ -235,6 +242,7 @@ public:
 class RGWFrontendPauser : public RGWRealmReloader::Pauser {
   std::list<RGWFrontend*> &frontends;
   RGWRealmReloader::Pauser* pauser;
+
  public:
   RGWFrontendPauser(std::list<RGWFrontend*> &frontends,
                     RGWRealmReloader::Pauser* pauser = nullptr)
@@ -247,8 +255,13 @@ class RGWFrontendPauser : public RGWRealmReloader::Pauser {
       pauser->pause();
   }
   void resume(RGWRados *store) override {
+    /* Initialize the registry of auth strategies which will coordinate
+     * the dynamic reconfiguration. */
+    auto auth_registry = \
+      rgw::auth::StrategyRegistry::create(g_ceph_context, store);
+
     for (auto frontend : frontends)
-      frontend->unpause_with_new_config(store);
+      frontend->unpause_with_new_config(store, auth_registry);
     if (pauser)
       pauser->resume(store);
   }
index d74688309b6f425c0b6b77b9e242929aec2b1530..7f003facbb7043d4eb411307995d6b44f5266845 100644 (file)
@@ -131,7 +131,8 @@ void RGWLoadGenProcess::handle_request(RGWRequest* r)
   RGWLoadGenIO real_client_io(&env);
   RGWRestfulIO client_io(&real_client_io);
 
-  int ret = process_request(store, rest, req, uri_prefix, &client_io, olog);
+  int ret = process_request(store, rest, req, uri_prefix,
+                            *auth_registry, &client_io, olog);
   if (ret < 0) {
     /* we don't really care about return code */
     dout(20) << "process_request() returned " << ret << dendl;
index 733d4567003763b5707e5905a54ad2d84b94be02..1bec56553a656a9fd73b3b3ef7e7c74762460d29 100644 (file)
@@ -385,11 +385,7 @@ int main(int argc, const char **argv)
   }
 
   if (apis_map.count("swift") > 0) {
-    static const rgw::auth::swift::DefaultStrategy auth_strategy(g_ceph_context,
-                                                                 store);
-
-    RGWRESTMgr_SWIFT* const swift_resource = new RGWRESTMgr_SWIFT(
-      &auth_strategy);
+    RGWRESTMgr_SWIFT* const swift_resource = new RGWRESTMgr_SWIFT;
 
     if (! g_conf->rgw_cross_domain_policy.empty()) {
       swift_resource->register_resource("crossdomain.xml",
@@ -400,7 +396,7 @@ int main(int argc, const char **argv)
                           set_logging(new RGWRESTMgr_SWIFT_HealthCheck));
 
     swift_resource->register_resource("info",
-                          set_logging(new RGWRESTMgr_SWIFT_Info(&auth_strategy)));
+                          set_logging(new RGWRESTMgr_SWIFT_Info));
 
     if (! swift_at_root) {
       rest.register_resource(g_conf->rgw_swift_url_prefix,
@@ -437,6 +433,11 @@ int main(int argc, const char **argv)
     rest.register_resource(g_conf->rgw_admin_entry, admin_resource);
   }
 
+  /* Initialize the registry of auth strategies which will coordinate
+   * the dynamic reconfiguration. */
+  auto auth_registry = \
+    rgw::auth::StrategyRegistry::create(g_ceph_context, store);
+
   /* Header custom behavior */
   rest.register_x_headers(g_conf->rgw_log_http_headers);
 
@@ -474,7 +475,7 @@ int main(int argc, const char **argv)
       std::string uri_prefix;
       config->get_val("prefix", "", &uri_prefix);
 
-      RGWProcessEnv env = { store, &rest, olog, 0, uri_prefix };
+      RGWProcessEnv env = { store, &rest, olog, 0, uri_prefix, auth_registry };
 
       fe = new RGWCivetWebFrontend(env, config);
     }
@@ -484,7 +485,7 @@ int main(int argc, const char **argv)
       std::string uri_prefix;
       config->get_val("prefix", "", &uri_prefix);
 
-      RGWProcessEnv env = { store, &rest, olog, port, uri_prefix };
+      RGWProcessEnv env = { store, &rest, olog, port, uri_prefix, auth_registry };
 
       fe = new RGWLoadGenFrontend(env, config);
     }
@@ -495,7 +496,7 @@ int main(int argc, const char **argv)
       config->get_val("port", 80, &port);
       std::string uri_prefix;
       config->get_val("prefix", "", &uri_prefix);
-      RGWProcessEnv env{ store, &rest, olog, port, uri_prefix };
+      RGWProcessEnv env{ store, &rest, olog, port, uri_prefix, auth_registry };
       fe = new RGWAsioFrontend(env);
     }
 #endif /* WITH_RADOSGW_ASIO_FRONTEND */
@@ -503,7 +504,7 @@ int main(int argc, const char **argv)
     else if (framework == "fastcgi" || framework == "fcgi") {
       std::string uri_prefix;
       config->get_val("prefix", "", &uri_prefix);
-      RGWProcessEnv fcgi_pe = { store, &rest, olog, 0, uri_prefix };
+      RGWProcessEnv fcgi_pe = { store, &rest, olog, 0, uri_prefix, auth_registry };
 
       fe = new RGWFCGXFrontend(fcgi_pe, config);
     }
index 4eff628b0926cc2ffc64bda627ad825246aa2e1a..318340f6a29756cd304235b049d5800cb4e1487d 100644 (file)
@@ -47,6 +47,18 @@ using ceph::crypto::SHA1;
 struct req_state;
 class RGWOp;
 
+
+namespace rgw {
+namespace auth {
+namespace registry {
+
+class StrategyRegistry;
+
+}
+}
+}
+
+
 class RGWHandler {
 protected:
   RGWRados* store;
@@ -140,7 +152,7 @@ public:
    * authentication. The alternative is to duplicate parts of the method-
    * dispatch logic in RGWHandler::authorize() and pollute it with a lot
    * of special cases. */
-  virtual int verify_requester() {
+  virtual int verify_requester(const rgw::auth::StrategyRegistry& auth_registry) {
     /* TODO(rzarzynski): rename RGWHandler::authorize to generic_authenticate. */
     return dialect_handler->authorize();
   }
index efe247ed47280f76d68ecfbc40557e2404962e78..6fbf2fdb594f005b5fdcb63a1457a96db1dc7327 100644 (file)
@@ -113,6 +113,7 @@ int process_request(RGWRados* const store,
                     RGWREST* const rest,
                     RGWRequest* const req,
                     const std::string& frontend_prefix,
+                    const rgw_auth_registry_t& auth_registry,
                     RGWRestfulIO* const client_io,
                     OpsLogSocket* const olog)
 {
@@ -146,7 +147,9 @@ int process_request(RGWRados* const store,
   int init_error = 0;
   bool should_log = false;
   RGWRESTMgr *mgr;
-  RGWHandler_REST *handler = rest->get_handler(store, s, frontend_prefix,
+  RGWHandler_REST *handler = rest->get_handler(store, s,
+                                               auth_registry,
+                                               frontend_prefix,
                                                client_io, &mgr, &init_error);
   if (init_error != 0) {
     abort_early(s, NULL, init_error, NULL);
@@ -169,7 +172,7 @@ int process_request(RGWRados* const store,
   s->op_type = op->get_type();
 
   req->log(s, "verifying requester");
-  ret = op->verify_requester();
+  ret = op->verify_requester(auth_registry);
   if (ret < 0) {
     dout(10) << "failed to authorize request" << dendl;
     abort_early(s, NULL, ret, handler);
index bd3c46261f6ae3bfc98ff4ad8a10fcb5243f2d71..83c59a4cc379887fc82af1af3eec492b5e57eb17 100644 (file)
@@ -7,6 +7,7 @@
 #include "rgw_common.h"
 #include "rgw_rados.h"
 #include "rgw_acl.h"
+#include "rgw_auth_registry.h"
 #include "rgw_user.h"
 #include "rgw_op.h"
 #include "rgw_rest.h"
@@ -31,6 +32,7 @@ struct RGWProcessEnv {
   OpsLogSocket *olog;
   int port;
   std::string uri_prefix;
+  std::shared_ptr<rgw::auth::StrategyRegistry> auth_registry;
 };
 
 class RGWFrontendConfig;
@@ -40,6 +42,7 @@ class RGWProcess {
 protected:
   CephContext *cct;
   RGWRados* store;
+  rgw_auth_registry_ptr_t auth_registry;
   OpsLogSocket* olog;
   ThreadPool m_tp;
   Throttle req_throttle;
@@ -104,6 +107,7 @@ public:
              RGWFrontendConfig* const conf)
     : cct(cct),
       store(pe->store),
+      auth_registry(pe->auth_registry),
       olog(pe->olog),
       m_tp(cct, "RGWProcess::m_tp", "tp_rgw_process", num_threads),
       req_throttle(cct, "rgw_ops", num_threads * 2),
@@ -124,8 +128,10 @@ public:
     m_tp.pause();
   }
 
-  void unpause_with_new_config(RGWRados *store) {
+  void unpause_with_new_config(RGWRados* const store,
+                               rgw_auth_registry_ptr_t auth_registry) {
     this->store = store;
+    this->auth_registry = std::move(auth_registry);
     m_tp.unpause();
   }
 
@@ -186,6 +192,7 @@ extern int process_request(RGWRados* store,
                            RGWREST* rest,
                            RGWRequest* req,
                            const std::string& frontend_prefix,
+                           const rgw_auth_registry_t& auth_registry,
                            RGWRestfulIO* client_io,
                            OpsLogSocket* olog);
 
index c3c44fa4d04bf854238c9b43174b319067541c16..0a5fac47aa75909c783cba6ab597ca812cc5188f 100644 (file)
@@ -2077,13 +2077,15 @@ int RGWREST::preprocess(struct req_state *s, rgw::io::BasicClient* cio)
   return 0;
 }
 
-RGWHandler_REST* RGWREST::get_handler(RGWRados * const store,
-                                      struct req_state* const s,
-                                      const std::string& frontend_prefix,
-                                      RGWRestfulIO* const rio,
-                                      RGWRESTMgr** const pmgr,
-                                      int* const init_error)
-{
+RGWHandler_REST* RGWREST::get_handler(
+  RGWRados * const store,
+  struct req_state* const s,
+  const rgw::auth::StrategyRegistry& auth_registry,
+  const std::string& frontend_prefix,
+  RGWRestfulIO* const rio,
+  RGWRESTMgr** const pmgr,
+  int* const init_error
+) {
   *init_error = preprocess(s, rio);
   if (*init_error < 0) {
     return nullptr;
@@ -2100,7 +2102,7 @@ RGWHandler_REST* RGWREST::get_handler(RGWRados * const store,
     *pmgr = m;
   }
 
-  RGWHandler_REST* handler = m->get_handler(s, frontend_prefix);
+  RGWHandler_REST* handler = m->get_handler(s, auth_registry, frontend_prefix);
   if (! handler) {
     *init_error = -ERR_METHOD_NOT_ALLOWED;
     return NULL;
index 6e0a87ea4cbf0c673450289a83e190d67c53bada..1d530d05ee435d06aa4cf57f790918d286539889 100644 (file)
@@ -438,6 +438,13 @@ class RGWHandler_REST_SWIFT;
 class RGWHandler_SWIFT_Auth;
 class RGWHandler_REST_S3;
 
+namespace rgw {
+namespace auth {
+
+class StrategyRegistry;
+
+}
+}
 
 class RGWRESTMgr {
   bool should_log;
@@ -476,8 +483,11 @@ public:
     return get_resource_mgr(s, frontend_prefix + uri, out_uri);
   }
 
-  virtual RGWHandler_REST* get_handler(struct req_state* const s,
-                                       const std::string& frontend_prefix) {
+  virtual RGWHandler_REST* get_handler(
+    struct req_state* const s,
+    const rgw::auth::StrategyRegistry& auth_registry,
+    const std::string& frontend_prefix
+  ) {
     return nullptr;
   }
 
@@ -507,6 +517,7 @@ public:
   RGWREST() {}
   RGWHandler_REST *get_handler(RGWRados *store,
                                struct req_state *s,
+                               const rgw::auth::StrategyRegistry& auth_registry,
                                const std::string& frontend_prefix,
                                RGWRestfulIO *rio,
                                RGWRESTMgr **pmgr,
index 108151500ba231b6f0f4d7b7176eabc0382b72da..19bfd7347f8fc1d9f4fad92ed8444a40c7e61764 100644 (file)
@@ -15,8 +15,8 @@ protected:
   RGWOp *op_post() override;
   RGWOp *op_delete() override;
 public:
-  RGWHandler_Bucket() {}
-  ~RGWHandler_Bucket() override {}
+  using RGWHandler_Auth_S3::RGWHandler_Auth_S3;
+  ~RGWHandler_Bucket() override = default;
 
   int read_permissions(RGWOp*) override {
     return 0;
@@ -29,8 +29,9 @@ public:
   ~RGWRESTMgr_Bucket() override = default;
 
   RGWHandler_REST* get_handler(struct req_state*,
+                               const rgw::auth::StrategyRegistry& auth_registry,
                                const std::string&) override {
-    return new RGWHandler_Bucket;
+    return new RGWHandler_Bucket(auth_registry);
   }
 };
 
index a324334a995eb13961896950ee79c34dae7070f3..5751f8b0687fe4d5567928584d6a484766f99b52 100644 (file)
@@ -62,8 +62,8 @@ protected:
     return 0;
   }
 public:
-  RGWHandler_Config() : RGWHandler_Auth_S3() {}
-  ~RGWHandler_Config() override {}
+  using RGWHandler_Auth_S3::RGWHandler_Auth_S3;
+  ~RGWHandler_Config() override = default;
 };
 
 
@@ -73,8 +73,9 @@ public:
   ~RGWRESTMgr_Config() override = default;
 
   RGWHandler_REST* get_handler(struct req_state*,
+                               const rgw::auth::StrategyRegistry& auth_registry,
                                const std::string&) override {
-    return new RGWHandler_Config;
+    return new RGWHandler_Config(auth_registry);
   }
 };
 
index 8c6cf5251d147b42c0e1da48c2f538330e20442d..6fdce665231212d02ab951d85d2143e82c067d29 100644 (file)
@@ -315,8 +315,8 @@ protected:
     return 0;
   }
 public:
-  RGWHandler_Log() : RGWHandler_Auth_S3() {}
-  ~RGWHandler_Log() override {}
+  using RGWHandler_Auth_S3::RGWHandler_Auth_S3;
+  ~RGWHandler_Log() override = default;
 };
 
 class RGWRESTMgr_Log : public RGWRESTMgr {
@@ -325,8 +325,9 @@ public:
   ~RGWRESTMgr_Log() override = default;
 
   RGWHandler_REST* get_handler(struct req_state* const,
+                               const rgw::auth::StrategyRegistry& auth_registry,
                                const std::string& frontend_prefixs) override {
-    return new RGWHandler_Log;
+    return new RGWHandler_Log(auth_registry);
   }
 };
 
index ccd4b903637f11705d8249d0590d30cb27ad65c6..bf29f0aab26396007a664296c8da98b60c361076 100644 (file)
@@ -107,8 +107,8 @@ protected:
     return 0;
   }
 public:
-  RGWHandler_Metadata() : RGWHandler_Auth_S3() {}
-  ~RGWHandler_Metadata() override {}
+  using RGWHandler_Auth_S3::RGWHandler_Auth_S3;
+  ~RGWHandler_Metadata() override = default;
 };
 
 class RGWRESTMgr_Metadata : public RGWRESTMgr {
@@ -117,8 +117,9 @@ public:
   ~RGWRESTMgr_Metadata() override = default;
 
   RGWHandler_REST* get_handler(struct req_state* const s,
+                               const rgw::auth::StrategyRegistry& auth_registry,
                                const std::string& frontend_prefix) override {
-    return new RGWHandler_Metadata;
+    return new RGWHandler_Metadata(auth_registry);
   }
 };
 
index 8439f5ebbd21f085c47fec42d59b191752f25b45..82873e6bc6e7cd6d1e7c91bcb6e70b0a43764275 100644 (file)
@@ -92,8 +92,8 @@ protected:
     return 0;
   }
 public:
-  RGWHandler_Opstate() : RGWHandler_Auth_S3() {}
-  ~RGWHandler_Opstate() override {}
+  using RGWHandler_Auth_S3::RGWHandler_Auth_S3;
+  ~RGWHandler_Opstate() override = default;
 };
 
 class RGWRESTMgr_Opstate : public RGWRESTMgr {
@@ -102,8 +102,9 @@ public:
   ~RGWRESTMgr_Opstate() override = default;
 
   RGWHandler_REST* get_handler(struct req_state*,
+                               const rgw::auth::StrategyRegistry& auth_registry,
                                const std::string&) override {
-    return new RGWHandler_Opstate;
+    return new RGWHandler_Opstate(auth_registry);
   }
 };
 
index b4cde344c8ed212cf8bc2fefd0d799c20e0e3be9..406f3d40a993ba3f899067d54220d1cb8f1c9c43 100644 (file)
@@ -222,6 +222,8 @@ void RGWOp_Period_Post::execute()
 
 class RGWHandler_Period : public RGWHandler_Auth_S3 {
  protected:
+  using RGWHandler_Auth_S3::RGWHandler_Auth_S3;
+
   RGWOp *op_get() override { return new RGWOp_Period_Get; }
   RGWOp *op_post() override { return new RGWOp_Period_Post; }
 };
@@ -229,8 +231,9 @@ class RGWHandler_Period : public RGWHandler_Auth_S3 {
 class RGWRESTMgr_Period : public RGWRESTMgr {
  public:
   RGWHandler_REST* get_handler(struct req_state*,
+                               const rgw::auth::StrategyRegistry& auth_registry,
                                const std::string&) override {
-    return new RGWHandler_Period;
+    return new RGWHandler_Period(auth_registry);
   }
 };
 
@@ -277,6 +280,7 @@ void RGWOp_Realm_Get::send_response()
 
 class RGWHandler_Realm : public RGWHandler_Auth_S3 {
 protected:
+  using RGWHandler_Auth_S3::RGWHandler_Auth_S3;
   RGWOp *op_get() override { return new RGWOp_Realm_Get; }
 };
 
@@ -286,8 +290,10 @@ RGWRESTMgr_Realm::RGWRESTMgr_Realm()
   register_resource("period", new RGWRESTMgr_Period);
 }
 
-RGWHandler_REST* RGWRESTMgr_Realm::get_handler(struct req_state*,
-                                               const std::string&)
+RGWHandler_REST*
+RGWRESTMgr_Realm::get_handler(struct req_state*,
+                              const rgw::auth::StrategyRegistry& auth_registry,
+                              const std::string&)
 {
-  return new RGWHandler_Realm;
+  return new RGWHandler_Realm(auth_registry);
 }
index 6d554949556d3bcb52da21da0563ec937f8cd0eb..68566bcbfd13b6667e226b234e01798732893c8f 100644 (file)
@@ -11,6 +11,7 @@ public:
   RGWRESTMgr_Realm();
 
   RGWHandler_REST* get_handler(struct req_state*,
+                               const rgw::auth::StrategyRegistry& auth_registry,
                                const std::string&) override;
 };
 
index aad920c4fd9c4181bdccee4a606ef4076190b5bd..a6cb7ec0a3b7dfb31e324ed0d79c61236e1ae4bd 100644 (file)
@@ -138,8 +138,8 @@ protected:
     return 0;
   }
 public:
-  RGWHandler_ReplicaLog() : RGWHandler_Auth_S3() {}
-  ~RGWHandler_ReplicaLog() override {}
+  using RGWHandler_Auth_S3::RGWHandler_Auth_S3;
+  ~RGWHandler_ReplicaLog() override = default;
 };
 
 class RGWRESTMgr_ReplicaLog : public RGWRESTMgr {
@@ -148,8 +148,9 @@ public:
   ~RGWRESTMgr_ReplicaLog() override = default;
 
   RGWHandler_REST* get_handler(struct req_state*,
+                               const rgw::auth::StrategyRegistry& auth_registry,
                                const std::string&) override {
-    return new RGWHandler_ReplicaLog;
+    return new RGWHandler_ReplicaLog(auth_registry);
   }
 };
 
index 5d18249e2f867b216def429dbc0a4923dc4904bf..3223e6464167f631f827b07d3cf42907d7ca7379 100644 (file)
@@ -27,6 +27,7 @@
 
 #include "rgw_keystone.h"
 #include "rgw_auth_keystone.h"
+#include "rgw_auth_registry.h"
 
 #include <typeinfo> // for 'typeid'
 
@@ -1818,8 +1819,7 @@ int RGWPostObj_ObjStore_S3::get_policy()
     /* FIXME: this is a makeshift solution. The browser upload authentication will be
      * handled by an instance of rgw::auth::Completer spawned in Handler's authorize()
      * method. */
-    static const rgw::auth::s3::AWSv2AuthStrategy<
-                   rgw::auth::s3::RGWGetPolicyV2Extractor> strategy(g_ceph_context, store);
+    const auto& strategy = auth_registry_ptr->get_s3_post();
     try {
       auto result = strategy.authenticate(s);
       if (result.get_status() != decltype(result)::Status::GRANTED) {
@@ -3220,7 +3220,9 @@ static void init_anon_user(struct req_state *s)
  *
  * it tries AWS v4 before AWS v2
  */
-int RGW_Auth_S3::authorize(RGWRados *store, struct req_state *s)
+int RGW_Auth_S3::authorize(RGWRados* const store,
+                           const rgw::auth::StrategyRegistry& auth_registry,
+                           struct req_state* const s)
 {
 
   /* neither keystone and rados enabled; warn and exit! */
@@ -3259,7 +3261,7 @@ int RGW_Auth_S3::authorize(RGWRados *store, struct req_state *s)
 
     string auth_id = s->info.args.get("AWSAccessKeyId");
     if (auth_id.size()) {
-      return authorize_v2(store, s);
+      return authorize_v2(store, auth_registry, s);
     }
 
     /* anonymous access */
@@ -3279,7 +3281,7 @@ int RGW_Auth_S3::authorize(RGWRados *store, struct req_state *s)
     /* AWS2 */
 
     if (!strncmp(s->http_auth, "AWS ", 4)) {
-      return authorize_v2(store, s);
+      return authorize_v2(store, auth_registry, s);
     }
 
   }
@@ -3881,13 +3883,13 @@ int RGW_Auth_S3::authorize_v4(RGWRados *store, struct req_state *s, bool force_b
 /*
  * handle v2 signatures
  */
-int RGW_Auth_S3::authorize_v2(RGWRados *store, struct req_state *s)
+int RGW_Auth_S3::authorize_v2(RGWRados* const store,
+                              const rgw::auth::StrategyRegistry& auth_registry,
+                              struct req_state* const s)
 {
-  /* TODO(rzarzynski): this will be moved to the S3 handlers -- in exactly
-   * way like we currently have in the case of Swift API. */
-  static const rgw::auth::s3::AWSv2AuthStrategy<rgw::auth::s3::RGWS3V2Extractor> strategy(g_ceph_context, store);
+  const auto& auth_strategy = auth_registry.get_s3_main();
   try {
-    auto result = strategy.authenticate(s);
+    auto result = auth_strategy.authenticate(s);
     if (result.get_status() != decltype(result)::Status::GRANTED) {
       ldout(s->cct, 5) << "Failed the S3 auth strategy, reason="
                        << result.get_reason() << dendl;
@@ -3931,6 +3933,7 @@ int RGWHandler_Auth_S3::init(RGWRados *store, struct req_state *state,
 }
 
 RGWHandler_REST* RGWRESTMgr_S3::get_handler(struct req_state* const s,
+                                            const rgw::auth::StrategyRegistry& auth_registry,
                                             const std::string& frontend_prefix)
 {
   bool is_s3website = enable_s3website && (s->prot_flags & RGW_REST_WEBSITE);
@@ -3945,19 +3948,19 @@ RGWHandler_REST* RGWRESTMgr_S3::get_handler(struct req_state* const s,
   // TODO: Make this more readable
   if (is_s3website) {
     if (s->init_state.url_bucket.empty()) {
-      handler = new RGWHandler_REST_Service_S3Website;
+      handler = new RGWHandler_REST_Service_S3Website(auth_registry);
     } else if (s->object.empty()) {
-      handler = new RGWHandler_REST_Bucket_S3Website;
+      handler = new RGWHandler_REST_Bucket_S3Website(auth_registry);
     } else {
-      handler = new RGWHandler_REST_Obj_S3Website;
+      handler = new RGWHandler_REST_Obj_S3Website(auth_registry);
     }
   } else {
     if (s->init_state.url_bucket.empty()) {
-      handler = new RGWHandler_REST_Service_S3;
+      handler = new RGWHandler_REST_Service_S3(auth_registry);
     } else if (s->object.empty()) {
-      handler = new RGWHandler_REST_Bucket_S3;
+      handler = new RGWHandler_REST_Bucket_S3(auth_registry);
     } else {
-      handler = new RGWHandler_REST_Obj_S3;
+      handler = new RGWHandler_REST_Obj_S3(auth_registry);
     }
   }
 
index 863195b35b192c247e70b475ef400c0518413210..94048ba3a52450e9874e2183fb9d8a75e1070a34 100644 (file)
@@ -200,6 +200,8 @@ class RGWPostObj_ObjStore_S3 : public RGWPostObj_ObjStore {
   RGWPolicy post_policy;
   string err_msg;
 
+  const rgw::auth::StrategyRegistry* auth_registry_ptr = nullptr;
+
   int read_with_boundary(bufferlist& bl, uint64_t max, bool check_eol,
                          bool *reached_boundary,
                         bool *done);
@@ -220,6 +222,11 @@ public:
   RGWPostObj_ObjStore_S3() {}
   ~RGWPostObj_ObjStore_S3() override {}
 
+  int verify_requester(const rgw::auth::StrategyRegistry& auth_registry) {
+    auth_registry_ptr = &auth_registry;
+    return RGWPostObj_ObjStore::verify_requester(auth_registry);
+  }
+
   int get_params() override;
   int complete_get_params();
   void send_response() override;
@@ -410,21 +417,31 @@ public:
 
 class RGW_Auth_S3 {
 private:
-  static int authorize_v2(RGWRados *store, struct req_state *s);
+  static int authorize_v2(RGWRados *store,
+                          const rgw::auth::StrategyRegistry& auth_registry,
+                          struct req_state *s);
   static int authorize_v4(RGWRados *store, struct req_state *s, bool force_boto2_compat = true);
   static int authorize_v4_complete(RGWRados *store, struct req_state *s,
                                  const string& request_payload,
                                  bool unsigned_payload);
 public:
-  static int authorize(RGWRados *store, struct req_state *s);
+  static int authorize(RGWRados *store,
+                       const rgw::auth::StrategyRegistry& auth_registry,
+                       struct req_state *s);
   static int authorize_aws4_auth_complete(RGWRados *store, struct req_state *s);
 };
 
 class RGWHandler_Auth_S3 : public RGWHandler_REST {
   friend class RGWRESTMgr_S3;
+
+  const rgw::auth::StrategyRegistry& auth_registry;
+
 public:
-  RGWHandler_Auth_S3() : RGWHandler_REST() {}
-  ~RGWHandler_Auth_S3() override {}
+  RGWHandler_Auth_S3(const rgw::auth::StrategyRegistry& auth_registry)
+    : RGWHandler_REST(),
+      auth_registry(auth_registry) {
+  }
+  ~RGWHandler_Auth_S3() override = default;
 
   static int validate_bucket_name(const string& bucket);
   static int validate_object_name(const string& bucket);
@@ -433,24 +450,29 @@ public:
            struct req_state *s,
            rgw::io::BasicClient *cio) override;
   int authorize() override {
-    return RGW_Auth_S3::authorize(store, s);
+    return RGW_Auth_S3::authorize(store, auth_registry, s);
   }
   int postauth_init() override { return 0; }
 };
 
 class RGWHandler_REST_S3 : public RGWHandler_REST {
   friend class RGWRESTMgr_S3;
+
+  const rgw::auth::StrategyRegistry& auth_registry;
 public:
   static int init_from_header(struct req_state *s, int default_formatter, bool configurable_format);
 
-  RGWHandler_REST_S3() : RGWHandler_REST() {}
-  ~RGWHandler_REST_S3() override {}
+  RGWHandler_REST_S3(const rgw::auth::StrategyRegistry& auth_registry)
+    : RGWHandler_REST(),
+      auth_registry(auth_registry) {
+  }
+  ~RGWHandler_REST_S3() override = default;
 
   int init(RGWRados *store,
            struct req_state *s,
            rgw::io::BasicClient *cio) override;
   int authorize() override {
-    return RGW_Auth_S3::authorize(store, s);
+    return RGW_Auth_S3::authorize(store, auth_registry, s);
   }
   int postauth_init() override;
 };
@@ -464,8 +486,8 @@ protected:
   RGWOp *op_head() override;
   RGWOp *op_post() override;
 public:
-  RGWHandler_REST_Service_S3() {}
-  ~RGWHandler_REST_Service_S3() override {}
+  using RGWHandler_REST_S3::RGWHandler_REST_S3;
+  ~RGWHandler_REST_Service_S3() override = default;
 };
 
 class RGWHandler_REST_Bucket_S3 : public RGWHandler_REST_S3 {
@@ -494,8 +516,8 @@ protected:
   RGWOp *op_post() override;
   RGWOp *op_options() override;
 public:
-  RGWHandler_REST_Bucket_S3() {}
-  ~RGWHandler_REST_Bucket_S3() override {}
+  using RGWHandler_REST_S3::RGWHandler_REST_S3;
+  ~RGWHandler_REST_Bucket_S3() override = default;
 };
 
 class RGWHandler_REST_Obj_S3 : public RGWHandler_REST_S3 {
@@ -518,8 +540,8 @@ protected:
   RGWOp *op_post() override;
   RGWOp *op_options() override;
 public:
-  RGWHandler_REST_Obj_S3() {}
-  ~RGWHandler_REST_Obj_S3() override {}
+  using RGWHandler_REST_S3::RGWHandler_REST_S3;
+  ~RGWHandler_REST_Obj_S3() override = default;
 };
 
 class RGWRESTMgr_S3 : public RGWRESTMgr {
@@ -533,6 +555,7 @@ public:
   ~RGWRESTMgr_S3() override = default;
 
   RGWHandler_REST *get_handler(struct req_state* s,
+                               const rgw::auth::StrategyRegistry& auth_registry,
                                const std::string& frontend_prefix) override;
 };
 
index c248b9f296317bac733d34c599c505d2aea42e78..3a87c5eefd9e652a56145c180c53b1a539cc059c 100644 (file)
@@ -34,8 +34,8 @@ protected:
 
   int serve_errordoc(int http_ret, const string &errordoc_key);
 public:
-  RGWHandler_REST_S3Website() : RGWHandler_REST_S3() {}
-  ~RGWHandler_REST_S3Website() override {}
+  using RGWHandler_REST_S3::RGWHandler_REST_S3;
+  ~RGWHandler_REST_S3Website() override = default;
   int error_handler(int err_no, string *error_content) override;
 };
 
@@ -43,16 +43,16 @@ class RGWHandler_REST_Service_S3Website : public RGWHandler_REST_S3Website {
 protected:
   RGWOp *get_obj_op(bool get_data) override;
 public:
-  RGWHandler_REST_Service_S3Website() {}
-  ~RGWHandler_REST_Service_S3Website() override {}
+  using RGWHandler_REST_S3Website::RGWHandler_REST_S3Website;
+  ~RGWHandler_REST_Service_S3Website() override = default;
 };
 
 class RGWHandler_REST_Obj_S3Website : public RGWHandler_REST_S3Website {
 protected:
   RGWOp *get_obj_op(bool get_data) override;
 public:
-  RGWHandler_REST_Obj_S3Website() {}
-  ~RGWHandler_REST_Obj_S3Website() override {}
+  using RGWHandler_REST_S3Website::RGWHandler_REST_S3Website;
+  ~RGWHandler_REST_Obj_S3Website() override = default;
 };
 
 /* The cross-inheritance from Obj to Bucket is deliberate!
@@ -62,8 +62,8 @@ class RGWHandler_REST_Bucket_S3Website : public RGWHandler_REST_S3Website {
 protected:
   RGWOp *get_obj_op(bool get_data) override;
 public:
-  RGWHandler_REST_Bucket_S3Website() {}
-  ~RGWHandler_REST_Bucket_S3Website() override {}
+  using RGWHandler_REST_S3Website::RGWHandler_REST_S3Website;
+  ~RGWHandler_REST_Bucket_S3Website() override = default;
 };
 
 // TODO: do we actually need this?
index 9f06fa461877c54811fb8ead73a715f8081f00b3..40c940b47bfb560903a2696632652ef82d208631 100644 (file)
@@ -2329,8 +2329,10 @@ int RGWHandler_REST_SWIFT::init(RGWRados* store, struct req_state* s,
   return RGWHandler_REST::init(store, s, cio);
 }
 
-RGWHandler_REST* RGWRESTMgr_SWIFT::get_handler(struct req_state* const s,
-                                               const std::string& frontend_prefix)
+RGWHandler_REST*
+RGWRESTMgr_SWIFT::get_handler(struct req_state* const s,
+                              const rgw::auth::StrategyRegistry& auth_registry,
+                              const std::string& frontend_prefix)
 {
   int ret = RGWHandler_REST_SWIFT::init_from_header(s, frontend_prefix);
   if (ret < 0) {
@@ -2338,6 +2340,8 @@ RGWHandler_REST* RGWRESTMgr_SWIFT::get_handler(struct req_state* const s,
     return nullptr;
   }
 
+  const auto& auth_strategy = auth_registry.get_swift();
+
   if (s->init_state.url_bucket.empty()) {
     return new RGWHandler_REST_Service_SWIFT(auth_strategy);
   }
@@ -2351,8 +2355,10 @@ RGWHandler_REST* RGWRESTMgr_SWIFT::get_handler(struct req_state* const s,
 
 RGWHandler_REST* RGWRESTMgr_SWIFT_Info::get_handler(
   struct req_state* const s,
+  const rgw::auth::StrategyRegistry& auth_registry,
   const std::string& frontend_prefix)
 {
   s->prot_flags |= RGW_REST_SWIFT;
+  const auto& auth_strategy = auth_registry.get_swift();
   return new RGWHandler_REST_SWIFT_Info(auth_strategy);
 }
index a28fc2836c02427f956a64617ca3fb44fbb819a0..d2a1d72d8f1e77f969114b67d6d73e64441c5df4 100644 (file)
@@ -368,8 +368,6 @@ public:
 };
 
 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,
@@ -378,12 +376,11 @@ protected:
   }
 
 public:
-  RGWRESTMgr_SWIFT(const rgw::auth::Strategy* const auth_strategy)
-    : auth_strategy(*auth_strategy) {
-  }
+  RGWRESTMgr_SWIFT() = default;
   ~RGWRESTMgr_SWIFT() override = default;
 
   RGWHandler_REST *get_handler(struct req_state *s,
+                               const rgw::auth::StrategyRegistry& auth_registry,
                                const std::string& frontend_prefix) override;
 };
 
@@ -454,6 +451,7 @@ public:
   ~RGWRESTMgr_SWIFT_CrossDomain() override = default;
 
   RGWHandler_REST* get_handler(struct req_state* const s,
+                               const rgw::auth::StrategyRegistry&,
                                const std::string&) override {
     s->prot_flags |= RGW_REST_SWIFT;
     return new RGWHandler_SWIFT_CrossDomain;
@@ -509,6 +507,7 @@ public:
   ~RGWRESTMgr_SWIFT_HealthCheck() override = default;
 
   RGWHandler_REST* get_handler(struct req_state* const s,
+                               const rgw::auth::StrategyRegistry&,
                                const std::string&) override {
     s->prot_flags |= RGW_REST_SWIFT;
     return new RGWHandler_SWIFT_HealthCheck;
@@ -518,10 +517,7 @@ public:
 
 class RGWHandler_REST_SWIFT_Info : public RGWHandler_REST_SWIFT {
 public:
-  //using RGWHandler_REST_SWIFT::RGWHandler_REST_SWIFT;
-  RGWHandler_REST_SWIFT_Info(const rgw::auth::Strategy& auth_strategy)
-    : RGWHandler_REST_SWIFT(auth_strategy) {
-  }
+  using RGWHandler_REST_SWIFT::RGWHandler_REST_SWIFT;
   ~RGWHandler_REST_SWIFT_Info() override = default;
 
   RGWOp *op_get() override {
@@ -552,15 +548,12 @@ public:
 };
 
 class RGWRESTMgr_SWIFT_Info : public RGWRESTMgr {
-  const rgw::auth::Strategy& auth_strategy;
-
 public:
-  RGWRESTMgr_SWIFT_Info(const rgw::auth::Strategy* const auth_strategy)
-    : auth_strategy(*auth_strategy) {
-  }
+  RGWRESTMgr_SWIFT_Info() = default;
   ~RGWRESTMgr_SWIFT_Info() override = default;
 
   RGWHandler_REST *get_handler(struct req_state* s,
+                               const rgw::auth::StrategyRegistry& auth_registry,
                                const std::string& frontend_prefix) override;
 };
 
index 14c37da1cb16eaf6de2e851709ac3c420ca7834b..a09f32d0fe96f7682fbba17559a612498c515747 100644 (file)
@@ -13,8 +13,8 @@ protected:
   RGWOp *op_get() override;
   RGWOp *op_delete() override;
 public:
-  RGWHandler_Usage() {}
-  ~RGWHandler_Usage() override {}
+  using RGWHandler_Auth_S3::RGWHandler_Auth_S3;
+  ~RGWHandler_Usage() override = default;
 
   int read_permissions(RGWOp*) override {
     return 0;
@@ -27,8 +27,9 @@ public:
   ~RGWRESTMgr_Usage() override = default;
 
   RGWHandler_REST* get_handler(struct req_state*,
+                               const rgw::auth::StrategyRegistry& auth_registry,
                                const std::string&) override {
-    return new RGWHandler_Usage;
+    return new RGWHandler_Usage(auth_registry);
   }
 };
 
index 4a69ee559398fd19c7a180cffa9814c752f052e4..047fe5ffd604b32593be883dba0ca2ae9c4b1051 100644 (file)
@@ -15,8 +15,8 @@ protected:
   RGWOp *op_post() override;
   RGWOp *op_delete() override;
 public:
-  RGWHandler_User() {}
-  ~RGWHandler_User() override {}
+  using RGWHandler_Auth_S3::RGWHandler_Auth_S3;
+  ~RGWHandler_User() override = default;
 
   int read_permissions(RGWOp*) override {
     return 0;
@@ -29,8 +29,9 @@ public:
   ~RGWRESTMgr_User() override = default;
 
   RGWHandler_REST *get_handler(struct req_state*,
+                               const rgw::auth::StrategyRegistry& auth_registry,
                                const std::string&) override {
-    return new RGWHandler_User;
+    return new RGWHandler_User(auth_registry);
   }
 };
 
index d4ed3c2915593a2e99cc2bcee006648c536add52..055d541d3273a0837a42c597a8f6473b2edae82e 100644 (file)
@@ -306,6 +306,7 @@ public:
   }
 
   RGWHandler_REST* get_handler(struct req_state*,
+                               const rgw::auth::StrategyRegistry&,
                                const std::string&) override {
     return new RGWHandler_SWIFT_Auth;
   }