-
Notifications
You must be signed in to change notification settings - Fork 55
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
Issue 590 - Implement CSRF protection #594
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,6 +18,9 @@ parts += | |
rebuild_i18n-sh | ||
robot | ||
|
||
test-eggs += | ||
plone4.csrffixes | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hvelarde should I run this just in 4.3 version? If so, I need to figure out when CSRF is enabled into RF test. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rodfersou no, we have to test this in all Plone versions supported by the package; figuring out how is the hard part. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ok, then I'll replicate the pins into all versions 4.x files |
||
[checkversions] | ||
recipe = zc.recipe.egg | ||
eggs = z3c.checkversions [buildout] | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -136,6 +136,9 @@ def setUpZope(self, app, configurationContext): | |
self.loadZCML(package=Products.PloneFormGen) | ||
z2.installProduct(app, 'Products.PloneFormGen') | ||
|
||
import plone4.csrffixes | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rodfersou we can't install this under Plone 5 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @hvelarde did you see the |
||
self.loadZCML(package=plone4.csrffixes) | ||
|
||
import collective.cover | ||
self.loadZCML(package=collective.cover) | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ ${column_drop_area_selector} = div.cover-row | |
${tile_drop_area_selector} = div.cover-column | ||
${tile_cancel_area_selector} = div.modal-backdrop | ||
${delete_tile_selector} = button.close | ||
${confirm_action_selector} = input.standalone | ||
${CONTENT_CHOOSER_SELECTOR} = div#contentchooser-content-search | ||
|
||
*** Keywords *** | ||
|
@@ -37,9 +38,25 @@ Start Browser and Log In as Site Owner | |
Log In As Site Owner | ||
Click Link link=Home | ||
|
||
# BBB: This needs to be customized to handle both Plone 4.2 and 4.3. | ||
# In Plone 4.2, we still have the confirm action button that it's gone in 4.3. | ||
# Customized from | ||
# https://github.com/plone/plone.app.robotframework/blob/9ab289c5b93c2aa1acb6078b955694ad458d9c3b/src/plone/app/robotframework/keywords.robot#L53 | ||
Go to homepage | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rodfersou add information on what are you doing here and why |
||
|
||
# Both. | ||
Go to ${PLONE_URL} | ||
|
||
# Plone 4.2. | ||
Run keyword if '${CMFPLONE_VERSION}' < '4.3' Wait Until Page Contains Element css=${confirm_action_selector} | ||
Run keyword if '${CMFPLONE_VERSION}' < '4.3' Click Element css=${confirm_action_selector} | ||
Run keyword if '${CMFPLONE_VERSION}' < '4.3' Page Should Contain Plone site | ||
|
||
# Plone >= 4.3. | ||
Run keyword if '${CMFPLONE_VERSION}' >= '4.3' Wait until location is ${PLONE_URL} | ||
|
||
Setup Cover Test Case | ||
Start Browser and Log In as Site Owner | ||
Go to Homepage | ||
|
||
Click Add Cover | ||
Open Add New Menu | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,6 +27,7 @@ Test Banner Tile | |
# XXX: test is randomly failing under Plone 4.2 only | ||
Run keyword if '${CMFPLONE_VERSION}' >= '4.3' Remove Tags Mandelbug | ||
|
||
Set Library Search Order cover | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @rodfersou document this keyword all over the place |
||
Enable Autologin as Site Administrator | ||
Go to Homepage | ||
Create Cover Title Description | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rodfersou this should be added on a version basis also or we will end with the package installed in Plone 5