Merge pull request #1657 from sharelatex/sk-rate-limit-join-project

Add a rate-limit to joinProject

GitOrigin-RevId: 27edd8b56ae80868b5fcd0b803d0e042dce26f31
This commit is contained in:
Shane Kilkelly 2019-04-12 10:39:04 +01:00 committed by sharelatex
parent 36d0e8e199
commit f3dd61abce

View file

@ -30,4 +30,10 @@ module.exports =
# Called by the real-time API to load up the current project state. # Called by the real-time API to load up the current project state.
# This is a post request because it's more than just a getting of data. We take actions # This is a post request because it's more than just a getting of data. We take actions
# whenever a user joins a project, like updating the deleted status. # whenever a user joins a project, like updating the deleted status.
apiRouter.post '/project/:Project_id/join', AuthenticationController.httpAuth, EditorHttpController.joinProject apiRouter.post '/project/:Project_id/join', AuthenticationController.httpAuth,
RateLimiterMiddleware.rateLimit({
endpointName: "join-project"
params: ["Project_id"]
maxRequests: 30
timeInterval: 60
}), EditorHttpController.joinProject