From 1b1a317c9d39ffdf003f72e8e9853f0e25a1948c Mon Sep 17 00:00:00 2001 From: Abhishek Lekshmanan Date: Thu, 1 Mar 2018 17:22:33 +0100 Subject: [PATCH] rgw: have a configurable authentication order This implements a configurable authentication order, currently used only for s3 authentication and only supporting external & local authentication, though there is potential for more finegrained control by allowing for a map of various engines and the control strategy (required vs sufficient vs fallback) The current implementation just focuses on setting control fallback if the engine is the last in the order (and hence the stack) and just sets sufficient to every other element, so that errors from the last sufficient engine is returned. The configuration option is rgw_s3_auth_order which takes a comma/space seperated list of authentication engines where currently we support the keywords `external` and `local`. Luminous specific changes: std::string_view -> boost::string_view auto function return -> return type std::vector if initializer list dropped Fixes: http://tracker.ceph.com/issues/23089 Signed-off-by: Abhishek Lekshmanan (cherry picked from commit 9c7fc682ca23259037115db3437c2bc9dd91fa22) --- src/common/legacy_config_opts.h | 1 + src/common/options.cc | 9 ++++++ src/rgw/rgw_auth_s3.h | 49 +++++++++++++++++++++++++++------ 3 files changed, 51 insertions(+), 8 deletions(-) diff --git a/src/common/legacy_config_opts.h b/src/common/legacy_config_opts.h index 69bfcd7dee369..38b36a60cc88e 100644 --- a/src/common/legacy_config_opts.h +++ b/src/common/legacy_config_opts.h @@ -1375,6 +1375,7 @@ OPTION(rgw_cross_domain_policy, OPT_STR) OPTION(rgw_healthcheck_disabling_path, OPT_STR) // path that existence causes the healthcheck to respond 503 OPTION(rgw_s3_auth_use_rados, OPT_BOOL) // should we try to use the internal credentials for s3? OPTION(rgw_s3_auth_use_keystone, OPT_BOOL) // should we try to use keystone for s3? +OPTION(rgw_s3_auth_order, OPT_STR) // s3 authentication order to try OPTION(rgw_barbican_url, OPT_STR) // url for barbican server /* OpenLDAP-style LDAP parameter strings */ diff --git a/src/common/options.cc b/src/common/options.cc index 5d1f1fb9e3339..1ed027c9bebd6 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -4709,6 +4709,15 @@ std::vector