]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/controllers/activitypub/inbox.ts
Give moderators access to edit channels (#4608)
[github/Chocobozzz/PeerTube.git] / server / controllers / activitypub / inbox.ts
index ece4edff0c00e5961b5d05b7c8d4f7ee491f5550..5995b8f3ad5e2c00ae6b643274df79e79c50d55f 100644 (file)
@@ -4,7 +4,14 @@ import { Activity, ActivityPubCollection, ActivityPubOrderedCollection, RootActi
 import { HttpStatusCode } from '../../../shared/models/http/http-error-codes'
 import { isActivityValid } from '../../helpers/custom-validators/activitypub/activity'
 import { logger } from '../../helpers/logger'
-import { asyncMiddleware, checkSignature, localAccountValidator, localVideoChannelValidator, signatureValidator } from '../../middlewares'
+import {
+  asyncMiddleware,
+  checkSignature,
+  ensureIsLocalChannel,
+  localAccountValidator,
+  signatureValidator,
+  videoChannelsNameWithHostValidator
+} from '../../middlewares'
 import { activityPubValidator } from '../../middlewares/validators/activitypub/activity'
 
 const inboxRouter = express.Router()
@@ -23,10 +30,11 @@ inboxRouter.post('/accounts/:name/inbox',
   asyncMiddleware(activityPubValidator),
   inboxController
 )
-inboxRouter.post('/video-channels/:name/inbox',
+inboxRouter.post('/video-channels/:nameWithHost/inbox',
   signatureValidator,
   asyncMiddleware(checkSignature),
-  asyncMiddleware(localVideoChannelValidator),
+  asyncMiddleware(videoChannelsNameWithHostValidator),
+  ensureIsLocalChannel,
   asyncMiddleware(activityPubValidator),
   inboxController
 )