-
Notifications
You must be signed in to change notification settings - Fork 5
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
Protect public links password page #90
Conversation
901dcff
to
253f355
Compare
Codecov Report
@@ Coverage Diff @@
## master #90 +/- ##
============================================
+ Coverage 70.00% 71.87% +1.87%
- Complexity 39 53 +14
============================================
Files 11 13 +2
Lines 170 256 +86
============================================
+ Hits 119 184 +65
- Misses 51 72 +21
Continue to review full report at Codecov.
|
e22ee09
to
ea11b0b
Compare
@DeepDiver1975 when you have time, would you like to review this community request implementation? |
Any update? |
@mmattel I need to rebase and resolve conflicts. After that, you can help me with testing the pr. Finally, we can merge this after your approval. |
@karakayasemi ping ? |
ea11b0b
to
bc41b02
Compare
@mmattel, I rebased the PR and resolved conflicts. The PR is all green again and ready to merge after an approval. You can test the feature now. |
fd69463
to
0a03d37
Compare
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.
It's very good that the existing acceptance tests pass.
We should add some acceptance tests to demonstrate what happens when someone tries to brute-force a public link.
0a03d37
to
ba649fe
Compare
I added QA-team label etc. Someone can look at adding acceptance tests tomorrow - maybe @haribhandari07 you were already working in this app this week. |
I am on it @phil-davis |
@haribhandari07 what is the status? |
@haribhandari07 what happened so far? |
@@ -0,0 +1,39 @@ | |||
<?php | |||
namespace OCA\brute_force_protection\Migrations; |
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.
Any reason why brute_force_protection
is not in CamelCase?
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.
MigrationService
cannot find migration classes that has '_' character in app name, it may indicate a bug on core. Because of that, I have been followed same syntax with previous migration class of this app.
Probably we will need to wait overnight until the new daily-master-qa tarball is generated. That will have the core changes in it. (But maybe you get lucky and the changes already work in CI?) |
https://drone.owncloud.com/owncloud/brute_force_protection/973/17/7 The app now requires core 10.5 or later. So the drone test matrix needs to be adjusted.
so that it only tests against |
I added a commit to remove testing against |
https://drone.owncloud.com/owncloud/brute_force_protection/975/17/10
This is failing due to issue #112 - I will adjust the test... |
I pushed more commits for acceptance test changes. I will see the CI result, and then rebase/squash/cleanup the commits into something more logical. |
8d1dd61
to
14c28fb
Compare
Commits squashed. Works with core 10.5.0. Ready for developer review. |
if ($this->linkAccessMapper->getFailedAccessCountForTokenIpCombination($token, $ip) >= | ||
$this->config->getBruteForceProtectionFailTolerance() && | ||
$banUntil > $this->timeFactory->getTime()) { | ||
throw new LinkAuthException($this->l->t("Too many failed attempts. Try again in %s.", |
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.
It's questionable to have translated messages in the exception.
- If the exception isn't caught this likely means that any other exception that could happen around here won't be caught neither, with the risk of exposing unneeded info
- If it's caught, it should be the responsibility of whoever caught the exception (probably a controller) to provide a proper response with the translated message.
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.
@jvillafanez I agree with your point, but I do not think we can easily implement consistent exception catching mechanism since an event can be dispatched from multiple places and multiple endpoints.
I followed the same way with login protection here. As far as I know, we have some translated exceptions like HintException
in the codebase also. I would suggest keeping this one in that way for now to reduce effort.
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.
ok, you might want to include a comment instead so we know the text will be shown to the users
Just saying there are some new files with copyright of 2019... we should adjust that date |
54a19ee
to
a56cce2
Compare
drone CI got the "random" issue #98 |
Looks like the random issue is not random anymore. I could not get a green CI with many attempts. |
@jvillafanez CI is green, I corrected most of the issues that you mention in your review. Please, review it again. Thank you. |
Fixes #57