mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-07 20:31:06 -05:00
3553fb2d9d
Fix spelling of "middleware" GitOrigin-RevId: d2b2b20ad8a6871cd6366303e75b340f0f2f2dda
28 lines
1 KiB
CoffeeScript
28 lines
1 KiB
CoffeeScript
AuthorizationMiddleware = require('../Authorization/AuthorizationMiddleware')
|
|
AuthenticationController = require('../Authentication/AuthenticationController')
|
|
RateLimiterMiddleware = require('../Security/RateLimiterMiddleware')
|
|
LinkedFilesController = require "./LinkedFilesController"
|
|
|
|
module.exports =
|
|
apply: (webRouter) ->
|
|
webRouter.post '/project/:project_id/linked_file',
|
|
AuthenticationController.requireLogin(),
|
|
AuthorizationMiddleware.ensureUserCanWriteProjectContent,
|
|
RateLimiterMiddleware.rateLimit({
|
|
endpointName: "create-linked-file"
|
|
params: ["project_id"]
|
|
maxRequests: 100
|
|
timeInterval: 60
|
|
}),
|
|
LinkedFilesController.createLinkedFile
|
|
|
|
webRouter.post '/project/:project_id/linked_file/:file_id/refresh',
|
|
AuthenticationController.requireLogin(),
|
|
AuthorizationMiddleware.ensureUserCanWriteProjectContent,
|
|
RateLimiterMiddleware.rateLimit({
|
|
endpointName: "refresh-linked-file"
|
|
params: ["project_id"]
|
|
maxRequests: 100
|
|
timeInterval: 60
|
|
}),
|
|
LinkedFilesController.refreshLinkedFile
|