From d2bdea8e7bc8eae64e4b72f581e424a9a6871aed Mon Sep 17 00:00:00 2001 From: Marcus Watts Date: Wed, 30 May 2018 16:37:31 -0400 Subject: [PATCH] rgw: making implicit_tenants backwards compatible. In jewel, "rgw keystone implicit tenants" only applied to swift. As of luminous), this option applies to s3 also. Sites that used this feature with jewel now have outstanding data that depends on the old behavior. The fix here is to expand "rgw keystone implicit tenants" so that it can be set to any of "none", "all", "s3" or "swift" (also 0=false=none, 1=true=all). When set to "s3" or "swift", the actual id lookup is also partitioned. Formerly "rgw keystone implicit tenants" was a legacy opt. This change converts it to the new style of option, including support for dynamically changing it. Fixes: http://tracker.ceph.com/issues/24348 Signed-off-by: Marcus Watts (cherry picked from commit a28a38f6e91da3abe59c34fad0e059eeaf29a65f) --- doc/radosgw/keystone.rst | 7 ++++ doc/radosgw/multitenancy.rst | 1 + src/common/legacy_config_opts.h | 1 - src/common/options.cc | 7 ++-- src/rgw/rgw_auth.cc | 68 ++++++++++++++++++++++++++++++--- src/rgw/rgw_auth.h | 47 +++++++++++++++++++++-- src/rgw/rgw_auth_registry.h | 18 +++++---- src/rgw/rgw_auth_s3.h | 9 ++++- src/rgw/rgw_frontend.h | 9 ++++- src/rgw/rgw_main.cc | 7 +++- src/rgw/rgw_rest_s3.h | 12 ++++-- src/rgw/rgw_swift_auth.h | 6 ++- 12 files changed, 162 insertions(+), 30 deletions(-) diff --git a/doc/radosgw/keystone.rst b/doc/radosgw/keystone.rst index 398276c74a578..4220b75c53dd9 100644 --- a/doc/radosgw/keystone.rst +++ b/doc/radosgw/keystone.rst @@ -47,6 +47,13 @@ For a v3 version of the OpenStack Identity API you should replace rgw keystone admin domain = {keystone admin domain name} rgw keystone admin project = {keystone admin project name} +For compatibility with previous versions of ceph, it is also +possible to set ``rgw keystone implicit tenants`` to either +``s3`` or ``swift``. This has the effect of splitting +the identity space such that the indicated protocol will +only use implicit tenants, and the other protocol will +never use implicit tenants. Some older versions of ceph +only supported implicit tenants with swift. Prior to Kilo ------------- diff --git a/doc/radosgw/multitenancy.rst b/doc/radosgw/multitenancy.rst index 95f22d7a1d916..b16f704b399ad 100644 --- a/doc/radosgw/multitenancy.rst +++ b/doc/radosgw/multitenancy.rst @@ -95,6 +95,7 @@ Swift with Keystone TBD -- don't forget to explain the function of rgw keystone implicit tenants = true in commit e9259486decab52a362443d3fd3dec33b0ec654f + [ There is a description of this in keystone.rst ] Notes and known issues ---------------------- diff --git a/src/common/legacy_config_opts.h b/src/common/legacy_config_opts.h index 0651b2070a33c..e43d0e9124925 100644 --- a/src/common/legacy_config_opts.h +++ b/src/common/legacy_config_opts.h @@ -1360,7 +1360,6 @@ OPTION(rgw_keystone_accepted_admin_roles, OPT_STR) // list of roles allowing an OPTION(rgw_keystone_token_cache_size, OPT_INT) // max number of entries in keystone token cache OPTION(rgw_keystone_revocation_interval, OPT_INT) // seconds between tokens revocation check OPTION(rgw_keystone_verify_ssl, OPT_BOOL) // should we try to verify keystone's ssl -OPTION(rgw_keystone_implicit_tenants, OPT_BOOL) // create new users in their own tenants of the same name 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? diff --git a/src/common/options.cc b/src/common/options.cc index 5e0596982e7eb..69a9acdcd89fd 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -4624,12 +4624,13 @@ std::vector