added rate limit to compile endpoint

This commit is contained in:
Henry Oswald 2017-04-11 16:08:38 +01:00
parent 477278eea5
commit 0961a034ea

View file

@ -111,7 +111,13 @@ module.exports = class Router
webRouter.post '/project/:Project_id/settings', AuthorizationMiddlewear.ensureUserCanWriteProjectSettings, ProjectController.updateProjectSettings
webRouter.post '/project/:Project_id/settings/admin', AuthorizationMiddlewear.ensureUserCanAdminProject, ProjectController.updateProjectAdminSettings
webRouter.post '/project/:Project_id/compile', AuthorizationMiddlewear.ensureUserCanReadProject, CompileController.compile
webRouter.post '/project/:Project_id/compile', RateLimiterMiddlewear.rateLimit({
endpointName: "compile-project-http"
params: ["Project_id"]
maxRequests: 800
timeInterval: 60 * 60
}), AuthorizationMiddlewear.ensureUserCanReadProject, CompileController.compile
webRouter.post '/project/:Project_id/compile/stop', AuthorizationMiddlewear.ensureUserCanReadProject, CompileController.stopCompile
# Used by the web download buttons, adds filename header