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>