-
Notifications
You must be signed in to change notification settings - Fork 81
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to use no_logging
on admin login view
#123
Comments
no_logging
on admin login viewno_logging
on admin login view
Good point, I was wondering how to manage this scenario. Another idea would be to filter out not only some headers but specific fields from the body. |
body level filtering would be amazing as well, although I don't know how easy that is to implement when you have only the raw request body |
Hi,
It still loggs: b'{"username":"user","password":"123"}' |
Hi, We've encountered logging credentials in plaintext in case POST request failed on
This way the actual password is replaced with I like the skipping routes option as this would allow any admin to skip sensitive routes completely instead of relying on the devs of the app to apply patch on those routes in code. They might be very reluctant to do that since it would introduce this middleware as new dependency. This is our case - this middleware is deployed through config on our side, not by the devs of the app. |
I'm trying to avoid logging the
login
request for the default django admin site, since it contains a password in the request body. Is there a way to apply theno_logging
decorator to an arbitrary view?I tried manually setting the
NO_LOGGING_ATTR
ondjango.contrib.admin.sites.login
(source) which is passed as the view/func to_should_log_route
like so:but this fails with
AttributeError: 'method' object has no attribute 'no_logging'
Given how invasive this kind of patch is in general, I'm not sure I'd be happy even if I could get it to work...
So, I was wondering if you would be open to a new setting like
REQUEST_LOGGING_SKIP_ROUTES
which would contain a list of routes like['/admin/login/', '/api/sensitive/']
, which could be checked in_should_log_route
in addition to the NO_LOGGING_ATTR. I feel this would be useful in general for controlling how logging is done for third party views/appsThe text was updated successfully, but these errors were encountered: