[feat] process forwarding message
All checks were successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/test Pipeline was successful

This commit is contained in:
SouthFox 2023-08-02 18:16:27 +08:00
parent 885e0c879c
commit 3eb22ce9db

View file

@ -1,11 +1,10 @@
#!/usr/bin/env python3 #!/usr/bin/env python3
import fastapi import fastapi
import json import json
import httpx
from loguru import logger from loguru import logger
from app.httpsig import HttpSignature from app.httpsig import HttpSignature
from app.config import AP_CONTENT_TYPE, USER_AGENT from app import ldsig
from app.database import AsyncSession from app.database import AsyncSession
from app.database import get_db_session from app.database import get_db_session
@ -58,6 +57,11 @@ async def inbox_prechecker(
logger.exception("Failed to precheck delete activity") logger.exception("Failed to precheck delete activity")
actor_id = payload["actor"] actor_id = payload["actor"]
send_actor_id = parsec_signature["keyid"].split('#')[0]
if actor_id != send_actor_id:
return await ldsig.verify_signature(db_session, payload)
_actor = await fetch_actor(db_session, actor_id) _actor = await fetch_actor(db_session, actor_id)
try: try: