]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: allow disabling mdsearch APIs 56802/head
authorSeena Fallah <seenafallah@gmail.com>
Tue, 9 Apr 2024 23:49:15 +0000 (01:49 +0200)
committerSeena Fallah <seenafallah@gmail.com>
Tue, 9 Apr 2024 23:49:15 +0000 (01:49 +0200)
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 <seenafallah@gmail.com>
src/common/options/rgw.yaml.in
src/rgw/rgw_rest_s3.cc

index ea6a4d64b505ab2622410b0ba37d4f0131bca87e..6a064acd59a1cd3b161ee6eec17c35b2982be0ff 100644 (file)
@@ -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
index b74da94468988ffa07e7cf405caf9b11555c3b57..f5a6a964f0468a99d97ca4aa238abe946661b8cd 100644 (file)
@@ -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;
   }