Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
1
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hsin-Yu Chien
edx-platform-release
Commits
dcb6bbc2
Commit
dcb6bbc2
authored
4 years ago
by
Carla Duarte
Browse files
Options
Downloads
Patches
Plain Diff
AA-664: add JwtAuthentication to course home api
parent
f02d16ec
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lms/djangoapps/course_home_api/course_metadata/v1/views.py
+10
-0
10 additions, 0 deletions
lms/djangoapps/course_home_api/course_metadata/v1/views.py
lms/djangoapps/course_home_api/outline/v1/views.py
+7
-0
7 additions, 0 deletions
lms/djangoapps/course_home_api/outline/v1/views.py
with
17 additions
and
0 deletions
lms/djangoapps/course_home_api/course_metadata/v1/views.py
+
10
−
0
View file @
dcb6bbc2
...
...
@@ -7,6 +7,10 @@ from rest_framework.response import Response
from
opaque_keys.edx.keys
import
CourseKey
from
edx_rest_framework_extensions.auth.jwt.authentication
import
JwtAuthentication
from
edx_rest_framework_extensions.auth.session.authentication
import
SessionAuthenticationAllowInactiveUser
from
openedx.core.lib.api.authentication
import
BearerAuthenticationAllowInactiveUser
from
common.djangoapps.student.models
import
CourseEnrollment
from
lms.djangoapps.courseware.access
import
has_access
from
lms.djangoapps.courseware.masquerade
import
setup_masquerade
...
...
@@ -50,6 +54,12 @@ class CourseHomeMetadataView(RetrieveAPIView):
* 404 if the course is not available or cannot be seen.
"""
authentication_classes
=
(
JwtAuthentication
,
BearerAuthenticationAllowInactiveUser
,
SessionAuthenticationAllowInactiveUser
,
)
serializer_class
=
CourseHomeMetadataSerializer
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
...
...
This diff is collapsed.
Click to expand it.
lms/djangoapps/course_home_api/outline/v1/views.py
+
7
−
0
View file @
dcb6bbc2
...
...
@@ -30,6 +30,7 @@ from lms.djangoapps.courseware.courses import get_course_date_blocks, get_course
from
lms.djangoapps.courseware.date_summary
import
TodaysDate
from
lms.djangoapps.courseware.masquerade
import
setup_masquerade
from
openedx.core.djangoapps.content.course_overviews.models
import
CourseOverview
from
openedx.core.lib.api.authentication
import
BearerAuthenticationAllowInactiveUser
from
openedx.features.course_duration_limits.access
import
get_access_expiration_data
from
openedx.features.course_experience
import
COURSE_ENABLE_UNENROLLED_ACCESS_FLAG
from
openedx.features.course_experience.course_tools
import
CourseToolsPluginManager
...
...
@@ -138,6 +139,12 @@ class OutlineTabView(RetrieveAPIView):
"""
authentication_classes
=
(
JwtAuthentication
,
BearerAuthenticationAllowInactiveUser
,
SessionAuthenticationAllowInactiveUser
,
)
serializer_class
=
OutlineTabSerializer
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment