Skip to content

Commit

Permalink
feat: add jwt support
Browse files Browse the repository at this point in the history
  • Loading branch information
BryanttV committed May 31, 2024
1 parent e2ad27b commit 3684e57
Show file tree
Hide file tree
Showing 8 changed files with 688 additions and 73 deletions.
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

0 comments on commit 3684e57

Please sign in to comment.