From c6504637f693486f73e00d4a1246718d25c96cca Mon Sep 17 00:00:00 2001 From: Oksamies Date: Wed, 13 Dec 2023 13:44:22 +0200 Subject: [PATCH] Remove unnecessary IsAuthenticated permission classses --- .../thunderstore/repository/api/experimental/views/submit.py | 3 --- .../thunderstore/repository/api/experimental/views/upload.py | 2 -- .../repository/api/experimental/views/validators.py | 4 ---- .../thunderstore/usermedia/api/experimental/views/upload.py | 4 ---- 4 files changed, 13 deletions(-) diff --git a/django/thunderstore/repository/api/experimental/views/submit.py b/django/thunderstore/repository/api/experimental/views/submit.py index edd4a2400..611103724 100644 --- a/django/thunderstore/repository/api/experimental/views/submit.py +++ b/django/thunderstore/repository/api/experimental/views/submit.py @@ -3,7 +3,6 @@ from django.core.exceptions import ObjectDoesNotExist from django.core.files.uploadedfile import TemporaryUploadedFile from drf_yasg.utils import swagger_auto_schema -from rest_framework import permissions from rest_framework.exceptions import NotFound, ValidationError from rest_framework.response import Response from rest_framework.views import APIView @@ -36,8 +35,6 @@ class SubmitPackageApiView(APIView): Submits a pre-uploaded package by upload uuid. """ - permission_classes = [permissions.IsAuthenticated] - @swagger_auto_schema( request_body=PackageSubmissionMetadataSerializer(), responses={200: PackageSubmissionResult()}, diff --git a/django/thunderstore/repository/api/experimental/views/upload.py b/django/thunderstore/repository/api/experimental/views/upload.py index 819bf6fa8..69bfeb978 100644 --- a/django/thunderstore/repository/api/experimental/views/upload.py +++ b/django/thunderstore/repository/api/experimental/views/upload.py @@ -1,5 +1,4 @@ from drf_yasg.utils import swagger_auto_schema -from rest_framework import permissions from rest_framework.parsers import MultiPartParser from rest_framework.response import Response from rest_framework.views import APIView @@ -17,7 +16,6 @@ class UploadPackageApiView(APIView): """ parser_classes = [MultiPartParser] - permission_classes = [permissions.IsAuthenticated] @swagger_auto_schema( deprecated=True, diff --git a/django/thunderstore/repository/api/experimental/views/validators.py b/django/thunderstore/repository/api/experimental/views/validators.py index bb9f0efdb..d9545ec48 100644 --- a/django/thunderstore/repository/api/experimental/views/validators.py +++ b/django/thunderstore/repository/api/experimental/views/validators.py @@ -1,5 +1,4 @@ from drf_yasg.utils import swagger_auto_schema -from rest_framework import permissions from rest_framework.response import Response from rest_framework.views import APIView @@ -20,7 +19,6 @@ class ReadmeValidatorApiView(APIView): Validates a package readme. """ - permission_classes = [permissions.IsAuthenticated] params_serializer_class = ReadmeValidatorParamsSerializer response_serializer_class = ValidatorResponseSerializer @@ -49,7 +47,6 @@ class ManifestV1ValidatorApiView(APIView): Validates a package manifest. """ - permission_classes = [permissions.IsAuthenticated] params_serializer_class = ManifestV1ValidatorParamsSerializer response_serializer_class = ValidatorResponseSerializer @@ -83,7 +80,6 @@ class IconValidatorApiView(APIView): Validates a package icon. """ - permission_classes = [permissions.IsAuthenticated] params_serializer_class = IconValidatorParamsSerializer response_serializer_class = ValidatorResponseSerializer diff --git a/django/thunderstore/usermedia/api/experimental/views/upload.py b/django/thunderstore/usermedia/api/experimental/views/upload.py index 81b046fbf..6b22c0614 100644 --- a/django/thunderstore/usermedia/api/experimental/views/upload.py +++ b/django/thunderstore/usermedia/api/experimental/views/upload.py @@ -5,7 +5,6 @@ from drf_yasg.utils import swagger_auto_schema from rest_framework import status from rest_framework.generics import GenericAPIView -from rest_framework.permissions import IsAuthenticated from rest_framework.response import Response from thunderstore.usermedia.api.experimental.serializers import ( @@ -27,7 +26,6 @@ class UserMediaInitiateUploadApiView(GenericAPIView): queryset = UserMedia.objects.active() serializer_class = UserMediaInitiateUploadResponseSerializer - permission_classes = [IsAuthenticated] @swagger_auto_schema( request_body=UserMediaInitiateUploadParams, @@ -72,7 +70,6 @@ class UserMediaFinishUploadApiView(GenericAPIView): lookup_field = "uuid" lookup_url_kwarg = "uuid" serializer_class = UserMediaFinishUploadParamsSerializer - permission_classes = [IsAuthenticated] @swagger_auto_schema( request_body=UserMediaFinishUploadParamsSerializer(), @@ -104,7 +101,6 @@ class UserMediaAbortUploadApiView(GenericAPIView): queryset = UserMedia.objects.active() lookup_field = "uuid" lookup_url_kwarg = "uuid" - permission_classes = [IsAuthenticated] @swagger_auto_schema( responses={200: UserMediaSerializer()},