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: swift: the http referer acl in swift API should be shown #13003
rgw: swift: the http referer acl in swift API should be shown #13003
Conversation
@rzarzynski Hi |
c2b842d
to
81c7985
Compare
@mattbenjamin @cbodley @rzarzynski |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one minor thing. In overall the patch brings a lot of improvement for Swift API's referrer handling. Big thanks, @Jing-Scott!
|
||
if (perm != 0) { | ||
if(url_spec[0] == '.') | ||
url_spec = "*" + url_spec; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Swift handles this a bit different:
$ curl -i "${publicURL}/cont-for-acls" -X POST -H "X-Auth-Token: ${token}" -H "X-Container-Read: .r:*.example.com"
HTTP/1.1 204 No Content
Content-Length: 0
Content-Type: text/html; charset=UTF-8
X-Trans-Id: tx65885b8aa26d4c21bf582-0058878fc9
Date: Tue, 24 Jan 2017 17:32:57 GMT
$ curl -i "${publicURL}/cont-for-acls" -X HEAD -H "X-Auth-Token: ${token}"
HTTP/1.1 204 No Content
Content-Length: 0
X-Container-Object-Count: 0
Accept-Ranges: bytes
X-Timestamp: 1484935150.21775
X-Container-Read: .r:.example.com
X-Container-Bytes-Used: 0
Content-Type: text/plain; charset=utf-8
X-Trans-Id: tx8be1cb3d36544cd385a91-0058878fd0
Date: Tue, 24 Jan 2017 17:33:04 GMT
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rzarzynski
yeah, you are right. I've updated it, pls check it. Thanks a lot!
The container acl about http referer set should be shown in container metadata dump. Fixes: http://tracker.ceph.com/issues/18665 Signed-off-by: Jing Wenjun <jingwenjun@cmss.chinamobile.com>
id = SWIFT_GROUP_ALL_USERS; | ||
} else { | ||
url_spec = grant.get_referer(); | ||
if (url_spec.empty()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
May we have braces around this if
as well?
url_spec = grant.get_referer(); | ||
if (url_spec.empty()) | ||
continue; | ||
id = (perm !=0) ? ".r:" + url_spec : ".r:-" + url_spec; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed space before 0
.
@Jing-Scott: looks good to me, thanks! Those comments above are only about formatting, nothing more. I'm taking the change for testing. For the sake of backporting could you please squash the commits, create a ticket on RadosGW's tracker and put the |
ce49fb4
to
3860dda
Compare
Hi, @rzarzynski |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thanks!
jenkins test this please |
The Teuthology run looks good to me. There is one but unrelated failure. Merging. |
The container acl about http referer set should be shown in container metadata dump.
Signed-off-by: Jing Wenjun jingwenjun@cmss.chinamobile.com