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
b50e004b
Commit
b50e004b
authored
Mar 16, 2015
by
Stephen Sanchez
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #7375 from edx/sanchez/update_aws_settings_for_ecommerce
Add E-Commerce settings to AWS settings.
parents
b3354dda
f552df33
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
4 deletions
+8
-4
lms/djangoapps/commerce/views.py
+3
-4
lms/envs/aws.py
+5
-0
No files found.
lms/djangoapps/commerce/views.py
View file @
b50e004b
...
...
@@ -54,17 +54,16 @@ class OrdersView(APIView):
return
True
,
course_key
,
None
def
_get_jwt
(
self
,
user
):
def
_get_jwt
(
self
,
user
,
ecommerce_api_signing_key
):
"""
Returns a JWT object with the specified user's info.
Raises AttributeError if settings.ECOMMERCE_API_SIGNING_KEY is not set.
"""
data
=
{
'username'
:
user
.
username
,
'email'
:
user
.
email
}
return
jwt
.
encode
(
data
,
getattr
(
settings
,
'ECOMMERCE_API_SIGNING_KEY'
)
)
return
jwt
.
encode
(
data
,
ecommerce_api_signing_key
)
def
_enroll
(
self
,
course_key
,
user
):
""" Enroll the user in the course. """
...
...
@@ -109,7 +108,7 @@ class OrdersView(APIView):
# Contact external API
headers
=
{
'Content-Type'
:
'application/json'
,
'Authorization'
:
'JWT {}'
.
format
(
self
.
_get_jwt
(
user
))
'Authorization'
:
'JWT {}'
.
format
(
self
.
_get_jwt
(
user
,
ecommerce_api_signing_key
))
}
url
=
'{}/orders/'
.
format
(
ecommerce_api_url
.
strip
(
'/'
))
...
...
lms/envs/aws.py
View file @
b50e004b
...
...
@@ -558,3 +558,8 @@ XBLOCK_SETTINGS = ENV_TOKENS.get('XBLOCK_SETTINGS', {})
##### CDN EXPERIMENT/MONITORING FLAGS #####
PERFORMANCE_GRAPHITE_URL
=
ENV_TOKENS
.
get
(
'PERFORMANCE_GRAPHITE_URL'
,
PERFORMANCE_GRAPHITE_URL
)
CDN_VIDEO_URLS
=
ENV_TOKENS
.
get
(
'CDN_VIDEO_URLS'
,
CDN_VIDEO_URLS
)
##### ECOMMERCE API CONFIGURATION SETTINGS #####
ECOMMERCE_API_URL
=
ENV_TOKENS
.
get
(
'ECOMMERCE_API_URL'
,
ECOMMERCE_API_URL
)
ECOMMERCE_API_SIGNING_KEY
=
AUTH_TOKENS
.
get
(
'ECOMMERCE_API_SIGNING_KEY'
,
ECOMMERCE_API_SIGNING_KEY
)
ECOMMERCE_API_TIMEOUT
=
ENV_TOKENS
.
get
(
'ECOMMERCE_API_TIMEOUT'
,
ECOMMERCE_API_TIMEOUT
)
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