Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
edx-platform-release
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
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
0fb8a7b1
Commit
0fb8a7b1
authored
12 years ago
by
Piotr Mitros
Browse files
Options
Downloads
Patches
Plain Diff
Middleware password fix. Needs Cale's cleanup
parent
50a362a2
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
common/djangoapps/track/middleware.py
+26
-2
26 additions, 2 deletions
common/djangoapps/track/middleware.py
with
26 additions
and
2 deletions
common/djangoapps/track/middleware.py
+
26
−
2
View file @
0fb8a7b1
...
...
@@ -12,8 +12,32 @@ class TrackMiddleware:
if
request
.
META
[
'
PATH_INFO
'
]
in
[
'
/event
'
,
'
/login
'
]:
return
event
=
{
'
GET
'
:
dict
(
request
.
GET
),
'
POST
'
:
dict
(
request
.
POST
)}
# Removes passwords from the tracking logs
# WARNING: This list needs to be changed whenever we change
# password handling functionality.
#
# As of the time of this comment, only 'password' is used
# The rest are there for future extension.
#
# Passwords should never be sent as GET requests, but
# this can happen due to older browser bugs. We censor
# this too.
#
# We should manually confirm no passwords make it into log
# files when we change this.
censored_strings
=
[
'
password
'
,
'
newpassword
'
,
'
new_password
'
,
'
oldpassword
'
,
'
old_password
'
]
post_dict
=
dict
(
request
.
POST
)
get_dict
=
dict
(
request
.
GET
)
for
string
in
censored_strings
:
if
string
in
post_dict
:
post_dict
[
string
]
=
'
*
'
*
8
if
string
in
get_dict
:
get_dict
[
string
]
=
'
*
'
*
8
event
=
{
'
GET
'
:
dict
(
get_dict
),
'
POST
'
:
dict
(
post_dict
)}
# TODO: Confirm no large file uploads
event
=
json
.
dumps
(
event
)
...
...
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