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

4.3.x csrffixes partial #176

Closed
wants to merge 10 commits into from
Closed

4.3.x csrffixes partial #176

wants to merge 10 commits into from

Conversation

mauritsvanrees
Copy link
Member

This leans heavily on pull request #150.

Difference is that I keep plone.protect to the 2.x series and do not include plone4.csrffixes.

I include a branch of plone.protect with minimal forward compatibility so you can import IDisableCSRFProtection (which has no effect, but at least gives no ImportError) and can use @@authenticator/token. See https://github.com/plone/plone.protect/tree/2.x-forward-compat

Basically the idea is: move the patches from plone4.csrffixes into their correct places, which is what we normally do with hotfixes.
If someone wants csrf protection, then adding plone.protect 3.x to a buildout should be enough, without needing extra packages or pins.

If we want to, this can be a stepping stone for #150. That pull request suffers from too many test failures at the moment, which makes it hard to go forward.

And it is not just test setup problems, but 'live' ones: create a Plone Site, go to @@markup-controlpanel, and you get the confirmation page with the csrf warning. This is because an annotation for wicked is initialised on first load. This is a write-on-read that should be fixed (or grudgingly accepted). Whether we use the csrf protection from the newer plone.protect or not, does not really matter for this: this protection simply makes it clearer that there is a write-on-read problem.

@mauritsvanrees
Copy link
Member Author

@mauritsvanrees
Copy link
Member Author

BTW, I am wondering if we need to do something with protect.js from plone4.csrffixes. With the above changes, this should be the only thing from that package that is not merged.

@mauritsvanrees mauritsvanrees mentioned this pull request Feb 13, 2016
4 tasks
@gforcada
Copy link
Member

@mauritsvanrees you are testing this pull request against plone 5.0, while it should be 4.3! :-)

@mauritsvanrees
Copy link
Member Author

Haha, good catch. :-)

@mauritsvanrees mauritsvanrees force-pushed the 4.3.x-csrffixes-partial branch 2 times, most recently from f43fbab to a69ef37 Compare February 15, 2016 07:32
@mauritsvanrees
Copy link
Member Author

@mauritsvanrees
Copy link
Member Author

Getting HTTP Error 400: Bad Request in a plone.app.users test that goes fine locally... I tried one fix but this did not help.

@gforcada
Copy link
Member

@mauritsvanrees no idea about the 400 error, but given that you are working on branches, just put debug information on the test to see which URL and content is there? that could help

jensens and others added 9 commits February 21, 2016 19:00
- Prodcts.PlonePAS:
  - as of 5.0.5 it also integrates Plone Hotfix 2015-12-08.
  - as of 5.0.6 it adds back Python 2.6 support (for Plone 4.3)
- plone.namedfile
Latest master has a fix needed to read the setup.py on Python 2.6.
This does not depend on plone4.csrffixes, so does not get plone.protect 3.x.
That should give us more info about a failing test.
@mauritsvanrees mauritsvanrees force-pushed the 4.3.x-csrffixes-partial branch from c684e9c to 5442c0a Compare February 21, 2016 18:11
@mauritsvanrees
Copy link
Member Author

Ha, this now works. Looks ready for merge. Well, not this coredev branch: the individual package branches should be merged.

So to summarise what we would change here:

@gforcada
Copy link
Member

@mauritsvanrees cool! thanks a lot for you effort on this!

@esteele
Copy link
Member

esteele commented Feb 23, 2016

Merged.

@esteele esteele closed this Feb 23, 2016
@jensens jensens deleted the 4.3.x-csrffixes-partial branch February 26, 2016 11:25
mauritsvanrees referenced this pull request in plone/Products.CMFPlone Mar 3, 2016
@idgserpro
Copy link

idgserpro commented May 11, 2016

@mauritsvanrees Guys, I think we have an interesting issue here.

plone4.csrffixes: The package aims to backport the auto CSRF implementation from Plone 5 to Plone 4.

In protect.js, we don't actually have just backports but a feature of automatically setting a token in xhr, which we don't have in plone.protect 3.x branch (we have just a README note about how to do it, not an implementation per se).

So, with packages that need to be Plone 4 and 5 compatible, when using Plone 4 and plone4.csrffixes for ajax requests everything is fine, but when using Plone 5 we need to manually do this with two approaches:

  • Adding _authenticator variables across all or ajax calls, getting it's value from an input in a form;
  • Copy protect.js from plone4.csrffixes.

