]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: Added support for testing the wildcard principal in policies.
authorJohn Gibson <jgibson@mitre.org>
Thu, 10 Aug 2017 17:39:35 +0000 (13:39 -0400)
committerAdam C. Emerson <aemerson@redhat.com>
Sun, 7 Jan 2018 10:11:27 +0000 (05:11 -0500)
Signed-off-by: John Gibson <jgibson@mitre.org>
(cherry picked from commit e83b647d44153a7775647693fca1848e592ee107)

src/test/rgw/test_rgw_iam_policy.cc

index 7751b086898bce2ffe9a81ed4d79502e0f047749..7738869ff37f752d3d241492ea2452941e122741 100644 (file)
@@ -109,7 +109,10 @@ public:
   }
 
   bool is_identity(const flat_set<Principal>& ids) const override {
-    return ids.find(id) != ids.end();
+    if (id.is_wildcard() && (!ids.empty())) {
+      return true;
+    }
+    return ids.find(id) != ids.end() || ids.find(Principal::wildcard()) != ids.end();
   }
 };