Use scoped tokens to load <audio> urls instead of JWT

This commit is contained in:
Agate 2020-05-11 10:06:35 +02:00
parent 13d28f7b0c
commit ec8dfdb740
17 changed files with 265 additions and 39 deletions

View file

@ -30,6 +30,7 @@ from funkwhale_api.federation import tasks as federation_tasks
from funkwhale_api.tags.models import Tag, TaggedItem
from funkwhale_api.tags.serializers import TagSerializer
from funkwhale_api.users.oauth import permissions as oauth_permissions
from funkwhale_api.users.authentication import ScopedTokenAuthentication
from . import filters, licenses, models, serializers, tasks, utils
@ -571,7 +572,7 @@ class ListenViewSet(mixins.RetrieveModelMixin, viewsets.GenericViewSet):
serializer_class = serializers.TrackSerializer
authentication_classes = (
rest_settings.api_settings.DEFAULT_AUTHENTICATION_CLASSES
+ [SignatureAuthentication]
+ [SignatureAuthentication, ScopedTokenAuthentication]
)
permission_classes = [oauth_permissions.ScopePermission]
required_scope = "libraries"