mirror of
https://code.eliotberriot.com/funkwhale/funkwhale.git
synced 2025-10-05 18:05:25 +02:00
Fix #758: Ensure all our ActivityPub fetches are authenticated
This commit is contained in:
parent
0cec13a78e
commit
da3710ff08
10 changed files with 40 additions and 12 deletions
|
@ -21,6 +21,7 @@ from funkwhale_api.common import preferences
|
|||
from funkwhale_api.common import utils as common_utils
|
||||
from funkwhale_api.common import views as common_views
|
||||
from funkwhale_api.federation.authentication import SignatureAuthentication
|
||||
from funkwhale_api.federation import actors
|
||||
from funkwhale_api.federation import api_serializers as federation_api_serializers
|
||||
from funkwhale_api.federation import routes
|
||||
|
||||
|
@ -303,7 +304,11 @@ def handle_serve(upload, user, format=None):
|
|||
# thus resulting in multiple downloads from the remote
|
||||
qs = f.__class__.objects.select_for_update()
|
||||
f = qs.get(pk=f.pk)
|
||||
f.download_audio_from_remote(user=user)
|
||||
if user.is_authenticated:
|
||||
actor = user.actor
|
||||
else:
|
||||
actor = actors.get_service_actor()
|
||||
f.download_audio_from_remote(actor=actor)
|
||||
data = f.get_audio_data()
|
||||
if data:
|
||||
f.duration = data["duration"]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue