backend: Moved global preference api to internal
This commit is contained in:
parent
caefdf704b
commit
0cc73050a8
@ -3,7 +3,7 @@ import bodyParser from 'body-parser';
|
||||
import * as appearancePrefCtrl from '../controllers/global-preferences/appearance-preferences.controller.js';
|
||||
import * as webhookPrefCtrl from '../controllers/global-preferences/webhook-preferences.controller.js';
|
||||
import * as securityPrefCtrl from '../controllers/global-preferences/security-preferences.controller.js';
|
||||
import { withAuth, tokenAndRoleValidator, apiKeyValidator } from '../middlewares/auth.middleware.js';
|
||||
import { withAuth, tokenAndRoleValidator } from '../middlewares/auth.middleware.js';
|
||||
import { UserRole } from '@typings-ce';
|
||||
import {
|
||||
validateSecurityPreferences,
|
||||
@ -17,20 +17,20 @@ preferencesRouter.use(bodyParser.json());
|
||||
// Webhook preferences
|
||||
preferencesRouter.put(
|
||||
'/webhooks',
|
||||
withAuth(apiKeyValidator, tokenAndRoleValidator(UserRole.ADMIN)),
|
||||
withAuth(tokenAndRoleValidator(UserRole.ADMIN)),
|
||||
validateWebhookPreferences,
|
||||
webhookPrefCtrl.updateWebhookPreferences
|
||||
);
|
||||
preferencesRouter.get(
|
||||
'/webhooks',
|
||||
withAuth(apiKeyValidator, tokenAndRoleValidator(UserRole.ADMIN)),
|
||||
withAuth(tokenAndRoleValidator(UserRole.ADMIN)),
|
||||
webhookPrefCtrl.getWebhookPreferences
|
||||
);
|
||||
|
||||
// Security preferences
|
||||
preferencesRouter.put(
|
||||
'/security',
|
||||
withAuth(apiKeyValidator, tokenAndRoleValidator(UserRole.ADMIN)),
|
||||
withAuth(tokenAndRoleValidator(UserRole.ADMIN)),
|
||||
validateSecurityPreferences,
|
||||
securityPrefCtrl.updateSecurityPreferences
|
||||
);
|
||||
@ -39,11 +39,11 @@ preferencesRouter.get('/security', securityPrefCtrl.getSecurityPreferences);
|
||||
// Appearance preferences
|
||||
preferencesRouter.put(
|
||||
'/appearance',
|
||||
withAuth(apiKeyValidator, tokenAndRoleValidator(UserRole.ADMIN)),
|
||||
withAuth(tokenAndRoleValidator(UserRole.ADMIN)),
|
||||
appearancePrefCtrl.updateAppearancePreferences
|
||||
);
|
||||
preferencesRouter.get(
|
||||
'/appearance',
|
||||
withAuth(apiKeyValidator, tokenAndRoleValidator(UserRole.ADMIN)),
|
||||
withAuth(tokenAndRoleValidator(UserRole.ADMIN)),
|
||||
appearancePrefCtrl.getAppearancePreferences
|
||||
);
|
||||
@ -50,7 +50,6 @@ const createApp = () => {
|
||||
app.use(`${MEET_API_BASE_PATH_V1}/docs`, (_req: Request, res: Response) => res.sendFile(publicApiHtmlFilePath));
|
||||
app.use(`${MEET_API_BASE_PATH_V1}/rooms`, /*mediaTypeValidatorMiddleware,*/ roomRouter);
|
||||
app.use(`${MEET_API_BASE_PATH_V1}/recordings`, /*mediaTypeValidatorMiddleware,*/ recordingRouter);
|
||||
app.use(`${MEET_API_BASE_PATH_V1}/preferences`, /*mediaTypeValidatorMiddleware,*/ preferencesRouter);
|
||||
|
||||
// Internal API routes
|
||||
app.use(`${MEET_INTERNAL_API_BASE_PATH_V1}/docs`, (_req: Request, res: Response) =>
|
||||
@ -60,6 +59,8 @@ const createApp = () => {
|
||||
app.use(`${MEET_INTERNAL_API_BASE_PATH_V1}/rooms`, internalRoomRouter);
|
||||
app.use(`${MEET_INTERNAL_API_BASE_PATH_V1}/participants`, internalParticipantsRouter);
|
||||
app.use(`${MEET_INTERNAL_API_BASE_PATH_V1}/recordings`, internalRecordingRouter);
|
||||
app.use(`${MEET_INTERNAL_API_BASE_PATH_V1}/preferences`, preferencesRouter);
|
||||
|
||||
app.use('/meet/health', (_req: Request, res: Response) => res.status(200).send('OK'));
|
||||
|
||||
// LiveKit Webhook route
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user