]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: policy: support for s3 conditionals in ListBucket
authorAbhishek Lekshmanan <abhishek@suse.com>
Thu, 27 Jul 2017 15:36:37 +0000 (17:36 +0200)
committerAdam C. Emerson <aemerson@redhat.com>
Sun, 7 Jan 2018 10:10:41 +0000 (05:10 -0500)
This adds support for s3:prefix,delimeter & maxkeys identifiers when
specified as conditionals in policy.

Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
(cherry picked from commit a7184ca8c507b66ef01687bd85528342ea3bf934)

src/rgw/rgw_op.cc

index 11fdbd4ebc3fdb95863baf710c0cd52da11a9574..8007357d01682781bf999887730cae5213a6a0b9 100644 (file)
@@ -2239,6 +2239,19 @@ int RGWListBucket::verify_permission()
   if (op_ret < 0) {
     return op_ret;
   }
+  if (!prefix.empty())
+    s->env.emplace(std::piecewise_construct,
+                  std::forward_as_tuple("s3:prefix"),
+                  std::forward_as_tuple(prefix));
+
+  if (!delimiter.empty())
+    s->env.emplace(std::piecewise_construct,
+                  std::forward_as_tuple("s3:delimiter"),
+                  std::forward_as_tuple(delimiter));
+
+  s->env.emplace(std::piecewise_construct,
+                std::forward_as_tuple("s3:max-keys"),
+                std::forward_as_tuple(to_string(max)));
 
   if (!verify_bucket_permission(s,
                                list_versions ?