Closed (fixed)
Project:
Protected Node
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
9 Aug 2015 at 06:45 UTC
Updated:
26 Aug 2015 at 20:44 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
digitgopher commentedI'm attaching a patch to get things started here.
I propose that Protected node should have its own flood event name, but we should use the user_failed_login_ip_window and user_failed_login_ip_limit variables for integration with site wide configs.
Shouldn't need to clear the events since access is saved in a session.
Comment #3
grimreaperHello digitgopher,
Very good idea, thank you.
I have reviewed and tested your patch. It works but before I merge it I think there is still some work to be done.
And again thank you for your effort.
Comment #4
digitgopher commentedThank you Grimreaper.
I added a Flood control configuration fieldset. I looked at the Flood Control module for inspiration for the interface.
I don't think this feature should be opt-in at this point, for a number of reasons - 1) this is a security issue, 2) there is the option to disable it by setting the window to zero, and 3) I don't see how this feature would cause issues on existing sites. If you think this is a problem, or there are errors in my thinking, please let me know. And explain a little more because I don't know why we would need a hook_update_n.
As an aside, why does the testbot sometimes not want to run?
Comment #6
grimreaperThanks, this is merged now.
As you can disable it by putting the variable to 0. Ok no problem. I don't know which possible side effect.
About the testbot, I don't know. Maybe, it is configured to prioritize D8 tests and when there are events with sprints for D8, there is no more resources for D7 tests. It is purely a supposition.
Comment #8
grimreaperAh, it seems that I was not the only one not able to apply your patch with git apply.
Anyway, this issue is fixed.
Comment #9
digitgopher commentedDocumentation updated. https://www.drupal.org/node/2176645.
Strange, I thought 1.patch was bad and 4.patch was good. Sorry about that anyway.
Comment #10
grimreaperThanks for the documentation update.
I was wondering, maybe it is not very valuable to maintain it and maybe a documentation directly in the UI (#description for forms, help texts) is better. That's just an idea.
Do you make your patch using the command line?
Comment #11
digitgopher commentedYou're right, ideally the code is self-documenting, and we can keep the documentation pages as lean as possible. But right now it is nice how thorough the documentation pages are.
Yes, I do 'git diff 7.x-1.x > patch_name'. For the first patch here though I was on a different machine from my normal one and didn't check my git configurations first.
Comment #12
grimreaperOk, at the begging I also use "git diff....". But the problem I realized with that is for very long issues. Long in time. Patches are no more appliable if other issues are merged. And doing that it is impossible to reroll the patch (I think, that's not something I do frequently or already done once)
If you commit and then create the patch from this commit. Git add the information of the previous patch hash so you can reroll using this information.
So my workflow is :
- create a new branch to test a patch or to made a new one : git checkout -b "issue_number" --track origin/7.x-1.x
- doing the code changes
- git add etc..
- git commit
- git format-patch --stdout origin/7.x-1.x > patch_name
Comment #13
digitgopher commentedThank you that is great to know. I will try it.