node-ddos
node-ddos copied to clipboard
Added sync/async whitelist hooks options
# Whitelist Hooks
For a use case we have, we needed to whitelist by user role and not by user IP. Thus, I added a new option called whitelistHook and whitelistHookSync. The objective of such options is to provide the user a mean to whitelist using whatever criteria she needs. It uses the same logic that onDenial.
Changes
- Added whiteListHook option
- Added whiteListHookSync option
- Added behavior for both options, this required splitting the _handle method in two
- Added tests for both options
- Updated readme
Final remarks
I figured I'd PR it since it can be useful to others, be free to accept or reject
Cheers!