Our question is: will this implementation be added to plone.protect, or do we need to manually add to our packages? Are we missing something here?

@mauritsvanrees
Copy link
Member Author

See plone/plone.protect#42 where we can discuss this last question.

mister-roboto pushed a commit that referenced this pull request Oct 1, 2018
Branch: refs/heads/master
Date: 2018-10-01T17:43:15+02:00
Author: Peter Mathis (petschki) <peter.mathis@kombinat.at>
Commit: plone/plone.app.upgrade@e0a48eb

testfixes for plone 5.2 and python 3

Files changed:
M plone/app/upgrade/tests/test_upgrade.py
M plone/app/upgrade/v41/alphas.py
M plone/app/upgrade/v41/final.py
M plone/app/upgrade/v43/alphas.py
M plone/app/upgrade/v50/alphas.py
M plone/app/upgrade/v50/betas.py
Repository: plone.app.upgrade

Branch: refs/heads/master
Date: 2018-10-01T17:50:44+02:00
Author: Peter Mathis (petschki) <peter.mathis@kombinat.at>
Commit: plone/plone.app.upgrade@ba85502

add changelog

Files changed:
A news/176.bugfix
Repository: plone.app.upgrade

Branch: refs/heads/master
Date: 2018-10-01T18:57:05+02:00
Author: Peter Mathis (petschki) <petschki@users.noreply.github.com>
Commit: plone/plone.app.upgrade@d94d545

Merge pull request #176 from plone/python3-testfixes

testfixes for plone 5.2 and python 3

Files changed:
A news/176.bugfix
M plone/app/upgrade/tests/test_upgrade.py
M plone/app/upgrade/v41/alphas.py
M plone/app/upgrade/v41/final.py
M plone/app/upgrade/v43/alphas.py
M plone/app/upgrade/v50/alphas.py
M plone/app/upgrade/v50/betas.py
mister-roboto pushed a commit that referenced this pull request Oct 1, 2018
Branch: refs/heads/master
Date: 2018-10-01T17:43:15+02:00
Author: Peter Mathis (petschki) <peter.mathis@kombinat.at>
Commit: plone/plone.app.upgrade@e0a48eb

testfixes for plone 5.2 and python 3

Files changed:
M plone/app/upgrade/tests/test_upgrade.py
M plone/app/upgrade/v41/alphas.py
M plone/app/upgrade/v41/final.py
M plone/app/upgrade/v43/alphas.py
M plone/app/upgrade/v50/alphas.py
M plone/app/upgrade/v50/betas.py
Repository: plone.app.upgrade

Branch: refs/heads/master
Date: 2018-10-01T17:50:44+02:00
Author: Peter Mathis (petschki) <peter.mathis@kombinat.at>
Commit: plone/plone.app.upgrade@ba85502

add changelog

Files changed:
A news/176.bugfix
Repository: plone.app.upgrade

Branch: refs/heads/master
Date: 2018-10-01T18:57:05+02:00
Author: Peter Mathis (petschki) <petschki@users.noreply.github.com>
Commit: plone/plone.app.upgrade@d94d545

Merge pull request #176 from plone/python3-testfixes

testfixes for plone 5.2 and python 3

Files changed:
A news/176.bugfix
M plone/app/upgrade/tests/test_upgrade.py
M plone/app/upgrade/v41/alphas.py
M plone/app/upgrade/v41/final.py
M plone/app/upgrade/v43/alphas.py
M plone/app/upgrade/v50/alphas.py
M plone/app/upgrade/v50/betas.py
mister-roboto pushed a commit that referenced this pull request Oct 1, 2018
Branch: refs/heads/master
Date: 2018-10-01T17:43:15+02:00
Author: Peter Mathis (petschki) <peter.mathis@kombinat.at>
Commit: plone/plone.app.upgrade@e0a48eb

testfixes for plone 5.2 and python 3

Files changed:
M plone/app/upgrade/tests/test_upgrade.py
M plone/app/upgrade/v41/alphas.py
M plone/app/upgrade/v41/final.py
M plone/app/upgrade/v43/alphas.py
M plone/app/upgrade/v50/alphas.py
M plone/app/upgrade/v50/betas.py
Repository: plone.app.upgrade

Branch: refs/heads/master
Date: 2018-10-01T17:50:44+02:00
Author: Peter Mathis (petschki) <peter.mathis@kombinat.at>
Commit: plone/plone.app.upgrade@ba85502

