Skip to content

Commit

Permalink
use BearerAuthenticationAllowInactiveUser on Tahoe APIs
Browse files Browse the repository at this point in the history
OAuth2AuthenticationAllowInactiveUser has been deprecated
  • Loading branch information
OmarIthawi committed Mar 7, 2021
1 parent b18da4f commit 0582c6f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions openedx/core/djangoapps/appsembler/sites/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from rest_framework.views import APIView
from openedx.core.lib.api.permissions import ApiKeyHeaderPermission
from openedx.core.lib.api.authentication import (
OAuth2AuthenticationAllowInactiveUser,
BearerAuthenticationAllowInactiveUser,
)
from openedx.core.djangoapps.appsembler.sites.models import AlternativeDomain
from openedx.core.djangoapps.appsembler.sites.permissions import AMCAdminPermission
Expand All @@ -40,7 +40,7 @@
class SiteViewSet(viewsets.ReadOnlyModelViewSet):
queryset = Site.objects.all()
serializer_class = SiteSerializer
authentication_classes = (OAuth2AuthenticationAllowInactiveUser,)
authentication_classes = (BearerAuthenticationAllowInactiveUser,)
permission_classes = (IsAuthenticated, AMCAdminPermission)

def get_queryset(self):
Expand All @@ -56,7 +56,7 @@ class SiteConfigurationViewSet(viewsets.ModelViewSet):
serializer_class = SiteConfigurationSerializer
list_serializer_class = SiteConfigurationListSerializer
create_serializer_class = SiteSerializer
authentication_classes = (OAuth2AuthenticationAllowInactiveUser,)
authentication_classes = (BearerAuthenticationAllowInactiveUser,)
permission_classes = (IsAuthenticated, AMCAdminPermission)

def get_serializer_class(self):
Expand Down
6 changes: 3 additions & 3 deletions openedx/core/djangoapps/appsembler/tpa_admin/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from openedx.core.djangoapps.appsembler.sites.permissions import AMCAdminPermission

from openedx.core.lib.api.authentication import (
OAuth2AuthenticationAllowInactiveUser,
BearerAuthenticationAllowInactiveUser,
)
from third_party_auth.models import SAMLConfiguration, SAMLProviderConfig
from openedx.core.djangoapps.appsembler.tpa_admin.serializers import (
Expand All @@ -25,7 +25,7 @@ class SAMLConfigurationViewSet(viewsets.ModelViewSet):
model = SAMLConfiguration
queryset = SAMLConfiguration.objects.current_set().order_by('id')
serializer_class = SAMLConfigurationSerializer
authentication_classes = (OAuth2AuthenticationAllowInactiveUser,)
authentication_classes = (BearerAuthenticationAllowInactiveUser,)
permission_classes = (IsAuthenticated, AMCAdminPermission)
filterset_class = SAMLConfigurationFilter

Expand All @@ -50,7 +50,7 @@ def get_queryset(self):
class SAMLProviderConfigViewSet(viewsets.ModelViewSet):
queryset = SAMLProviderConfig.objects.current_set().order_by('id')
serializer_class = SAMLProviderConfigSerializer
authentication_classes = (OAuth2AuthenticationAllowInactiveUser,)
authentication_classes = (BearerAuthenticationAllowInactiveUser,)
permission_classes = (IsAuthenticated, AMCAdminPermission)
filterset_class = SAMLProviderConfigFilter

Expand Down

0 comments on commit 0582c6f

Please sign in to comment.