Update all edx-platform REST endpoints to support JWT Auth (#34152)

* chore: update API endpoints to support default JWT auth

The default DRF Auth classes were recently updated to allow for both JWT and Session auth by default. Any endpoint that overrides the AUTHENTICATION_CLASSES but has just session, just JWT or just both of those should be updated to remove the override.

Details in https://github.com/openedx/edx-platform/issues/33662
This commit is contained in:
salmannawaz
2024-02-13 20:46:58 +05:00
committed by GitHub
parent 45547ca087
commit 57b480b04f
22 changed files with 1 additions and 86 deletions

View File

@@ -6,9 +6,7 @@ from django.contrib.auth.models import User # lint-amnesty, pylint: disable=imp
from django.db.models import Q
from django.utils.decorators import method_decorator
from django.views.generic import View
from edx_rest_framework_extensions.auth.jwt.authentication import JwtAuthentication
from rest_framework.views import APIView
from rest_framework.authentication import SessionAuthentication
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticated
from social_django.models import UserSocialAuth
@@ -77,9 +75,6 @@ class LinkProgramEnrollmentSupportAPIView(APIView):
"""
Support-only API View for linking learner enrollments by support staff.
"""
authentication_classes = (
JwtAuthentication, SessionAuthentication
)
permission_classes = (
IsAuthenticated,
)
@@ -312,9 +307,6 @@ class ProgramEnrollmentsInspectorAPIView(ProgramEnrollmentInspector, APIView):
information of a learner.
"""
authentication_classes = (
JwtAuthentication, SessionAuthentication
)
permission_classes = (
IsAuthenticated,
)