[go: up one dir, main page]

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

Use pyramid.csrf independent API #230

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Use pyramid.csrf independent API #230

wants to merge 4 commits into from

Conversation

slav0nic
Copy link
Contributor
@slav0nic slav0nic commented Jun 26, 2019

re #211

  • remove CSRF related code from session
  • use default get_csrf_token() function in templates
  • update CSRF validator for deform2
  • use token functions directly (request.session.* -> pyramid.csrf.*)
  • default CSRF policy is SessionCSRFStoragePolicy (store token in session)
  • update tests
  • update docs

It's break some request.session.get_csrf_token() calls, now you must use standard get_csrf_token() (that available in templates too). About backward compability - i don't think that it really needed, websauna is still in alfa and upgrading to new API is trivial task.

TODO: update websauna.magiclogin, blog and check other apps.

* remove CSRF related code from session
* use default get_csrf_token() function in templates
* update CSRF validator for deform2
* use token functions directly (request.session.* -> pyramid.csrf.*)
By default Pyramid 1.10 still use `LegacySessionCSRFStoragePolicy`
@codecov-io
Copy link
codecov-io commented Jun 26, 2019

Codecov Report

Merging #230 into master will decrease coverage by 0.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #230      +/-   ##
==========================================
- Coverage   78.64%   78.63%   -0.02%     
==========================================
  Files         133      133              
  Lines        5803     5800       -3     
  Branches      627      626       -1     
==========================================
- Hits         4564     4561       -3     
  Misses        997      997              
  Partials      242      242
Impacted Files Coverage Δ
websauna/system/core/session.py 89.77% <ø> (-0.66%) ⬇️
websauna/system/form/csrf.py 100% <100%> (ø) ⬆️
websauna/system/__init__.py 88.75% <100%> (+0.05%) ⬆️
websauna/system/core/views/badcsrftoken.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 b7b5525...efc21a1. Read the comment docs.

@slav0nic slav0nic marked this pull request as ready for review June 26, 2019 18:18
@codecov-commenter
Copy link

Codecov Report

Merging #230 into master will decrease coverage by 0.01%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #230      +/-   ##
==========================================
- Coverage   78.64%   78.63%   -0.02%     
==========================================
  Files         133      133              
  Lines        5803     5800       -3     
  Branches      627      626       -1     
==========================================
- Hits         4564     4561       -3     
  Misses        997      997              
  Partials      242      242              
Impacted Files Coverage Δ
websauna/system/core/session.py 89.77% <ø> (-0.66%) ⬇️
websauna/system/__init__.py 88.75% <100.00%> (+0.05%) ⬆️
websauna/system/core/views/badcsrftoken.py 100.00% <100.00%> (ø)
websauna/system/form/csrf.py 100.00% <100.00%> (ø)

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 af56e8a...efc21a1. Read the comment docs.

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