Re: [jclouds] add aws s3 signature v4 (#678)

2015-05-20 Thread Zhao Jin
try Multipart Upload. initiate Multipart Upload..temporarily store specific length part, upload all stream part..complete multipart upload... part requires Content-Length. not all a file. but I have not tried :) --- Reply to this email directly or view it on GitHub: https://github.com/jclouds

Re: [jclouds] add aws s3 signature v4 (#678)

2015-05-03 Thread Zhao Jin
Hi, I impl aws s3 signer v4 chunked upload, use when put object, payload cannot repeatable. --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/678#issuecomment-98595506

Re: [jclouds] add aws s3 signature v4 (#678)

2015-04-19 Thread Zhao Jin
66Codes=[US, US-CA, US-OR, BR-SP, > IE, SG, AU-NSW, JP-13]} > > Tests run: 99, Failures: 4, Errors: 0, Skipped: 1 > | > > — > Reply to this email directly or view it on GitHub > <https://github.com/jclouds/jclouds/pull/678#issuecomment-94050351>. > -- 赵金 Zhao Jin 18610722868 北京优创联动科技有限公司 北京市 海淀区 学清路38号 金码大厦16层 100083 --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/678#issuecomment-94248352

Re: [jclouds] add aws s3 signature v4 (#678)

2015-03-31 Thread Zhao Jin
AWS Sign V4 use sha256 content hash. If payload can not be reset, aws supported chunked uploads. http://docs.aws.amazon.com/AmazonS3/latest/API/sigv4-streaming.html --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/678#issuecomment-88369850

Re: [jclouds] add aws s3 signature v4 (#678)

2015-03-04 Thread Zhao Jin
> +HttpRequest.Builder requestBuilder, > +String method, > +URI endpoint, > +Payload payload > +) { > +InputStream payloadStream; > +try { > +payloadStream = usePayloadForQueryParameters(method, payload) ? > +getQuerySt

Re: [jclouds] add aws s3 signature v4 (#678)

2015-02-26 Thread Zhao Jin
it's use for sign a temporary access... I provided testcase AWSS3BlobSignerV4ExpectTest. sorry, this's my first pull request, I format some code --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/678#issuecomment-76351814

Re: [jclouds] add aws s3 signature v4 (#678)

2015-02-20 Thread Zhao Jin
I'm sorry for my lazy... i add temporary access signature code, but i dont known how to test it. It could work in aws region cn-north-1. ```java public class AWSS3BlobStoreContextModule extends S3BlobStoreContextModule { //... @Override protected void bindRequestSigner() { bind(Blo

Re: [jclouds] add aws s3 signature v4 (#678)

2015-02-14 Thread Zhao Jin
> @@ -56,7 +56,7 @@ > public AWSS3BlobRequestSigner(RestAnnotationProcessor processor, > BlobToObject blobToObject, > BlobToHttpGetOptions blob2HttpGetOptions, Class > interfaceClass, > @org.jclouds.location.Provider Supplier credentials, > - RequestAuthorizeSignat

Re: [jclouds] add aws s3 signature v4 (#678)

2015-02-11 Thread Zhao Jin
> +try { > +String encoded = URLEncoder.encode(value, DEFAULT_ENCODING); > + > +Matcher matcher = ENCODED_CHARACTERS_PATTERN.matcher(encoded); > +StringBuffer buffer = new StringBuffer(encoded.length()); > + > +while (matcher.find()) { > +

Re: [jclouds] add aws s3 signature v4 (#678)

2015-02-11 Thread Zhao Jin
> + > +@Override > +public String service() { > +return service; > +} > + > +@Override > +public String region(String host) { > +return AwsHostNameUtils.parseRegionName(host, service()); > +} > +

Re: [jclouds] add aws s3 signature v4 (#678)

2015-02-11 Thread Zhao Jin
> +} > + > +byte[] hmacSHA256(String toSign, byte[] key) { > +try { > +ByteProcessor hmacSHA256 = > asByteProcessor(crypto.hmacSHA256(key)); > +return readBytes(toInputStream(toSign), hmacSHA256); > +} catch (IOException e) { > +throw new

Re: [jclouds] add aws s3 signature v4 (#678)

2015-02-11 Thread Zhao Jin
> @@ -56,7 +56,7 @@ > public AWSS3BlobRequestSigner(RestAnnotationProcessor processor, > BlobToObject blobToObject, > BlobToHttpGetOptions blob2HttpGetOptions, Class > interfaceClass, > @org.jclouds.location.Provider Supplier credentials, > - RequestAuthorizeSignat

Re: [jclouds] add aws s3 signature v4 (#678)

2015-02-11 Thread Zhao Jin
> +try { > +String encoded = URLEncoder.encode(value, DEFAULT_ENCODING); > + > +Matcher matcher = ENCODED_CHARACTERS_PATTERN.matcher(encoded); > +StringBuffer buffer = new StringBuffer(encoded.length()); > + > +while (matcher.find()) { > +

Re: [jclouds] add aws s3 signature v4 (#678)

2015-02-11 Thread Zhao Jin
> +SortedMap sorted = new TreeMap(); > +if (params == null) { > +return ""; > +} > +Iterator> pairs = > params.entries().iterator(); > +while (pairs.hasNext()) { > +Map.Entry pair = pairs.next(); > +String key = pair.getKe

Re: [jclouds] add aws s3 signature v4 (#678)

2015-02-11 Thread Zhao Jin
> > - private static final Set SIGNED_PARAMETERS = > ImmutableSet.of("acl", "torrent", "logging", "location", "policy", > +private static final Set SIGNED_PARAMETERS = > ImmutableSet.of("acl", "torrent", "logging", "location", "policy", Signature v4 need signed all of query string pa

Re: [jclouds] add aws s3 signature v4 (#678)

2015-02-10 Thread Zhao Jin
add aws s3 signature v4, plz review. --- Reply to this email directly or view it on GitHub: https://github.com/jclouds/jclouds/pull/678#issuecomment-73835221

[jclouds] add aws s3 signature v4 (#678)

2015-02-10 Thread Zhao Jin
AWS S3 signature v4 impl You can view, comment on, or merge this pull request online at: https://github.com/jclouds/jclouds/pull/678 -- Commit Summary -- * add aws s3 signature v4 -- File Changes -- M apis/s3/src/main/java/org/jclouds/s3/config/S3HttpApiModule.java (308) A apis/s3/