From 89f70dc928e9c29b431e94c7b18b30bd5c41a24c Mon Sep 17 00:00:00 2001 From: Carlos Santos <4a.santos@gmail.com> Date: Mon, 7 Apr 2025 18:39:56 +0200 Subject: [PATCH] backend: Moved start and stop recording to internal api --- backend/src/routes/recording.routes.ts | 38 ++++++++++++-------------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/backend/src/routes/recording.routes.ts b/backend/src/routes/recording.routes.ts index a944487..f85af26 100644 --- a/backend/src/routes/recording.routes.ts +++ b/backend/src/routes/recording.routes.ts @@ -20,22 +20,6 @@ recordingRouter.use(bodyParser.urlencoded({ extended: true })); recordingRouter.use(bodyParser.json()); // Recording Routes -recordingRouter.post( - '/', - withRecordingEnabled, - withAuth(participantTokenValidator), - withCorrectPermissions, - withValidStartRecordingRequest, - recordingCtrl.startRecording -); -recordingRouter.put( - '/:recordingId', - withRecordingEnabled, - withAuth(participantTokenValidator), - withCorrectPermissions, - withValidRecordingId, - recordingCtrl.stopRecording -); recordingRouter.delete( '/:recordingId', withAuth(apiKeyValidator, tokenAndRoleValidator(UserRole.ADMIN)), @@ -73,9 +57,21 @@ export const internalRecordingRouter = Router(); internalRecordingRouter.use(bodyParser.urlencoded({ extended: true })); internalRecordingRouter.use(bodyParser.json()); -internalRecordingRouter.get( - '/:recordingId/content', - withAuth(tokenAndRoleValidator(UserRole.ADMIN)), - withValidRecordingId, - recordingCtrl.getRecordingContent +// TODO: Check permissions middlewares +internalRecordingRouter.post( + '/', + withRecordingEnabled, + withAuth(participantTokenValidator), + withCorrectPermissions, + withValidStartRecordingRequest, + recordingCtrl.startRecording +); + +internalRecordingRouter.put( + '/:recordingId', + withRecordingEnabled, + withAuth(participantTokenValidator), + withCorrectPermissions, + withValidRecordingId, + recordingCtrl.stopRecording );