You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need to ensure that all images saved by Blitline have public read disabled, and are accessible only via expiring REST API URLs.
As discussed on the S3 Headers page, Blitline should be able to handle this. But it looks like custom headers are not yet supported by this module, is that correct?
I did a bit of digging and I can see the Save and S3_Destination classes, but I'm not clear how exactly to go about modifying the current save behavior to take an optional set of S3_headers should they exist.
Is there a way to use a plain addFunction call to save with additional vars? Is this feature something which might be released shortly?
Thanks,
Ethan
The text was updated successfully, but these errors were encountered:
The nice thing about Node is that it plays so nicely with JSON. The S3_Destination class only defines the requirements for a key and a destination, but any other field can be dynamically added to it just as in javascript. So for example, if you wanted to add a s3_destination that had custom header fields you could just do something along the lines of:
var blitline = new Blitline();
/* Replace MY_APP_ID with your Blitline application_id */
var job = blitline.addJob("MY_APP_ID", "http://www.google.com/intl/en_com/images/srpr/logo3w.png");
var crop_function = job.addFunction("resize_to_fill", { width: 50, height: 50}, "my_cropped_image");
var save = new Save();
save.image_identifier = "MY_IMAGE_IDENTIFIER";
var s3Destination = new S3Destination();
s3Destination.bucket = "my_bucket";
s3Destination.key = "my_key";
s3Destination.headers = [
"x-amz-acl" :"private",
"x-amz-meta-foo" : "some_other_metadata_we_might_want"
]
save.s3_destination = s3Destination;
crop_function.save = save
blitline.postJobs(function(response) {
console.log(response);
});
All that being said, in the Blitline Ruby gem we have moved to simply defining the JSON and not trying to use an ORM to define a job, that only seems to take longer and is harder to change and keep updated. I will make a ticket to update the Node package with the ability to submit raw json instead of trying to build a job through objects.
For example, the item above ultimately just outputs the following to Blitline:
Hey there,
We need to ensure that all images saved by Blitline have public read disabled, and are accessible only via expiring REST API URLs.
As discussed on the S3 Headers page, Blitline should be able to handle this. But it looks like custom headers are not yet supported by this module, is that correct?
I did a bit of digging and I can see the Save and S3_Destination classes, but I'm not clear how exactly to go about modifying the current save behavior to take an optional set of S3_headers should they exist.
Is there a way to use a plain addFunction call to save with additional vars? Is this feature something which might be released shortly?
Thanks,
Ethan
The text was updated successfully, but these errors were encountered: