]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/logging: log bucket must not have encryption
authorYuval Lifshitz <ylifshit@ibm.com>
Thu, 19 Dec 2024 13:49:07 +0000 (13:49 +0000)
committerYuval Lifshitz <ylifshit@ibm.com>
Mon, 13 Jan 2025 06:38:49 +0000 (06:38 +0000)
Signed-off-by: Yuval Lifshitz <ylifshit@ibm.com>
src/rgw/rgw_rest_bucket_logging.cc

index 5689a7acc5687cc6270b6f2ecb631e3f85c82aa8..b2676fc3bec7dd5778051fef3b176024df2af9b6 100644 (file)
@@ -200,7 +200,12 @@ class RGWPutBucketLoggingOp : public RGWDefaultResponseOp {
         op_ret = -EINVAL;
         return;
       }
-      // TODO: verify target bucket does not have encryption
+      // verify target bucket does not have encryption
+      if (target_attrs.find(RGW_ATTR_BUCKET_ENCRYPTION_POLICY) != target_attrs.end()) {
+        ldpp_dout(this, 1) << "ERROR: logging target bucket '" << target_bucket_id << "', is configured with encryption" << dendl;
+        op_ret = -EINVAL;
+        return;
+      }
       bufferlist conf_bl;
       encode(configuration, conf_bl);
       attrs[RGW_ATTR_BUCKET_LOGGING] = conf_bl;