Conversation
Along with creating the new handler updated the readme and changelog for the s3 upload handler as it was the starting point for the delete handler. The delete handler was written to support deletions of multiple files from a single bucket. To keep parsing simple the folders and files can't contain a ",".
The handler needed to be version because the SDK was updated. Updated the handler to leverage user/pass when attempting to download files from Core
handlers/amazon_s3_file_upload_from_submission_v2/handler/init.rb
Outdated
Show resolved
Hide resolved
Small updates to the delete handler as per PR review. Refactored the file upload handler to support file streams. Added acl parameter and removed file name parameter.
jackboespflug
left a comment
There was a problem hiding this comment.
One thing I find kind of weird is the return variable Public URL. If an ACL is applied, then will the resulting attachment url still be public?
Also, the result is an array, not a single URL - even if there is only one attachment. I think the results of that would be kind of hard to use.
I think a better pattern would be to name the result Attachment URL and provide a comma-separated list by calling ERB::Util.html_escape(public_url.join(",")).
A single file attachment would just result in a simple string, and multiple attachments would result in a comma-separated list of urls. Just document it that way in the readme and node.xml file and I think it would be straightforward to understand.
handlers/amazon_s3_file_upload_from_submission_v2/handler/init.rb
Outdated
Show resolved
Hide resolved
handlers/amazon_s3_file_upload_from_submission_v2/handler/init.rb
Outdated
Show resolved
Hide resolved
handlers/amazon_s3_file_upload_from_submission_v2/handler/init.rb
Outdated
Show resolved
Hide resolved
handlers/amazon_s3_file_upload_from_submission_v2/handler/init.rb
Outdated
Show resolved
Hide resolved
handlers/amazon_s3_file_upload_from_submission_v2/handler/init.rb
Outdated
Show resolved
Hide resolved
Made updates as per PR review. Cleaned up variable names, logging, and comments. Changed region default, updated public url result name, converted returned urls from array to csv, updated logic branches for setting source_server.
jackboespflug
left a comment
There was a problem hiding this comment.
The node.xml return values need to be updated.
Public URL is now Attachment URL, and the Handler Error Message result is missing.
The attachment handler was versioned and updated due to inconsistent behavior at EITaaS. There were times when the handler would fail and I believed it was due to a timing issue when uploading to filehub.
The delete handler was added at Matt H request.