Revert "Disable timed temporary signed URLs for AWS-S3"

This reverts commit bc0abbaa07 and
re-enables temp-signed URLs for S3.

Closes JCLOUDS-200
This commit is contained in:
Diwaker Gupta 2013-08-29 14:54:38 -07:00 committed by Andrew Gaul
parent 3e5aa78521
commit 0930b638e3
2 changed files with 7 additions and 4 deletions

View File

@ -72,14 +72,17 @@ public class AWSS3BlobRequestSigner extends S3BlobRequestSigner<AWSS3AsyncClient
public HttpRequest signGetBlob(String container, String name, long timeInSeconds) {
checkNotNull(container, "container");
checkNotNull(name, "name");
throw new UnsupportedOperationException();
HttpRequest request = processor.apply(Invocation.create(getMethod, ImmutableList.<Object> of(container, name)));
return cleanRequest(signForTemporaryAccess(request, timeInSeconds));
}
@Override
public HttpRequest signPutBlob(String container, Blob blob, long timeInSeconds) {
checkNotNull(container, "container");
checkNotNull(blob, "blob");
throw new UnsupportedOperationException();
HttpRequest request = processor.apply(Invocation.create(createMethod,
ImmutableList.<Object>of(container, blobToObject.apply(blob))));
return cleanRequest(signForTemporaryAccess(request, timeInSeconds));
}
private HttpRequest signForTemporaryAccess(HttpRequest request, long timeInSeconds) {

View File

@ -50,7 +50,7 @@ public class AWSS3BlobSignerExpectTest extends S3BlobSignerExpectTest {
.addHeader("Date", DATE).build();
}
@Test(expectedExceptions = UnsupportedOperationException.class)
@Test
public void testSignGetBlobWithTime() {
BlobStore getBlobWithTime = requestsSendResponses(init());
HttpRequest compare = getBlobWithTime();
@ -68,7 +68,7 @@ public class AWSS3BlobSignerExpectTest extends S3BlobSignerExpectTest {
.addHeader("Date", DATE).build();
}
@Test(expectedExceptions = UnsupportedOperationException.class)
@Test
public void testSignPutBlobWithTime() throws Exception {
BlobStore signPutBloblWithTime = requestsSendResponses(init());
Blob blob = signPutBloblWithTime.blobBuilder(name).payload(text).contentType("text/plain").build();