]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
rgw: add suport for creating S3 type subuser of admin rest api 10325/head
authorsnakeAngel2015 <li.jieA@h3c.com>
Mon, 18 Jul 2016 06:51:37 +0000 (14:51 +0800)
committersnakeAngel2015 <li.jieA@h3c.com>
Tue, 19 Jul 2016 01:34:05 +0000 (09:34 +0800)
commit6535f6ad2137ee55bf5531e865c05aa10bd39bd0
tree2ffda1f55f0adb8a17881babdb6baea656d5e0c1
parentcab254e924ab4393c5418e98b9ce775b56869568
rgw: add suport for creating S3 type subuser of admin rest api

Fixes: http://tracker.ceph.com/issues/16682
The original code cannot support create s3 type subuser of admin rest api as when i execute the following command:

  ./s3curl.pl --id=personal --put -- http://radosgw.h3c.com:8000/admin/user?subuser\&uid=yrf2\&subuser=yrf2:yrf1\&key-type=s3 -v

it would return msg as follows :

 < HTTP/1.1 403 Forbidden
< Date: Thu, 14 Jul 2016 07:04:40 GMT
* Server Apache/2.4.7 (Ubuntu) is not blacklisted
< Server: Apache/2.4.7 (Ubuntu)
< x-amz-request-id: tx00000000000000006608f-0057873988-8551-slave
< Accept-Ranges: bytes
< Content-Length: 114
< Content-Type: application/json
<
* Connection #0 to host slave.com left intact
{"Code":"InvalidAccessKeyId","RequestId":"tx00000000000000006608f-0057873988-8551-slave","HostId":"8551-slave-us"}

 But i have modified the codes for support it ,and it will return actual msg as follows :

  "subusers": [
        {
            "id": "yrf2:yrf1",
            "permissions": "<none>"
        }
    ],
    "keys": [
        {
            "user": "yrf2",
            "access_key": "B46PXYFEWUX0IMHGKP8C",
            "secret_key": "2JYxywXizqwiiMd74UXrJdSJMPNlBtYwF5z8rNvh"
        },
        {
            "user": "yrf2:yrf1",
            "access_key": "INO55WXJ7JQ1ZZGSAB6B",
            "secret_key": "GgCKEfF9hArV2hglunbO7KtvKZnbhmsDpqjSj5DL"
        }
    ],

Please check it ,thanks .

Signed-off-by: snakeAngel2015 <li.jieA@h3c.com>
src/rgw/rgw_rest_user.cc
src/rgw/rgw_user.cc