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

Update authentication scheme from Token to JWT #1038

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
apply JWTAuthentication to current APIs
  • Loading branch information
tomatoprinx committed Aug 14, 2021
commit fbc7e3429aeba38adaf08a1e3d30ac377dfd0b17
4 changes: 2 additions & 2 deletions src/attendee/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
from rest_framework.response import Response
from registry.helper import reg
from rest_framework.permissions import IsAuthenticated
from rest_framework_simplejwt.authentication import JWTAuthentication

from core.authentication import TokenAuthentication
from attendee.models import Attendee


class AttendeeAPIView(views.APIView):
authentication_classes = [TokenAuthentication]
authentication_classes = [JWTAuthentication]
permission_classes = [IsAuthenticated]

model = Attendee
Expand Down
10 changes: 5 additions & 5 deletions src/events/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@
from rest_framework.views import APIView
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticated
from rest_framework_simplejwt.authentication import JWTAuthentication

from django.conf import settings
from django.db.models import Count
from django.http import Http404

from core.authentication import TokenAuthentication
from events.models import (
CustomEvent, Location, ProposedTalkEvent,
ProposedTutorialEvent, SponsoredEvent, Time, KeynoteEvent
Expand All @@ -34,7 +34,7 @@ class TutorialListAPIView(ListAPIView):


class SpeechListAPIView(APIView):
authentication_classes = [TokenAuthentication]
authentication_classes = [JWTAuthentication]
permission_classes = [IsAuthenticated]

def get(self, request, *args, **kwargs):
Expand Down Expand Up @@ -76,7 +76,7 @@ class TutorialDetailAPIView(RetrieveAPIView):


class SpeechDetailAPIView(APIView):
authentication_classes = [TokenAuthentication]
authentication_classes = [JWTAuthentication]
permission_classes = [IsAuthenticated]

def get(self, request, *args, **kwargs):
Expand Down Expand Up @@ -213,7 +213,7 @@ def display(self):


class ScheduleAPIView(APIView):
authentication_classes = [TokenAuthentication]
authentication_classes = [JWTAuthentication]
permission_classes = [IsAuthenticated]

event_querysets = [
Expand Down Expand Up @@ -294,7 +294,7 @@ def get(self, request):


class KeynoteEventListAPIView(ListAPIView):
authentication_classes = [TokenAuthentication]
authentication_classes = [JWTAuthentication]
permission_classes = [IsAuthenticated]

queryset = KeynoteEvent.objects.all()
Expand Down
6 changes: 3 additions & 3 deletions src/sponsors/api/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
from rest_framework import views
from rest_framework.response import Response
from rest_framework.permissions import IsAuthenticated
from rest_framework_simplejwt.authentication import JWTAuthentication

from core.authentication import TokenAuthentication
from sponsors.models import Sponsor, OpenRole


class SponsorAPIView(views.APIView):
authentication_classes = [TokenAuthentication]
authentication_classes = [JWTAuthentication]
permission_classes = [IsAuthenticated]

def get(self, request):
Expand Down Expand Up @@ -42,7 +42,7 @@ def get(self, request):


class JobAPIView(views.APIView):
authentication_classes = [TokenAuthentication]
authentication_classes = [JWTAuthentication]
permission_classes = [IsAuthenticated]

def get(self, request):
Expand Down