-
Notifications
You must be signed in to change notification settings - Fork 5.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DDPRateLimiter should allow a callback for going over the limit #5541
Comments
I think this shouldn't be hard to add in the Here's the relevant code: https://github.com/meteor/meteor/blob/devel/packages/ddp-rate-limiter/ddp-rate-limiter.js |
The problem with getErrorMessage is that it's a single function for all the possible limits someone might wanna use, maybe for some you wanna ban and for some you don't. |
Yeah but you could put an if statement in there since you get all of the data in the callback argument. I'm not saying it's perfect, but it is a viable workaround for now. |
You get No idea what function and you can't even access the connection data (i.e this.connection.id is undefined) |
Oh weird, I would have thought that should give you the name of the DDP message. |
@nlhuykhang Something like that. Perhaps it would be worth having the callback's signature be |
I think it would also make sense to modify https://github.com/meteor/meteor/blob/devel/packages/rate-limit/rate-limit.js#L131 so the input is added to the rate limit result. It seems to make sense to be able to see what caused the error in the error message (seeing that @stubailo thought this was already in there). |
Great ideas guys! Time to make this a reality then? I'd be happy to work on this if we agree this approach makes sense. |
Sorry @nlhuykhang - I've been reading too many GH issues lately, I skipped right past your reference! |
This should be released in Meteor 1.4.3.2. You can try the latest 1.4.3.2 beta and help confirm/test by running:
Please report back if you encounter any problems. Thanks for suggesting this originally, @shaylevi2, and thanks very much for submitting a PR to make it happen, @nlhuykhang. |
Assuming a user is constantly going over the set limit - I would like to automatically ban this user.
Given a method that ran everytime a user has gone over the specified limit, would allow me to do it.
The text was updated successfully, but these errors were encountered: