> +            
> "?Signature=genkB2vLxe3AWV/bPvRTMqQts7E%3D&Expires=1212683902&AWSAccessKeyId=identity")
> +         .addHeader("Expect", "100-continue")
> +         .addHeader("Host", "container.s3.amazonaws.com")
> +         .addHeader("Date", "Thu, 05 Jun 2008 16:38:19 GMT").build();
> +   }
> +
> +   @Test
> +   public void testSignPutBlobWithTime() throws Exception {
> +      BlobStore signPutBloblWithTime = requestsSendResponses(init());
> +      Blob blob = 
> signPutBloblWithTime.blobBuilder(name).payload(text).contentType("text/plain").build();
> +      HttpRequest compare = putBlobWithTime();
> +      compare.setPayload(blob.getPayload());
> +      
> assertEquals(signPutBloblWithTime.getContext().getSigner().signPutBlob(container,
>  blob, 3l /* seconds */),
> +         compare);
> +   }
> +

Does either of these tests verify that, if the request _already_ contains a 
"Signature" param, it isn't added again? I'm trying to see how to easily 
construct such a test case, but for the moment can't figure out how a user 
would do that other than e.g. in a brute-force way, e.g.
```
@Test
public void preventDoubleSignature() {
  HttpRequest signedRequest = putBlobWithTime();
  newRequestAuthorizeSignature().replaceAuthorizationHeader(signedRequest, 
"new-sig");
  assertRequestDoesntContainTwoSigs();
}
```

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds/pull/71/files#r5362195

Reply via email to