#33090: Extend sensitive post parameter filtering to be applicable to
exceptions in
middleware.
-------------------------------------+-------------------------------------
Reporter: Carlton Gibson | Owner:
| Oluwayemisi Ismail
Type: New feature | Status: assigned
Component: Error reporting | Version: dev
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by voidus):
My current workaround, because I ran into this and cannot face my users
without fixing it today:
in settings.py:
{{{
MIDDLEWARE = [
...,
"my.package.middleware.ensurePasswordIsntInErrorMailMiddleware",
"django.middleware.csrf.CsrfViewMiddleware",
...
]
}}}
in my/package/middleware.py:
{{{
def ensurePasswordIsntInErrorMailMiddleware(get_response):
def middleware(request):
request.sensitive_post_parameters = ["password"]
return get_response(request)
return middleware
}}}
Basically setting it as a default, in case we don't get to the next point
where it would be set.
The django code always runs:
{{{
request.sensitive_post_parameters = parameters
}}}
So the setting from this middleware will be overridden the next time the
decorator is hit.
--
Ticket URL: <https://code.djangoproject.com/ticket/33090#comment:12>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/0107018bb61869e8-45e3ed8b-007f-4753-8530-9606ec4f844b-000000%40eu-central-1.amazonses.com.