aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2021-06-03 16:02:29 +0200
committerChocobozzz <me@florianbigard.com>2021-06-03 16:40:32 +0200
commit136d7efde798d3dc0ec0dd18aac674365f7d162e (patch)
tree3a0e2a7a5d04dedf0d8ffda99c2787cecb838891 /server/middlewares
parent49af5ac8c2653cb0ef23479c9d3256c5b724d49d (diff)
downloadPeerTube-136d7efde798d3dc0ec0dd18aac674365f7d162e.tar.gz
PeerTube-136d7efde798d3dc0ec0dd18aac674365f7d162e.tar.zst
PeerTube-136d7efde798d3dc0ec0dd18aac674365f7d162e.zip
Refactor AP actors
Diffstat (limited to 'server/middlewares')
-rw-r--r--server/middlewares/activitypub.ts6
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'
3import { logger } from '../helpers/logger' 3import { logger } from '../helpers/logger'
4import { isHTTPSignatureVerified, isJsonLDSignatureVerified, parseHTTPSignature } from '../helpers/peertube-crypto' 4import { isHTTPSignatureVerified, isJsonLDSignatureVerified, parseHTTPSignature } from '../helpers/peertube-crypto'
5import { ACCEPT_HEADERS, ACTIVITY_PUB, HTTP_SIGNATURE } from '../initializers/constants' 5import { ACCEPT_HEADERS, ACTIVITY_PUB, HTTP_SIGNATURE } from '../initializers/constants'
6import { getOrCreateActorAndServerAndModel } from '../lib/activitypub/actor' 6import { getOrCreateAPActor } from '../lib/activitypub/actors'
7import { loadActorUrlOrGetFromWebfinger } from '../helpers/webfinger' 7import { loadActorUrlOrGetFromWebfinger } from '../helpers/webfinger'
8import { isActorDeleteActivityValid } from '@server/helpers/custom-validators/activitypub/actor' 8import { isActorDeleteActivityValid } from '@server/helpers/custom-validators/activitypub/actor'
9import { getAPId } from '@server/helpers/activitypub' 9import { 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) {