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
e58e295c
Commit
e58e295c
authored
Oct 27, 2016
by
jagonzalr
Committed by
Jose Antonio Gonzalez
Jun 09, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix valid signature
parent
6a244a3f
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
2 deletions
+6
-2
lms/djangoapps/verify_student/models.py
+3
-1
lms/djangoapps/verify_student/views.py
+3
-1
No files found.
lms/djangoapps/verify_student/models.py
View file @
e58e295c
...
@@ -885,8 +885,10 @@ class SoftwareSecurePhotoVerification(PhotoVerification):
...
@@ -885,8 +885,10 @@ class SoftwareSecurePhotoVerification(PhotoVerification):
"Content-Type"
:
"application/json"
,
"Content-Type"
:
"application/json"
,
"Date"
:
formatdate
(
timeval
=
None
,
localtime
=
False
,
usegmt
=
True
)
"Date"
:
formatdate
(
timeval
=
None
,
localtime
=
False
,
usegmt
=
True
)
}
}
body_for_signature
=
{
"EdX-ID"
:
str
(
self
.
receipt_id
)}
_message
,
_sig
,
authorization
=
generate_signed_message
(
_message
,
_sig
,
authorization
=
generate_signed_message
(
"POST"
,
headers
,
body
,
access_key
,
secret_key
"POST"
,
headers
,
body
_for_signature
,
access_key
,
secret_key
)
)
headers
[
'Authorization'
]
=
authorization
headers
[
'Authorization'
]
=
authorization
...
...
lms/djangoapps/verify_student/views.py
View file @
e58e295c
...
@@ -1109,13 +1109,15 @@ def results_callback(request):
...
@@ -1109,13 +1109,15 @@ def results_callback(request):
headers
=
{
headers
=
{
"Authorization"
:
request
.
META
.
get
(
"HTTP_AUTHORIZATION"
,
""
),
"Authorization"
:
request
.
META
.
get
(
"HTTP_AUTHORIZATION"
,
""
),
"Content-Type"
:
"application/json"
,
"Date"
:
request
.
META
.
get
(
"HTTP_DATE"
,
""
)
"Date"
:
request
.
META
.
get
(
"HTTP_DATE"
,
""
)
}
}
body_for_signature
=
{
"EdX-ID"
:
body_dict
.
get
(
"EdX-ID"
)}
has_valid_signature
(
has_valid_signature
(
"POST"
,
"POST"
,
headers
,
headers
,
body_
dict
,
body_
for_signature
,
settings
.
VERIFY_STUDENT
[
"SOFTWARE_SECURE"
][
"API_ACCESS_KEY"
],
settings
.
VERIFY_STUDENT
[
"SOFTWARE_SECURE"
][
"API_ACCESS_KEY"
],
settings
.
VERIFY_STUDENT
[
"SOFTWARE_SECURE"
][
"API_SECRET_KEY"
]
settings
.
VERIFY_STUDENT
[
"SOFTWARE_SECURE"
][
"API_SECRET_KEY"
]
)
)
...
...
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