refactor(core): Enforce authorization by default on all routes (no-changelog) (#8762)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-02-28 17:02:18 +01:00
committed by GitHub
parent 2811f77798
commit db4a419c8d
46 changed files with 126 additions and 299 deletions

View File

@@ -104,7 +104,7 @@ export const setupPushHandler = (restEndpoint: string, app: Application) => {
const pushValidationMiddleware: RequestHandler = async (
req: SSEPushRequest | WebSocketPushRequest,
res,
_,
next,
) => {
const ws = req.ws;
@@ -127,7 +127,8 @@ export const setupPushHandler = (restEndpoint: string, app: Application) => {
const authService = Container.get(AuthService);
app.use(
endpoint,
authService.createAuthMiddleware('any'),
// eslint-disable-next-line @typescript-eslint/unbound-method
authService.authMiddleware,
pushValidationMiddleware,
(req: SSEPushRequest | WebSocketPushRequest, res: PushResponse) => push.handleRequest(req, res),
);