Files
edx-platform/common/djangoapps/third_party_auth/saml_configuration/views.py
salmannawaz 57b480b04f 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
2024-02-13 10:46:58 -05:00

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)