This included removing some internal version constraints. It would be
nice if package A could say "use B@2.0.0" (when both have changed), but
when they're both in the release, we need to make a release that has a
B@2.0.0-rc in it, which doesn't match that constraint. Fortunately,
constraints aren't necessary within a release anyway.
Modified testing to be extensible and easy to modify and more thorough
Refactored common code into ddp-rate-limiter-tests-common.js
Explicitly defined timeToReset to be passed back to user from livedata_server.js and appended to error object
Refactored rate-limit package to have a new rule class that organizes the rule attributes appropriately.
Moved all the Rule specific methods from RateLimiter to the Rule prototype. Reformatted code to match Meteor
code style.
Cleaned up rate-limit package to remove old methods before refactor. Renamed private
variables inside rate-limit package. Updated livedata_server.js to include rate limiting
for both methods and subscriptions in their respective protocol_handlers. Currently no default
rule for subscriptions in the global DDPRateLimiter.Fixed ddp-rate-limiter tests to work as well.
Need to add checks and throw errors if wrong format / input to rate-limit package. Updated default rule in ddp-rate-limiter
to reflect new rate-limit generic design and moved the location of the DDPRateLimiter in livedata_server.js. Need to fix tests
for both ddp-rate-limiter and rate-limit packages with updated code and clean up rate-limit package.
Changed rate-limit package to take generic rules and match generic inputs to those rules.
Now, users can use the rate-limit package for whatever they would like. Tests still need to
be updated and need to change location of ddp-rate-limiter to include subscriptions.
Need to remove duplicate code in rate-limit from previous implementation which hardcoded DDP types
into the rate limiting package by making the input be a DDPCommon.MethodInvocation object.
DDPRateLimiter is a global rate limiter with a public API to add rules, set the default
error message and an option to pass in a configuration of rules. It is integrated into
DDP already to check on every method invocation.
It now runs basically the same caching test as 'less'.
The implementation has been made to be a bit more like 'less'; eg, using
empty string instead of `__app__` to mean the app, and consistently
making pathInPackage not start with a slash.