NEW! Signed URLs


If you are using an alternative storage solution (e.g. Google, Rackspace, etc), Blitline supports the use of signed_urls. Many of these services, offer the ability to sign a url for uploading, which can then be used by Blitline for uploading your final images to them.


The benefit of this is that you do not need to give Blitline any permissions to your services. The signed url contains all the information necessary.


Important : You must be able to generate a signed_url on your own. We (Blitline) cannot generate it for you. Most modern SDKs for the various services allow for creation of these signed_urls


To use these signed urls with Blitline, the signed_url sits within an signed_destination like this:


{
	  "signed_destination" : {
	    "signed_url" : "https://storage.googleapis.com/blitline-test/foo.jpg?GoogleAccessId=431349666209-pbehjivpm9f0rqf2cdujasamur469p15@developer.gserviceaccount.com&Expires=1314370741&Signature=oPLJFBWQG9mLa7Uo%2BfQ...HuFvFaOpH7NmCT5XDHEw%3D%3D",
	    "headers" : {
	      "Content-Type" : "image.jpg"
	    }
	}
}

Remember: If you signed a url with headers, you must include those same headers in the signed_destination


Google Example

Google provides numerous SDK’s and a command line utility for signing URLs. The command line tool is the easiest to test and demonstrate with. The command line tool is named gsutil You can find the official documentation here:

https://cloud.google.com/storage/docs/gsutil


This particular command line tool has the ability to sign urls for uploading. You can read more about gsutil signing here:

https://cloud.google.com/storage/docs/gsutil/commands/signurl


To sign a file for uploading, first determine what the bucket and key are going to be for your file. For example, with a bucket name of blitline-test and a key of foo.jpg, the gsutil command would look like this:


gsutil signurl -p notasecret -c image/jpg -m PUT -d 1h ~/.mykeys/mygoogleauthkey.p12 gs://blitline-test/foo.jpg


Notice that we’ve specified the content type (image/jpg) and are using the PUT verb (as opposed to the POST verb which will not work for Blitline).


The output URL can then be used in the Blitline JSON via the signed_destination node. As we can see in the example above, we would just replace the signed_url with the URL generated by the gsutil.


{
	  "signed_destination" : {
	    "signed_url" : "https://storage.googleapis.com/blitline-test/foo.jpg?GoogleAccessId=431349666209-pbehjivpm9f0rqf2cdujasamur469p15@developer.gserviceaccount.com&Expires=1314370741&Signature=oPLJFBWQG9mLa7Uo%2BfQ...HuFvFaOpH7NmCT5XDHEw%3D%3D",
	    "headers" : {
	      "Content-Type" : "image.jpg"
	    }
	}
}

Important Note

Multipage files such as PDF’s will NOT work with signed urls unless your service provider allows the signing of wildcard values. This is because when Blitline outputs images from filetypes that have multiple pages, the output file has the page number appended to the end of it. Many signed url providers DO NOT allow wildcard destinations, such as /blitline-test/foo*.jpg, so Blitline is unable to upload the results of multipage files.