Skip to content

raise Http404 with error messages in the require_show_toolbar and fix… #955

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

Closed
wants to merge 1 commit into from

Conversation

glasslion
Copy link

@glasslion glasslion commented Jun 8, 2017

This PR provides an hint messages when raises 404 , and fix the outdated/misleading doc. See #954

…ed the outdated/misleading docs about the SHOW_TOOLBAR_CALLBACK configuration.
@codecov
Copy link

codecov bot commented Jun 8, 2017

Codecov Report

Merging #955 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #955   +/-   ##
=======================================
  Coverage   83.46%   83.46%           
=======================================
  Files          28       28           
  Lines        1578     1578           
  Branches      235      235           
=======================================
  Hits         1317     1317           
  Misses        192      192           
  Partials       69       69
Impacted Files Coverage Δ
debug_toolbar/decorators.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 88ddc7b...7638c10. Read the comment docs.

Copy link
Contributor

@jdufresne jdufresne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apologies for not updating the documentation.

Thoughts on also adding this as a backwards incompatibility note to the 1.8 release notes?

raise Http404(
'You do not have the permission to access debug-toolbar'
' urls. Please check your INTERNAL_IPS and'
' SHOW_TOOLBAR_CALLBACK configurations'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea behind raising a 404 instead of a 403 is that unprivileged users shouldn't even be aware of Django debug toolbar's existence. From the user's perspective, the resource "doesn't exist" instead of "the resource exists, but you aren't authorized to access it". This message looks to be leaking this information now. I think it shouldn't.

@jdufresne
Copy link
Contributor

@glasslion, I'm not sure if you're still working on this. I've proposed an alternative PR in #961. If you prefer to continue with this, I can close mine, no problem. If you want to reuse the wording I've added to the change log, also no problem.

@matthiask
Copy link
Member

Closing in favour of the merged #961.

@matthiask matthiask closed this Nov 13, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants