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: implement stringlike wildcard for bucket policy #15702

Closed
wants to merge 1 commit into
base: master
from

Conversation

Projects
None yet
4 participants
@joke-lee
Contributor

joke-lee commented Jun 15, 2017

hi, @cbodley ,@adamemerson recently i implement stringlike wildcard for bucket policy, do you mind to help review this ? thanks

@joke-lee

This comment has been minimized.

Show comment
Hide comment
@joke-lee
Contributor

joke-lee commented Jun 15, 2017

@cbodley cbodley requested a review from adamemerson Jun 15, 2017

@cbodley cbodley added the rgw label Jun 15, 2017

bool> {
bool operator ()(const std::string& s1,
const std::string& s2) const {
if(fnmatch(s2.c_str(), s1.c_str(), 0) == 0){

This comment has been minimized.

@cbodley

cbodley Jun 15, 2017

Contributor

it doesn't look like fnmatch() defaults to case-insensitive matching:

FNM_CASEFOLD: If this flag (a GNU extension) is set, the pattern is matched case-insensitively.

@cbodley

cbodley Jun 15, 2017

Contributor

it doesn't look like fnmatch() defaults to case-insensitive matching:

FNM_CASEFOLD: If this flag (a GNU extension) is set, the pattern is matched case-insensitively.

This comment has been minimized.

@joke-lee

joke-lee Jun 22, 2017

Contributor

hi @cbodley i change the function ci_string_like to string_like , i think string_like should be case-sensitively

@joke-lee

joke-lee Jun 22, 2017

Contributor

hi @cbodley i change the function ci_string_like to string_like , i think string_like should be case-sensitively

@joke-lee

This comment has been minimized.

Show comment
Hide comment
@joke-lee

joke-lee Jun 16, 2017

Contributor

test this please

Contributor

joke-lee commented Jun 16, 2017

test this please

@cbodley

This comment has been minimized.

Show comment
Hide comment
@cbodley

cbodley Jun 16, 2017

Contributor

make check failures should be fixed with #15730, can you rebase please?

Contributor

cbodley commented Jun 16, 2017

make check failures should be fixed with #15730, can you rebase please?

@adamemerson

Otherwise looks fine.

Show outdated Hide outdated src/rgw/rgw_iam_policy.h Outdated
Show outdated Hide outdated src/rgw/rgw_iam_policy.h Outdated
@joke-lee

This comment has been minimized.

Show comment
Hide comment
@joke-lee

joke-lee Jun 22, 2017

Contributor

hi @adamemerson ,if we use the match function in rgw_common
and we set reffer string like policy.
http://www.example.com/ could not match pattern http://www.example.com/*
so i think fnmatch is better.

Contributor

joke-lee commented Jun 22, 2017

hi @adamemerson ,if we use the match function in rgw_common
and we set reffer string like policy.
http://www.example.com/ could not match pattern http://www.example.com/*
so i think fnmatch is better.

@adamemerson

This comment has been minimized.

Show comment
Hide comment
@adamemerson

adamemerson Jun 22, 2017

Contributor

Just add the MATCH_POLICY_ACTION flag to it and it will ignore case. (This should probably be renamed sometime.)

Contributor

adamemerson commented Jun 22, 2017

Just add the MATCH_POLICY_ACTION flag to it and it will ignore case. (This should probably be renamed sometime.)

rgw: implement stringlike wildcard for bucket policy
Signed-off-by: yuliyang <yuliyang@cmss.chinamobile.com>
@mattbenjamin

This comment has been minimized.

Show comment
Hide comment
@mattbenjamin

mattbenjamin Jul 6, 2017

Contributor

@joke-lee will add MATCH_POLICY_ACTION update?

Matt

Contributor

mattbenjamin commented Jul 6, 2017

@joke-lee will add MATCH_POLICY_ACTION update?

Matt

@joke-lee joke-lee closed this Jul 7, 2017

@cbodley

This comment has been minimized.

Show comment
Hide comment
@cbodley

cbodley Jul 20, 2017

Contributor

what are we blocked on here? we'll need wildcard support to pass ceph/s3-tests#167:

                    "StringLikeIfExists": {
                        "aws:Referer": "http://www.example.com/*"
                    }
Contributor

cbodley commented Jul 20, 2017

what are we blocked on here? we'll need wildcard support to pass ceph/s3-tests#167:

                    "StringLikeIfExists": {
                        "aws:Referer": "http://www.example.com/*"
                    }
@joke-lee

This comment has been minimized.

Show comment
Hide comment
@joke-lee

joke-lee Jul 22, 2017

Contributor

@cbodley compile error if we use match funtion and MATCH_POLICY_ACTION defined in rgw_common.h,i still look into this.

Contributor

joke-lee commented Jul 22, 2017

@cbodley compile error if we use match funtion and MATCH_POLICY_ACTION defined in rgw_common.h,i still look into this.

@cbodley

This comment has been minimized.

Show comment
Hide comment
@cbodley

cbodley Jul 24, 2017

Contributor

hi @joke-lee, i was able to get this working in #16491, could you take a look? i also opened #16463 with some extra fixes for IfExists to get your s3test in ceph/s3-tests#167 to pass

Contributor

cbodley commented Jul 24, 2017

hi @joke-lee, i was able to get this working in #16491, could you take a look? i also opened #16463 with some extra fixes for IfExists to get your s3test in ceph/s3-tests#167 to pass

@joke-lee joke-lee deleted the joke-lee:feature/bucket_policy_wildcarding_support branch Sep 26, 2017

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