* 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
29 lines
747 B
Python
29 lines
747 B
Python
"""
|
|
Viewset for auth/saml/v0/saml_configuration
|
|
"""
|
|
|
|
from rest_framework import permissions, viewsets
|
|
|
|
from ..models import SAMLConfiguration
|
|
from .serializers import SAMLConfigurationSerializer
|
|
|
|
|
|
class SAMLConfigurationMixin:
|
|
permission_classes = (permissions.IsAuthenticated,)
|
|
serializer_class = SAMLConfigurationSerializer
|
|
|
|
|
|
class SAMLConfigurationViewSet(SAMLConfigurationMixin, viewsets.ReadOnlyModelViewSet):
|
|
"""
|
|
A View to handle SAMLConfiguration GETs
|
|
|
|
Usage:
|
|
GET /auth/saml/v0/saml_configuration/
|
|
"""
|
|
|
|
def get_queryset(self):
|
|
"""
|
|
Find and return all saml configurations that are listed as public.
|
|
"""
|
|
return SAMLConfiguration.objects.current_set().filter(is_public=True)
|