diff options
Diffstat (limited to 'server/middlewares/activitypub.ts')
-rw-r--r-- | server/middlewares/activitypub.ts | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/server/middlewares/activitypub.ts b/server/middlewares/activitypub.ts index 6cd23f230..a1fdfafcf 100644 --- a/server/middlewares/activitypub.ts +++ b/server/middlewares/activitypub.ts | |||
@@ -3,7 +3,7 @@ import { ActivityDelete, ActivityPubSignature } from '../../shared' | |||
3 | import { logger } from '../helpers/logger' | 3 | import { logger } from '../helpers/logger' |
4 | import { isHTTPSignatureVerified, isJsonLDSignatureVerified, parseHTTPSignature } from '../helpers/peertube-crypto' | 4 | import { isHTTPSignatureVerified, isJsonLDSignatureVerified, parseHTTPSignature } from '../helpers/peertube-crypto' |
5 | import { ACCEPT_HEADERS, ACTIVITY_PUB, HTTP_SIGNATURE } from '../initializers/constants' | 5 | import { ACCEPT_HEADERS, ACTIVITY_PUB, HTTP_SIGNATURE } from '../initializers/constants' |
6 | import { getOrCreateActorAndServerAndModel } from '../lib/activitypub/actor' | 6 | import { getOrCreateAPActor } from '../lib/activitypub/actors' |
7 | import { loadActorUrlOrGetFromWebfinger } from '../helpers/webfinger' | 7 | import { loadActorUrlOrGetFromWebfinger } from '../helpers/webfinger' |
8 | import { isActorDeleteActivityValid } from '@server/helpers/custom-validators/activitypub/actor' | 8 | import { isActorDeleteActivityValid } from '@server/helpers/custom-validators/activitypub/actor' |
9 | import { getAPId } from '@server/helpers/activitypub' | 9 | import { getAPId } from '@server/helpers/activitypub' |
@@ -100,7 +100,7 @@ async function checkHttpSignature (req: Request, res: Response) { | |||
100 | actorUrl = await loadActorUrlOrGetFromWebfinger(actorUrl.replace(/^acct:/, '')) | 100 | actorUrl = await loadActorUrlOrGetFromWebfinger(actorUrl.replace(/^acct:/, '')) |
101 | } | 101 | } |
102 | 102 | ||
103 | const actor = await getOrCreateActorAndServerAndModel(actorUrl) | 103 | const actor = await getOrCreateAPActor(actorUrl) |
104 | 104 | ||
105 | const verified = isHTTPSignatureVerified(parsed, actor) | 105 | const verified = isHTTPSignatureVerified(parsed, actor) |
106 | if (verified !== true) { | 106 | if (verified !== true) { |
@@ -135,7 +135,7 @@ async function checkJsonLDSignature (req: Request, res: Response) { | |||
135 | 135 | ||
136 | logger.debug('Checking JsonLD signature of actor %s...', creator) | 136 | logger.debug('Checking JsonLD signature of actor %s...', creator) |
137 | 137 | ||
138 | const actor = await getOrCreateActorAndServerAndModel(creator) | 138 | const actor = await getOrCreateAPActor(creator) |
139 | const verified = await isJsonLDSignatureVerified(actor, req.body) | 139 | const verified = await isJsonLDSignatureVerified(actor, req.body) |
140 | 140 | ||
141 | if (verified !== true) { | 141 | if (verified !== true) { |