aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/controllers/api/runners/jobs-files.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-06-20 14:17:34 +0200
committerChocobozzz <me@florianbigard.com>2023-06-20 14:17:34 +0200
commite915cde30ec47258a2beeec5ca748c928b59858c (patch)
treef5692ab20c534a61487f3bd471bb6105ed58d88a /server/controllers/api/runners/jobs-files.ts
parent923e41fa4f342019298b46e407ea1f0207f74205 (diff)
downloadPeerTube-e915cde30ec47258a2beeec5ca748c928b59858c.tar.gz
PeerTube-e915cde30ec47258a2beeec5ca748c928b59858c.tar.zst
PeerTube-e915cde30ec47258a2beeec5ca748c928b59858c.zip
Fix runner api rate limit bypass
Diffstat (limited to 'server/controllers/api/runners/jobs-files.ts')
-rw-r--r--server/controllers/api/runners/jobs-files.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/controllers/api/runners/jobs-files.ts b/server/controllers/api/runners/jobs-files.ts
index 260d824a8..4e69fb902 100644
--- a/server/controllers/api/runners/jobs-files.ts
+++ b/server/controllers/api/runners/jobs-files.ts
@@ -3,7 +3,7 @@ import { logger, loggerTagsFactory } from '@server/helpers/logger'
3import { proxifyHLS, proxifyWebTorrentFile } from '@server/lib/object-storage' 3import { proxifyHLS, proxifyWebTorrentFile } from '@server/lib/object-storage'
4import { VideoPathManager } from '@server/lib/video-path-manager' 4import { VideoPathManager } from '@server/lib/video-path-manager'
5import { getStudioTaskFilePath } from '@server/lib/video-studio' 5import { getStudioTaskFilePath } from '@server/lib/video-studio'
6import { asyncMiddleware } from '@server/middlewares' 6import { apiRateLimiter, asyncMiddleware } from '@server/middlewares'
7import { jobOfRunnerGetValidator } from '@server/middlewares/validators/runners' 7import { jobOfRunnerGetValidator } from '@server/middlewares/validators/runners'
8import { 8import {
9 runnerJobGetVideoStudioTaskFileValidator, 9 runnerJobGetVideoStudioTaskFileValidator,
@@ -16,18 +16,21 @@ const lTags = loggerTagsFactory('api', 'runner')
16const runnerJobFilesRouter = express.Router() 16const runnerJobFilesRouter = express.Router()
17 17
18runnerJobFilesRouter.post('/jobs/:jobUUID/files/videos/:videoId/max-quality', 18runnerJobFilesRouter.post('/jobs/:jobUUID/files/videos/:videoId/max-quality',
19 apiRateLimiter,
19 asyncMiddleware(jobOfRunnerGetValidator), 20 asyncMiddleware(jobOfRunnerGetValidator),
20 asyncMiddleware(runnerJobGetVideoTranscodingFileValidator), 21 asyncMiddleware(runnerJobGetVideoTranscodingFileValidator),
21 asyncMiddleware(getMaxQualityVideoFile) 22 asyncMiddleware(getMaxQualityVideoFile)
22) 23)
23 24
24runnerJobFilesRouter.post('/jobs/:jobUUID/files/videos/:videoId/previews/max-quality', 25runnerJobFilesRouter.post('/jobs/:jobUUID/files/videos/:videoId/previews/max-quality',
26 apiRateLimiter,
25 asyncMiddleware(jobOfRunnerGetValidator), 27 asyncMiddleware(jobOfRunnerGetValidator),
26 asyncMiddleware(runnerJobGetVideoTranscodingFileValidator), 28 asyncMiddleware(runnerJobGetVideoTranscodingFileValidator),
27 getMaxQualityVideoPreview 29 getMaxQualityVideoPreview
28) 30)
29 31
30runnerJobFilesRouter.post('/jobs/:jobUUID/files/videos/:videoId/studio/task-files/:filename', 32runnerJobFilesRouter.post('/jobs/:jobUUID/files/videos/:videoId/studio/task-files/:filename',
33 apiRateLimiter,
31 asyncMiddleware(jobOfRunnerGetValidator), 34 asyncMiddleware(jobOfRunnerGetValidator),
32 asyncMiddleware(runnerJobGetVideoTranscodingFileValidator), 35 asyncMiddleware(runnerJobGetVideoTranscodingFileValidator),
33 runnerJobGetVideoStudioTaskFileValidator, 36 runnerJobGetVideoStudioTaskFileValidator,