> @@ -83,13 +94,29 @@ public void trySign() throws InterruptedException, 
> ExecutionException {
>              continue;
>           }
>           String containerName = Iterables.getLast(containers).getName();
> -         PageSet<? extends StorageMetadata> blobs = 
> region.list(containerName);
> -         if (blobs.isEmpty()) {
> -            continue;
> -         }
> -         String blobName = Iterables.getLast(blobs).getName();
> +
> +         final ByteSource input = ByteSource.wrap(new byte[1]);
> +         final HttpClient client = ctx.utils().http();
> +
> +         // test signed put
> +         String blobName = "test-" + UUID.randomUUID();
> +         Blob blob2 = region.blobBuilder(blobName).forSigning()
> +               .payload(input).contentLength(input.size())

> Done. Added the payload to the put request

I'm not sure this is what @andrewgaul meant? If I understood his comment 
correctly, he meant "create the PUT request *without* supplying blob2, then 
attach the input to the request".

This would capture the intended case where a user asks the server for a 
pre-signed request (in which case the server does _not_ have the blob to 
attach), then attaches the payload before uploading.

@andrewgaul Thoughts?

---
Reply to this email directly or view it on GitHub:
https://github.com/jclouds/jclouds-labs-openstack/pull/94/files#r13034913

Reply via email to