New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rgw: match wildcards in StringLike policy conditions #16491

Merged
merged 7 commits into from Aug 3, 2017

Conversation

Projects
None yet
4 participants
@cbodley
Contributor

cbodley commented Jul 21, 2017

the match() function used elsewhere in iam has some special handling for :s (because wildcards aren't supposed to span sections), so it wasn't appropriate for general-purpose StringLike matching (especially with urls). the match_internal() function, however, did most of what we needed. so i refactored that as match_wildcards() with some minor changes, and moved it to rgw_string.h. i also renamed match() to match_policy(). then added several unit tests for both interfaces

continuation of #15702

Fixes: http://tracker.ceph.com/issues/20308

@cbodley

This comment has been minimized.

Show comment
Hide comment
@cbodley

cbodley Jul 24, 2017

Contributor

added a fix for failing tests Parse3/Eval3

Contributor

cbodley commented Jul 24, 2017

added a fix for failing tests Parse3/Eval3

@cbodley

This comment has been minimized.

Show comment
Hide comment
@cbodley

cbodley Jul 25, 2017

Contributor

jenkins test this please

Contributor

cbodley commented Jul 25, 2017

jenkins test this please

@adamemerson

This comment has been minimized.

Show comment
Hide comment
@adamemerson

adamemerson Jul 25, 2017

Contributor

No strong feelings on it, I think the simplest thing to do is to keep not2 and binary function now. Since not2 is deprecated in c++17 as well, we can just swap it and binary function both out when we get there.

Contributor

adamemerson commented Jul 25, 2017

No strong feelings on it, I think the simplest thing to do is to keep not2 and binary function now. Since not2 is deprecated in c++17 as well, we can just swap it and binary function both out when we get there.

@cbodley

This comment has been minimized.

Show comment
Hide comment
@cbodley

cbodley Jul 25, 2017

Contributor

@adamemerson found std::not_fn from c++17 that replaces std::not2. i'm going to try to implement a not_fn in common/backport14.h so we can switch to that now

Contributor

cbodley commented Jul 25, 2017

@adamemerson found std::not_fn from c++17 that replaces std::not2. i'm going to try to implement a not_fn in common/backport14.h so we can switch to that now

@cbodley

This comment has been minimized.

Show comment
Hide comment
@cbodley

cbodley Jul 25, 2017

Contributor

updated with ceph::not_fn() and unit tests

Contributor

cbodley commented Jul 25, 2017

updated with ceph::not_fn() and unit tests

@@ -27,6 +27,8 @@ template<typename T>
using remove_reference_t = typename std::remove_reference<T>::type;
template<typename T>
using result_of_t = typename std::result_of<T>::type;
template<typename T>
using decay_t = typename std::decay<T>::type;

This comment has been minimized.

@adamemerson

adamemerson Jul 25, 2017

Contributor

👍

@adamemerson

adamemerson Jul 25, 2017

Contributor

👍

@cbodley cbodley added the needs-qa label Jul 26, 2017

cbodley added some commits Jul 21, 2017

rgw: split match into match_policy, match_wildcards
Signed-off-by: Casey Bodley <cbodley@redhat.com>
test/rgw: rename ceph_test_rgw_iam_policy to unittest_
tagging this as a unittest will make it run during 'make check'

Signed-off-by: Casey Bodley <cbodley@redhat.com>
test/rgw: add tests for match_wildcards, match_policy
Signed-off-by: Casey Bodley <cbodley@redhat.com>
test/rgw: add missing object tagging actions to policy tests
Signed-off-by: Casey Bodley <cbodley@redhat.com>
common: add std::not_fn to backport14.h and unit tests
Signed-off-by: Casey Bodley <cbodley@redhat.com>
rgw: policy uses ceph::not_fn instead of std::not2
Signed-off-by: Casey Bodley <cbodley@redhat.com>

@yuriw yuriw merged commit 0f481d0 into ceph:master Aug 3, 2017

4 checks passed

Signed-off-by all commits in this PR are signed
Details
Unmodified Submodules submodules for project are unmodified
Details
make check make check succeeded
Details
make check (arm64) make check succeeded
Details

@cbodley cbodley deleted the cbodley:wip-20308 branch Aug 3, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment