sailthru / sailthru-node-client

Sailthru Node.js client
http://docs.sailthru.com
MIT License
17 stars 15 forks source link

Added receiveOptoutPost method for verifying postback requests. #3

Closed bbickerton closed 12 years ago

bbickerton commented 12 years ago

Accepts an object of parameters. Ensures that 'action', 'email', and 'sig' parameters are defined and that 'action' is defined as 'optout'. Verifies that 'sig' matches the signature hash generated from the other parameters and the api secret.

infynyxx commented 12 years ago

Can you add a unit test also?

bbickerton commented 12 years ago

Added a unit test with cases for valid parameters (action, email, sig), no parameters, individual missing parameters, action that's not equal to 'output', and wrong signature. Found that originally it didn't originally handle an undefined parameter object correctly, so that got fixed. Let me know if you need anything else.

infynyxx commented 12 years ago

Thanks.

bbickerton commented 12 years ago

Great. Any timeframe on when this is going to make it into the npm registry?

infynyxx commented 12 years ago

No timeframe for now.

I will probably wait until there are few other changes / features.

bbickerton commented 12 years ago

We're using this in production, so it'd be nice to have it sooner rather than later. Is there anything I can do to help speed it up?