File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed
ee/packages/federation-matrix/src/api/_matrix Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,8 @@ import type { HomeserverServices } from '@rocket.chat/federation-sdk';
22import { Router } from '@rocket.chat/http-router' ;
33import { ajv } from '@rocket.chat/rest-typings/dist/v1/Ajv' ;
44
5+ import { isAuthenticatedMiddleware } from '../middlewares/isAuthenticated' ;
6+
57const PublicRoomsQuerySchema = {
68 type : 'object' ,
79 properties : {
@@ -122,9 +124,10 @@ const PublicRoomsPostBodySchema = {
122124const isPublicRoomsPostBodyProps = ajv . compile ( PublicRoomsPostBodySchema ) ;
123125
124126export const getMatrixRoomsRoutes = ( services : HomeserverServices ) => {
125- const { state } = services ;
127+ const { state, federationAuth } = services ;
126128
127129 return new Router ( '/federation' )
130+ . use ( isAuthenticatedMiddleware ( federationAuth ) )
128131 . get (
129132 '/v1/publicRooms' ,
130133 {
Original file line number Diff line number Diff line change @@ -473,6 +473,7 @@ export const getMatrixTransactionsRoutes = (services: HomeserverServices) => {
473473 tags : [ 'Federation' ] ,
474474 license : [ 'federation' ] ,
475475 } ,
476+ canAccessResourceMiddleware ( federationAuth , 'room' ) ,
476477 async ( c ) => {
477478 const roomId = c . req . param ( 'roomId' ) ;
478479 const limit = Number ( c . req . query ( 'limit' ) || 100 ) ;
You can’t perform that action at this time.
0 commit comments