Fix #758: Ensure all our ActivityPub fetches are authenticated

This commit is contained in:
Eliot Berriot 2019-03-15 12:08:45 +01:00
parent 0cec13a78e
commit da3710ff08
10 changed files with 40 additions and 12 deletions

View file

@ -703,12 +703,12 @@ class Upload(models.Model):
objects = UploadQuerySet.as_manager()
def download_audio_from_remote(self, user):
def download_audio_from_remote(self, actor):
from funkwhale_api.common import session
from funkwhale_api.federation import signing
if user.is_authenticated and user.actor:
auth = signing.get_auth(user.actor.private_key, user.actor.private_key_id)
if actor:
auth = signing.get_auth(actor.private_key, actor.private_key_id)
else:
auth = None