Skip to content

Instantly share code, notes, and snippets.

@kuenishi
Created February 5, 2014 04:57
Show Gist options
  • Save kuenishi/8817657 to your computer and use it in GitHub Desktop.
Save kuenishi/8817657 to your computer and use it in GitHub Desktop.
#!/bin/sh
echo "GET\n"
./s3curl.pl --id admin -- -s -v -x localhost:8080 http://test2.s3.amazonaws.com/?acl
echo "PUT\n"
./s3curl.pl --id admin -- -s -v -X PUT -x localhost:8080 http://test2.s3.amazonaws.com/?acl \
-H "content-type: application/xml" \
-d '<?xml version="1.0" encoding="UTF-8"?><AccessControlPolicy><AccessControlList><Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group"><URI>http://acs.amazonaws.com/groups/global/AllUsers</URI></Grantee><Permission>READ</Permission></Grant></AccessControlList></AccessControlPolicy>'
# -d '<?xml version="1.0" encoding="UTF-8"?><AccessControlPolicy><Owner><ID>ed336f04c62d1790b3a9d223d2b75e68b8827dd546719fd20a859a36140a0314</ID><DisplayName>admin</DisplayName></Owner><AccessControlList><Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="Group"><URI>http://acs.amazonaws.com/groups/global/AllUsers</URI></Grantee><Permission>READ</Permission></Grant></AccessControlList></AccessControlPolicy>'
## <AccessControlList><Grant><Grantee xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:type="CanonicalUser"><ID>ed336f04c62d1790b3a9d223d2b75e68b8827dd546719fd20a859a36140a0314</ID><DisplayName>ed336f04c62d1790b3a9d223d2b75e68b8827dd546719fd20a859a36140a0314</DisplayName></Grantee* Connection
@kuenishi
Copy link
Author

kuenishi commented Feb 5, 2014

derives

*   Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 8080 (#0)
> GET http://test2.s3.amazonaws.com/?acl HTTP/1.1
> User-Agent: curl/7.35.0
> Host: test2.s3.amazonaws.com
> Accept: */*
> Proxy-Connection: Keep-Alive
> Date: 水, 05  2月 2014 04:56:29 +0000
> Authorization: AWS J_PJJS7NEHXJSQQV5XJH:Nz4t/Q2oYH6EfzyFujXXa6hLdt8=
> 
< HTTP/1.1 200 OK
(snip)
< HTTP/1.1 403 Forbidden
* Server Riak CS is not blacklisted
< Server: Riak CS
< Date: Wed, 05 Feb 2014 04:56:29 GMT
< Content-Type: application/xml
< Content-Length: 160
< 
* Connection #0 to host localhost left intact
<?xml version="1.0" encoding="UTF-8"?><Error><Code>AccessDenied</Code><Message>Access Denied</Message><Resource>/test2</Resource><RequestId></RequestId></Error>

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