diff --git a/swh/deposit/api/common.py b/swh/deposit/api/common.py --- a/swh/deposit/api/common.py +++ b/swh/deposit/api/common.py @@ -1,4 +1,4 @@ -# Copyright (C) 2017-2019 The Software Heritage developers +# Copyright (C) 2017-2020 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information @@ -58,7 +58,7 @@ ACCEPT_ARCHIVE_CONTENT_TYPES = ["application/zip", "application/x-tar"] -class SWHAPIView(APIView): +class AuthenticatedAPIView(APIView): """Mixin intended as a based API view to enforce the basic authentication check @@ -68,7 +68,7 @@ permission_classes: Sequence[Type[BasePermission]] = (IsAuthenticated,) -class SWHBaseDeposit(SWHDefaultConfig, SWHAPIView, metaclass=ABCMeta): +class SWHBaseDeposit(SWHDefaultConfig, AuthenticatedAPIView, metaclass=ABCMeta): """Base deposit request class sharing multiple common behaviors. """ diff --git a/swh/deposit/api/private/__init__.py b/swh/deposit/api/private/__init__.py --- a/swh/deposit/api/private/__init__.py +++ b/swh/deposit/api/private/__init__.py @@ -1,4 +1,4 @@ -# Copyright (C) 2017-2019 The Software Heritage developers +# Copyright (C) 2017-2020 The Software Heritage developers # See the AUTHORS file at the top-level directory of this distribution # License: GNU General Public License version 3, or any later version # See top-level LICENSE file for more information @@ -10,7 +10,7 @@ from rest_framework.permissions import AllowAny -from swh.deposit.api.common import SWHAPIView +from swh.deposit.api.common import AuthenticatedAPIView from swh.deposit.errors import make_error_dict, NOT_FOUND @@ -58,7 +58,7 @@ return utils.merge(*metadata) -class SWHPrivateAPIView(SWHDefaultConfig, SWHAPIView): +class SWHPrivateAPIView(SWHDefaultConfig, AuthenticatedAPIView): """Mixin intended as private api (so no authentication) based API view (for the private ones).