summaryrefslogtreecommitdiffstats
path: root/src/rgw/rgw_main.cc
diff options
context:
space:
mode:
authorRadoslaw Zarzynski <rzarzynski@mirantis.com>2017-03-20 04:35:42 +0100
committerRadoslaw Zarzynski <rzarzynski@mirantis.com>2017-03-24 22:45:28 +0100
commit9888ec33d54613dd91fac05d30567daf14c6b31b (patch)
treeee04ecbfcb7b3498b781c5cc13b3f93cadaec0f1 /src/rgw/rgw_main.cc
parentrgw: the S3's local v2 auth engine becomes a fallback conditionally. (diff)
downloadceph-9888ec33d54613dd91fac05d30567daf14c6b31b.tar.xz
ceph-9888ec33d54613dd91fac05d30567daf14c6b31b.zip
rgw: implement the dynamic reconfiguration of auth strategies.
Signed-off-by: Radoslaw Zarzynski <rzarzynski@mirantis.com>
Diffstat (limited to 'src/rgw/rgw_main.cc')
-rw-r--r--src/rgw/rgw_main.cc21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/rgw/rgw_main.cc b/src/rgw/rgw_main.cc
index 733d4567003..1bec56553a6 100644
--- a/src/rgw/rgw_main.cc
+++ b/src/rgw/rgw_main.cc
@@ -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);
}