This is working but I want to modify it to download some file, I am not
to interested at this time testing admin caps.
#!/bin/bash
#
# radosgw-admin caps add --uid='xxxx' --caps "buckets=read"
file=1MB.bin
bucket=test
key="xxxx"
secret="xxxx"
host="192.168.1.114:7480"
resource="/${bucket}/${file}"
resource="/admin/bucket"
contentType="application/x-compressed-tar"
dateValue=`date -R -u`
method="GET"
function hmacsha256 {
local key="$1"
local data="$2"
echo -n "$data" | openssl dgst -sha256 -mac HMAC -macopt "$key" | sed
's/^.* //'
}
stringToSign="${method}
${dateValue}
${resource}"
signature=`echo -en "$stringToSign" | openssl sha1 -hmac ${secret}
-binary | base64`
curl -X ${method} -H "Date: ${dateValue}" -H "Authorization: AWS
${key}:${signature}" -H "Host: ${host}"
"https://${host}${resource}?format=json&stats=True" --insecure
echo
-----Original Message-----
From: Konstantin Shalygin [mailto:[email protected]]
Sent: zaterdag 24 maart 2018 4:03
To: Marc Roos; ceph-users
Subject: *****SPAM***** Re: [ceph-users] Shell / curl test script for
rgw
On 03/24/2018 07:22 AM, Marc Roos wrote:
>
> Thanks! I got it working, although I had to change the date to "date
> -R -u", because I got the "RequestTimeTooSkewed" error.
>
> I also had to enable buckets=read on the account that was already able
> to read and write via cyberduck, I don’t get that.
>
> radosgw-admin caps add --uid='test$test1' --caps "buckets=read"
>
Please, post your version.
Because I was tune up date by this reason ("RequestTimeTooSkewed").
k
_______________________________________________
ceph-users mailing list
[email protected]
http://lists.ceph.com/listinfo.cgi/ceph-users-ceph.com