-import * as express from 'express'
+import express from 'express'
import { InboxManager } from '@server/lib/activitypub/inbox-manager'
-import { Activity, ActivityPubCollection, ActivityPubOrderedCollection, RootActivity } from '../../../shared'
-import { HttpStatusCode } from '../../../shared/core-utils/miscs/http-error-codes'
+import { Activity, ActivityPubCollection, ActivityPubOrderedCollection, RootActivity } from '@shared/models'
+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()
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
)