Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
8d4db4ac
Commit
8d4db4ac
authored
Jun 09, 2017
by
Clinton Blackburn
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Updated Course Structure API views to use JWT authentication
LEARNER-1375
parent
0b07b53e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
4 deletions
+5
-4
lms/djangoapps/course_structure_api/v0/views.py
+5
-4
No files found.
lms/djangoapps/course_structure_api/v0/views.py
View file @
8d4db4ac
...
...
@@ -4,14 +4,15 @@ import logging
from
django.conf
import
settings
from
django.http
import
Http404
from
edx_rest_framework_extensions.authentication
import
JwtAuthentication
from
opaque_keys.edx.keys
import
CourseKey
from
rest_framework.authentication
import
SessionAuthentication
from
rest_framework_oauth.authentication
import
OAuth2Authentication
from
rest_framework.exceptions
import
AuthenticationFailed
from
rest_framework.generics
import
RetrieveAPIView
,
ListAPIView
from
rest_framework.permissions
import
IsAuthenticated
from
rest_framework.response
import
Response
from
rest_framework_oauth.authentication
import
OAuth2Authentication
from
xmodule.modulestore.django
import
modulestore
from
opaque_keys.edx.keys
import
CourseKey
from
course_structure_api.v0
import
serializers
from
courseware
import
courses
...
...
@@ -20,7 +21,6 @@ from openedx.core.djangoapps.content.course_structures.api.v0 import api, errors
from
openedx.core.lib.exceptions
import
CourseNotFoundError
from
student.roles
import
CourseInstructorRole
,
CourseStaffRole
log
=
logging
.
getLogger
(
__name__
)
...
...
@@ -29,7 +29,7 @@ class CourseViewMixin(object):
Mixin for views dealing with course content. Also handles authorization and authentication.
"""
lookup_field
=
'course_id'
authentication_classes
=
(
OAuth2Authentication
,
SessionAuthentication
,)
authentication_classes
=
(
JwtAuthentication
,
OAuth2Authentication
,
SessionAuthentication
,)
permission_classes
=
(
IsAuthenticated
,)
def
get_course_or_404
(
self
):
...
...
@@ -55,6 +55,7 @@ class CourseViewMixin(object):
:param func: function to be wrapped
:returns: the wrapped function
"""
def
func_wrapper
(
self
,
*
args
,
**
kwargs
):
"""Wrapper function for this decorator.
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment