-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
emit events for before-after-failed link password checks #37438
Conversation
Thanks for opening this pull request! The maintainers of this repository would appreciate it if you would create a changelog item based on your changes. |
e1a5cca
to
1dc6cbc
Compare
Does this need a doc change/addon in the developer section ? |
1dc6cbc
to
1e58d9d
Compare
@mmattel the Symfony events never documented, there is an open issue about it but it seems inactive for a long time. See owncloud/docs#311 I will update the mentioned documentation issue with these events after the merge anyway. Thank you for reminding me. |
Codecov Report
@@ Coverage Diff @@
## master #37438 +/- ##
=========================================
Coverage 64.68% 64.68%
Complexity 19331 19331
=========================================
Files 1277 1277
Lines 75506 75512 +6
Branches 1331 1331
=========================================
+ Hits 48838 48844 +6
Misses 26276 26276
Partials 392 392
Continue to review full report at Codecov.
|
tests/lib/Share20/ManagerTest.php
Outdated
@@ -3151,17 +3151,50 @@ public function testCheckPasswordInvalidPassword() { | |||
|
|||
$this->hasher->method('verify')->with('invalidpassword', 'password', '')->willReturn(false); | |||
|
|||
$calledBeforeEvent = []; | |||
$this->eventDispatcher->addListener('share.beforelinkpasswordcheck', |
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.
Just for the record (this was probably there already and changing it will take time), it seems better to use an interface and ensure that the "dispatch" method is called with the right parameters; no need to rely on an actual implementation.
As said, no need to make this adjustment this now.
Should we include a PHPDoc to clarify when the events will be thrown? It would help with the expectations in case something changes in the future. |
1e58d9d
to
0dfa157
Compare
Looks good. @karakayasemi I guess you will adjust brute_force_protection so that it will receive and respond to these? |
Yes, I expect brute_force_protection will be aware of all share password validations now. |
Description
This PR adds 3 new events (before-fail-after) for link password validations.
Related Issue
How Has This Been Tested?
Types of changes
Checklist: