From b2ee16478c489f3650a7a23b927b424da7453810 Mon Sep 17 00:00:00 2001 From: Rodrigo Ferreira de Souza Date: Tue, 1 Mar 2016 18:15:34 -0300 Subject: [PATCH 1/3] Implement CSRF protection --- CHANGES.rst | 4 ++++ buildout.cfg | 3 +++ src/collective/cover/browser/templates/compose.pt | 1 + .../cover/browser/templates/layoutedit.pt | 2 +- src/collective/cover/static/js/compose.js | 4 ++++ src/collective/cover/static/js/contentchooser.js | 13 +++++++++++++ .../cover/static/js/galleria.cover_theme.js | 2 ++ src/collective/cover/static/js/layout_base.js | 2 ++ src/collective/cover/static/js/layout_edit.js | 8 +++++++- src/collective/cover/testing.py | 3 +++ src/collective/cover/tests/cover.robot | 8 +++++++- src/collective/cover/tests/test_banner_tile.robot | 1 + src/collective/cover/tests/test_basic_tile.robot | 1 + src/collective/cover/tests/test_carousel_tile.robot | 1 + .../cover/tests/test_collection_tile.robot | 1 + .../cover/tests/test_contentbody_tile.robot | 3 +++ .../cover/tests/test_contentchooser.robot | 4 +++- src/collective/cover/tests/test_cover.robot | 2 ++ src/collective/cover/tests/test_css_class.robot | 1 + .../tests/test_drag_and_drop_among_tiles.robot | 1 + src/collective/cover/tests/test_embed_tile.robot | 1 + src/collective/cover/tests/test_file_tile.robot | 1 + src/collective/cover/tests/test_layout.robot | 1 + src/collective/cover/tests/test_list_tile.robot | 1 + src/collective/cover/tests/test_locked_cover.robot | 2 ++ src/collective/cover/tests/test_reverse_proxy.robot | 1 + src/collective/cover/tests/test_richtext_tile.robot | 1 + .../cover/tests/test_searchabletext_indexer.robot | 3 +++ versions-4.2.x.cfg | 6 ++++++ versions-4.3.x.cfg | 6 ++++++ 30 files changed, 84 insertions(+), 4 deletions(-) diff --git a/CHANGES.rst b/CHANGES.rst index 8b84e3e64..5b3c5e87d 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -6,6 +6,9 @@ There's a frood who really knows where his towel is. 1.1b2 (unreleased) ^^^^^^^^^^^^^^^^^^ +- Implement CSRF protection (closes `#590`_). + [rodfersou] + - Handle `AssertionError` on upgrade step to profile 13 to avoid failures when a cover object has duplicated tiles on it. Now, an error message will be logged and the object will be skipped; you must manually remove the duplicated tiles (closes #619). @@ -86,4 +89,5 @@ Previous entries can be found in the HISTORY.rst file. .. _`#578`: https://github.com/collective/collective.cover/issues/578 .. _`#581`: https://github.com/collective/collective.cover/issues/581 .. _`#584`: https://github.com/collective/collective.cover/issues/584 +.. _`#590`: https://github.com/collective/collective.cover/issues/590 .. _`#608`: https://github.com/collective/collective.cover/issues/608 diff --git a/buildout.cfg b/buildout.cfg index d67217f97..f9a787a39 100644 --- a/buildout.cfg +++ b/buildout.cfg @@ -18,6 +18,9 @@ parts += rebuild_i18n-sh robot +test-eggs += + plone4.csrffixes + [checkversions] recipe = zc.recipe.egg eggs = z3c.checkversions [buildout] diff --git a/src/collective/cover/browser/templates/compose.pt b/src/collective/cover/browser/templates/compose.pt index 22e8a999f..ee7814033 100644 --- a/src/collective/cover/browser/templates/compose.pt +++ b/src/collective/cover/browser/templates/compose.pt @@ -34,6 +34,7 @@ tal:replace="structure layout/render_compose" />
+
diff --git a/src/collective/cover/browser/templates/layoutedit.pt b/src/collective/cover/browser/templates/layoutedit.pt index 11cf53cac..57ca0ac39 100644 --- a/src/collective/cover/browser/templates/layoutedit.pt +++ b/src/collective/cover/browser/templates/layoutedit.pt @@ -69,7 +69,7 @@