From c469a69ddc13f6b27f73507eadfc515c897038cc 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 3ba7be8d1ac7ee43e69eebb58263cd080cca1d38) Conflicts: src/rgw/rgw_main.cc (amqp, kafka) src/rgw/rgw_auth_registry.h (sts_strategy) --- doc/radosgw/keystone.rst | 7 ++++ doc/radosgw/multitenancy.rst | 7 ++++ 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 | 17 +++++++-- src/rgw/rgw_frontend.h | 9 ++++- src/rgw/rgw_main.cc | 7 +++- src/rgw/rgw_rest_s3.h | 31 --------------- src/rgw/rgw_swift_auth.h | 6 ++- 12 files changed, 165 insertions(+), 60 deletions(-) diff --git a/doc/radosgw/keystone.rst b/doc/radosgw/keystone.rst index a476237eaf785..950d868e91fe8 100644 --- a/doc/radosgw/keystone.rst +++ b/doc/radosgw/keystone.rst @@ -48,6 +48,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 b6d76c7575fa6..0cca50d966efc 100644 --- a/doc/radosgw/multitenancy.rst +++ b/doc/radosgw/multitenancy.rst @@ -154,6 +154,13 @@ are two or more different tenants all creating a container named ``foo``, radosgw is able to transparently discern them by their tenant prefix. +It is also possible to limit the effects of implicit tenants +to only apply to swift or s3, by setting ``rgw keystone implicit tenants`` +to either ``s3`` or ``swift``. This will likely primarily +be of use to users who had previously used implicit tenants +with older versions of ceph, where implicit tenants +only applied to the swift protocol. + Notes and known issues ---------------------- diff --git a/src/common/legacy_config_opts.h b/src/common/legacy_config_opts.h index 7be0744fc1348..ff4945f7c0991 100644 --- a/src/common/legacy_config_opts.h +++ b/src/common/legacy_config_opts.h @@ -1353,7 +1353,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 95ddada8ef942..01190b7e51554 100644 --- a/src/common/options.cc +++ b/src/common/options.cc @@ -5973,12 +5973,13 @@ std::vector