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 appearancePrefCtrl from '../controllers/global-preferences/appearance-preferences.controller.js';
|
||||||
import * as webhookPrefCtrl from '../controllers/global-preferences/webhook-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 * 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 { UserRole } from '@typings-ce';
|
||||||
import {
|
import {
|
||||||
validateSecurityPreferences,
|
validateSecurityPreferences,
|
||||||
@ -17,20 +17,20 @@ preferencesRouter.use(bodyParser.json());
|
|||||||
// Webhook preferences
|
// Webhook preferences
|
||||||
preferencesRouter.put(
|
preferencesRouter.put(
|
||||||
'/webhooks',
|
'/webhooks',
|
||||||
withAuth(apiKeyValidator, tokenAndRoleValidator(UserRole.ADMIN)),
|
withAuth(tokenAndRoleValidator(UserRole.ADMIN)),
|
||||||
validateWebhookPreferences,
|
validateWebhookPreferences,
|
||||||
webhookPrefCtrl.updateWebhookPreferences
|
webhookPrefCtrl.updateWebhookPreferences
|
||||||
);
|
);
|
||||||
preferencesRouter.get(
|
preferencesRouter.get(
|
||||||
'/webhooks',
|
'/webhooks',
|
||||||
withAuth(apiKeyValidator, tokenAndRoleValidator(UserRole.ADMIN)),
|
withAuth(tokenAndRoleValidator(UserRole.ADMIN)),
|
||||||
webhookPrefCtrl.getWebhookPreferences
|
webhookPrefCtrl.getWebhookPreferences
|
||||||
);
|
);
|
||||||
|
|
||||||
// Security preferences
|
// Security preferences
|
||||||
preferencesRouter.put(
|
preferencesRouter.put(
|
||||||
'/security',
|
'/security',
|
||||||
withAuth(apiKeyValidator, tokenAndRoleValidator(UserRole.ADMIN)),
|
withAuth(tokenAndRoleValidator(UserRole.ADMIN)),
|
||||||
validateSecurityPreferences,
|
validateSecurityPreferences,
|
||||||
securityPrefCtrl.updateSecurityPreferences
|
securityPrefCtrl.updateSecurityPreferences
|
||||||
);
|
);
|
||||||
@ -39,11 +39,11 @@ preferencesRouter.get('/security', securityPrefCtrl.getSecurityPreferences);
|
|||||||
// Appearance preferences
|
// Appearance preferences
|
||||||
preferencesRouter.put(
|
preferencesRouter.put(
|
||||||
'/appearance',
|
'/appearance',
|
||||||
withAuth(apiKeyValidator, tokenAndRoleValidator(UserRole.ADMIN)),
|
withAuth(tokenAndRoleValidator(UserRole.ADMIN)),
|
||||||
appearancePrefCtrl.updateAppearancePreferences
|
appearancePrefCtrl.updateAppearancePreferences
|
||||||
);
|
);
|
||||||
preferencesRouter.get(
|
preferencesRouter.get(
|
||||||
'/appearance',
|
'/appearance',
|
||||||
withAuth(apiKeyValidator, tokenAndRoleValidator(UserRole.ADMIN)),
|
withAuth(tokenAndRoleValidator(UserRole.ADMIN)),
|
||||||
appearancePrefCtrl.getAppearancePreferences
|
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}/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}/rooms`, /*mediaTypeValidatorMiddleware,*/ roomRouter);
|
||||||
app.use(`${MEET_API_BASE_PATH_V1}/recordings`, /*mediaTypeValidatorMiddleware,*/ recordingRouter);
|
app.use(`${MEET_API_BASE_PATH_V1}/recordings`, /*mediaTypeValidatorMiddleware,*/ recordingRouter);
|
||||||
app.use(`${MEET_API_BASE_PATH_V1}/preferences`, /*mediaTypeValidatorMiddleware,*/ preferencesRouter);
|
|
||||||
|
|
||||||
// Internal API routes
|
// Internal API routes
|
||||||
app.use(`${MEET_INTERNAL_API_BASE_PATH_V1}/docs`, (_req: Request, res: Response) =>
|
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}/rooms`, internalRoomRouter);
|
||||||
app.use(`${MEET_INTERNAL_API_BASE_PATH_V1}/participants`, internalParticipantsRouter);
|
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}/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'));
|
app.use('/meet/health', (_req: Request, res: Response) => res.status(200).send('OK'));
|
||||||
|
|
||||||
// LiveKit Webhook route
|
// LiveKit Webhook route
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user