Closed y12studio closed 10 years ago
layout work 純人類神經預測 - JS Bin
issue CORS blockchain api Block Explorer API - blockchain.info
use coindesk api http://jsbin.com/beduy/7/edit
Dreamhost Object CrossOrigin Test OK
upload to S3 type https://objects.dreamhost.com/y12bucket1/instock.json
$(function() {
var url = 'https://objects.dreamhost.com/y12bucket1/instock.json?AWSAccessKeyId=yxxxx';
$.getJSON(url).done(function(json){
console.log(json['1500']);
});
});
dreamhost object with http resp header - JS Bin
var url = 'https://objects.dreamhost.com/y12bucket1/instock.json';
$.getJSON(url).done(function(json,textStatus,jqXHR){
console.log(json['1500']);
console.log(jqXHR.getAllResponseHeaders());
});
curl test
$ curl -i https://objects.dreamhost.com/y12bucket1/instock.json -H "Origin: http://travis-ci.org"
HTTP/1.1 200 OK
Date: Mon, 14 Apr 2014 04:27:21 GMT
Server: Apache
Accept-Ranges: bytes
Last-Modified: Wed, 09 Apr 2014 04:06:41 GMT
ETag: "e9007e614ed3f5affa0e981d8a4a3461"
Content-Length: 25183
Content-Type: application/json
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, HEAD, POST, OPTIONS, PUT, DELETE
{
"2008": [
...
$ curl -i https://objects.dreamhost.com/y12bucket1/instock.json -H "Origin: http://travis-ci.org" -X OPTIONS
HTTP/1.1 400 Bad Request
Date: Mon, 14 Apr 2014 04:25:32 GMT
Server: Apache
Accept-Ranges: bytes
Content-Type: application/xml
Content-Length: 0
Access-Control-Allow-Headers: origin, content-length, content-type
Access-Control-Allow-Origin: *
Access-Control-Allow-Methods: GET, HEAD, POST, OPTIONS, PUT, DELETE
Access-Control-Max-Age: 1728000
Swift api and dreamhost object . Add Swift Key for user:sub-user
curl test1 with fake user/pass
$ curl -v -H 'X-Auth-User: test:tester' -H 'X-Auth-Key: testing' https://objects.dreamhost.com/auth/v1.0
> GET /auth/ HTTP/1.1
> User-Agent: curl/7.32.0
> Host: objects.dreamhost.com
> Accept: */*
> X-Auth-User: test:tester
> X-Auth-Key: testing
>
< HTTP/1.1 403 Forbidden
< Date: Thu, 10 Apr 2014 03:50:53 GMT
* Server Apache is not blacklisted
< Server: Apache
< Accept-Ranges: bytes
< Content-Length: 23
< Content-Type: application/json
<
* Connection #0 to host objects.dreamhost.com left intact
{"Code":"AccessDenied"}
curl test with real key
~$ curl -v -H 'X-Auth-User: user:subuser' -H 'X-Auth-Key: KeyXxx' https://objects.dreamhost.com/auth
< HTTP/1.1 204 No Content
< Date: Thu, 10 Apr 2014 03:56:48 GMT
* Server Apache is not blacklisted
< Server: Apache
< X-Storage-Url: https://objects.dreamhost.com/swift/v1
< X-Storage-Token: AUTH_xxxxxxxxxxxxxxx
< X-Auth-Token: AUTH_xxxxxxxxxxxx
< Content-Type: application/json
$ curl -v -H 'X-Auth-Token: AUTH_xxxxxxxxxxxx' https://objects.dreamhost.com/swift/v1/bucket1/privobj.json
....
$ curl -v -H 'X-Auth-Token: AUTH_xxxxxxxxxxxx' https://objects.dreamhost.com/swift/v1/bucket1/
< HTTP/1.1 200 OK
< Date: Thu, 10 Apr 2014 04:13:48 GMT
< Server: Apache
< Vary: Accept-Encoding
< Transfer-Encoding: chunked
< Content-Type: text/plain; charset=utf-8
<
foo2.json
privobj.json
$ curl -v -H 'X-Auth-Token: AUTH_xxxxxxxxxxxx' https://objects.dreamhost.com/swift/v1/bucket1?format=json
[{"name":"foo2.json","hash":"e9007e614edxxxx3461","bytes":25183,"content_type":"application\/json","last_modified":"2014-04-08T03:47:13.000Z"},{"name":"privobj.json","hash":"299e0505cbxxxx2b9e7","bytes":8228,"content_type":"application\/json","last_modified":"2014-04-10T04:06:31.000Z"}]
Authentication — DreamObjects 1.0 documentation 使用cURL操作Openstack对象存储的ReST API
Dreamhost Object Swift CORS Auth Test DH Object Swift Auth - JS Bin
JS Bin - Collaborative JavaScript Debugging