aheckmann / node-ses

An Amazon SES api for nodejs with proper error handling.
http://aheckmann.github.com/node-ses
MIT License
201 stars 37 forks source link

Refactor internals to support AWS authentication version 4 #35

Closed markstos closed 7 years ago

markstos commented 7 years ago

As part of this, the ability to change the algorithm is removed. It seemed to be a rarely used feature, and with version 4, I found no other alternative algorithms documented.

The heavy lifting was outsourced to the 'aws4' module, which allowed for significant simplications to the internals of mail sending.

The old internal post function become much smaller and got folded into to the send function, which did littl except call post.

On the other hand, the function to process the response from AWS has grown in size and complexity was over time, and was extracted into it's own function, which will make it easier to add unit tests for override our logic for handing the AWS response.

All regression tests pass, although some related to "algorithm" or rolling-our-own request signatures were removed.

Would fix #33 and make it easier to unit test #34