X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Fcontrollers%2Factivitypub%2Finbox.ts;h=66a38e05569ebe65cddb6f8b3e0cce787dc5e139;hb=a5a79d15427372b581e34ac3999c73fc316699d5;hp=ece4edff0c00e5961b5d05b7c8d4f7ee491f5550;hpb=41fb13c330de629df2d23379209e79c7af0f2e9a;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/controllers/activitypub/inbox.ts b/server/controllers/activitypub/inbox.ts index ece4edff0..66a38e055 100644 --- a/server/controllers/activitypub/inbox.ts +++ b/server/controllers/activitypub/inbox.ts @@ -1,10 +1,17 @@ import express from 'express' import { InboxManager } from '@server/lib/activitypub/inbox-manager' -import { Activity, ActivityPubCollection, ActivityPubOrderedCollection, RootActivity } from '../../../shared' +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() @@ -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 )