Skip to content
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

Respect exempts in CSRFProtect.protect() #419

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

rauchy
Copy link

@rauchy rauchy commented Aug 16, 2020

The default csrf_protect method provides default behavior which might be suited for typical use cases, but as stated in the docs, custom scenarios should be handled by the protect method.

However, if custom scenarios only vary by the condition when to check the request, it's a shame to have to implement the exemption list outside this package.

@arikfr
Copy link

arikfr commented Aug 17, 2020

Looks like the docs build fails because https://wtforms.readthedocs.io/en/latest/objects.inv returns 404. But the actual tests pass.

@codecov-commenter
Copy link

codecov-commenter commented Aug 24, 2020

Codecov Report

Merging #419 into master will decrease coverage by 5.46%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #419      +/-   ##
==========================================
- Coverage   97.97%   92.50%   -5.47%     
==========================================
  Files          18       18              
  Lines         936      907      -29     
  Branches       73       74       +1     
==========================================
- Hits          917      839      -78     
- Misses         17       66      +49     
  Partials        2        2              
Impacted Files Coverage Δ
flask_wtf/csrf.py 98.08% <100.00%> (-0.03%) ⬇️
tests/test_csrf_extension.py 100.00% <100.00%> (ø)
flask_wtf/i18n.py 3.57% <0.00%> (-96.43%) ⬇️
tests/test_i18n.py 53.19% <0.00%> (-46.81%) ⬇️
tests/test_file.py 80.64% <0.00%> (-0.31%) ⬇️
flask_wtf/form.py 100.00% <0.00%> (ø)
tests/conftest.py 100.00% <0.00%> (ø)
tests/test_form.py 100.00% <0.00%> (ø)
tests/test_csrf_form.py 100.00% <0.00%> (ø)
... and 2 more

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 083b7e0...722428e. Read the comment docs.

@azmeuk azmeuk added the csrf label Jul 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

4 participants