add changelog

Files changed:
A news/176.bugfix
Repository: plone.app.upgrade

Branch: refs/heads/master
Date: 2018-10-01T18:57:05+02:00
Author: Peter Mathis (petschki) <petschki@users.noreply.github.com>
Commit: plone/plone.app.upgrade@d94d545

Merge pull request #176 from plone/python3-testfixes

testfixes for plone 5.2 and python 3

Files changed:
A news/176.bugfix
M plone/app/upgrade/tests/test_upgrade.py
M plone/app/upgrade/v41/alphas.py
M plone/app/upgrade/v41/final.py
M plone/app/upgrade/v43/alphas.py
M plone/app/upgrade/v50/alphas.py
M plone/app/upgrade/v50/betas.py
mister-roboto pushed a commit that referenced this pull request Feb 4, 2019
Branch: refs/heads/master
Date: 2019-02-04T14:26:48+01:00
Author: Peter Mathis (petschki) <peter.mathis@kombinat.at>
Commit: plone/plone.app.layout@2438142

fix for python3

Files changed:
M plone/app/layout/globals/layout.py
Repository: plone.app.layout

Branch: refs/heads/master
Date: 2019-02-04T14:29:46+01:00
Author: Peter Mathis (petschki) <peter.mathis@kombinat.at>
Commit: plone/plone.app.layout@5944dd8

update changelog

Files changed:
M CHANGES.rst
Repository: plone.app.layout

Branch: refs/heads/master
Date: 2019-02-04T17:09:53+01:00
Author: Peter Mathis (petschki) <petschki@users.noreply.github.com>
Commit: plone/plone.app.layout@3c9a77d

Merge pull request #176 from plone/py3-fix

fix python3 compatibility

Files changed:
M CHANGES.rst
M plone/app/layout/globals/layout.py
mister-roboto pushed a commit that referenced this pull request Aug 17, 2021
Branch: refs/heads/master
Date: 2021-08-17T08:09:38+02:00
Author: Michael Howitz (icemac) <mh@gocept.com>
Commit: plone/plone.recipe.zope2instance@3c2a720

Fix resource warning.

Fixes #176

Files changed:
M src/plone/recipe/zope2instance/tests/wsgi.rst
Repository: plone.recipe.zope2instance

Branch: refs/heads/master
Date: 2021-08-17T11:35:48+02:00
Author: Maurits van Rees (mauritsvanrees) <m.van.rees@zestsoftware.nl>
Commit: plone/plone.recipe.zope2instance@58b4e1e

Merge pull request #178 from plone/fix-176

Fix resource warning.

Files changed:
M src/plone/recipe/zope2instance/tests/wsgi.rst
mister-roboto pushed a commit that referenced this pull request Aug 17, 2021
Branch: refs/heads/master
Date: 2021-08-17T08:09:38+02:00
Author: Michael Howitz (icemac) <mh@gocept.com>
Commit: plone/plone.recipe.zope2instance@3c2a720

Fix resource warning.

Fixes #176

Files changed:
M src/plone/recipe/zope2instance/tests/wsgi.rst
Repository: plone.recipe.zope2instance

Branch: refs/heads/master
Date: 2021-08-17T11:35:48+02:00
Author: Maurits van Rees (mauritsvanrees) <m.van.rees@zestsoftware.nl>
Commit: plone/plone.recipe.zope2instance@58b4e1e

Merge pull request #178 from plone/fix-176

Fix resource warning.

Files changed:
M src/plone/recipe/zope2instance/tests/wsgi.rst
mister-roboto pushed a commit that referenced this pull request Nov 13, 2021
Branch: refs/heads/master
Date: 2021-11-11T09:04:20+01:00
Author: Alessandro Pisa (ale-rt) <alessandro.pisa@gmail.com>
Commit: plone/plone.staticresources@fe42e1e

Fix typo

Closes #176

Files changed:
M src/plone/staticresources/static/components/tinymce-builded/js/tinymce/langs/it.js
Repository: plone.staticresources

Branch: refs/heads/master
Date: 2021-11-13T18:48:39+01:00
Author: Maurits van Rees (mauritsvanrees) <m.van.rees@zestsoftware.nl>
Commit: plone/plone.staticresources@139e097

Merge pull request #177 from plone/ale-rt-patch-1

Fix typo

Files changed:
M src/plone/staticresources/static/components/tinymce-builded/js/tinymce/langs/it.js
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants