Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add support for JWT authentication DS-959 #206

Merged
merged 1 commit into from
Jun 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions eox_tenant/api/v1/viewsets.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"""
import logging

from edx_rest_framework_extensions.auth.jwt.authentication import JwtAuthentication
from rest_framework import viewsets
from rest_framework.authentication import SessionAuthentication
from rest_framework.parsers import JSONParser
Expand Down Expand Up @@ -241,7 +242,7 @@ class MicrositeViewSet(AlternativeFieldLookupMixin, viewsets.ModelViewSet):
Response: No content status code 204
"""

authentication_classes = (BearerAuthentication, SessionAuthentication)
authentication_classes = (BearerAuthentication, SessionAuthentication, JwtAuthentication)
parser_classes = [JSONParser]
permission_classes = [EoxTenantAPIPermission]
serializer_class = MicrositeSerializer
Expand Down Expand Up @@ -439,7 +440,7 @@ class TenantConfigViewSet(AlternativeFieldLookupMixin, viewsets.ModelViewSet):
Response: No content status code 204
"""

authentication_classes = (BearerAuthentication, SessionAuthentication)
authentication_classes = (BearerAuthentication, SessionAuthentication, JwtAuthentication)
parser_classes = [JSONParser]
permission_classes = [EoxTenantAPIPermission]
serializer_class = TenantConfigSerializer
Expand All @@ -450,7 +451,7 @@ class TenantConfigViewSet(AlternativeFieldLookupMixin, viewsets.ModelViewSet):
class RouteViewSet(viewsets.ModelViewSet):
"""RouteViewSet that allows the basic API actions."""

authentication_classes = (BearerAuthentication, SessionAuthentication)
authentication_classes = (BearerAuthentication, SessionAuthentication, JwtAuthentication)
parser_classes = [JSONParser]
permission_classes = [EoxTenantAPIPermission]
serializer_class = RouteSerializer
Expand Down
Loading
Loading