From 587ea74e0d30aa8f2280da1ad42ad7812276bcdc Mon Sep 17 00:00:00 2001 From: Seena Fallah Date: Wed, 10 Apr 2024 01:49:15 +0200 Subject: [PATCH] rgw: allow disabling mdsearch APIs Since this is visible to the bucket owners, it can be presumed to be a functional feature. Providing the ability to deactivate the feature could be beneficial in such scenarios. Fixes: https://tracker.ceph.com/issues/65397 Signed-off-by: Seena Fallah --- src/common/options/rgw.yaml.in | 9 +++++++++ src/rgw/rgw_rest_s3.cc | 9 +++++++++ 2 files changed, 18 insertions(+) diff --git a/src/common/options/rgw.yaml.in b/src/common/options/rgw.yaml.in index ea6a4d64b50..6a064acd59a 100644 --- a/src/common/options/rgw.yaml.in +++ b/src/common/options/rgw.yaml.in @@ -2384,6 +2384,15 @@ options: services: - rgw with_legacy: true +- name: rgw_enable_mdsearch + type: bool + level: basic + desc: Enable elastic metadata search APIs + long_desc: This configurable controls whether RGW handles the elastic metadata search APIs. + default: true + services: + - rgw + with_legacy: true - name: rgw_user_unique_email type: bool level: basic diff --git a/src/rgw/rgw_rest_s3.cc b/src/rgw/rgw_rest_s3.cc index b74da944689..f5a6a964f04 100644 --- a/src/rgw/rgw_rest_s3.cc +++ b/src/rgw/rgw_rest_s3.cc @@ -4605,6 +4605,9 @@ RGWOp *RGWHandler_REST_Bucket_S3::op_get() } if (s->info.args.exists("mdsearch")) { + if (!s->cct->_conf->rgw_enable_mdsearch) { + return NULL; + } return new RGWGetBucketMetaSearch_ObjStore_S3; } @@ -4727,6 +4730,9 @@ RGWOp *RGWHandler_REST_Bucket_S3::op_delete() } if (s->info.args.exists("mdsearch")) { + if (!s->cct->_conf->rgw_enable_mdsearch) { + return NULL; + } return new RGWDelBucketMetaSearch_ObjStore_S3; } @@ -4740,6 +4746,9 @@ RGWOp *RGWHandler_REST_Bucket_S3::op_post() } if (s->info.args.exists("mdsearch")) { + if (!s->cct->_conf->rgw_enable_mdsearch) { + return NULL; + } return new RGWConfigBucketMetaSearch_ObjStore_S3; } -- 2.47.3