-
Notifications
You must be signed in to change notification settings - Fork 7
Throw login exception in preLogin instead of sleep #19
Conversation
phil-davis
left a comment
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.
Some suggestions for wording of text strings.
js/settings-admin.js
Outdated
| OC.AppConfig.setValue('security', 'brute_force_protection_ban_period', banPeriod); | ||
| OC.msg.finishedSuccess('#security-save-bfp-settings-message', OC.L10N.translate('Security', 'Preferences are saved')); | ||
| } else { | ||
| OC.msg.finishedError('#security-save-bfp-settings-message', OC.L10N.translate('Security', 'Inputs are should be positive integer')); |
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.
Inputs must be positive integers
lib/SecurityConfig.php
Outdated
| } | ||
|
|
||
| /** | ||
| * Look failed login attempts in how many seconds? |
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.
Count failed login attempts over how many seconds
lib/SecurityConfig.php
Outdated
| } | ||
|
|
||
| /** | ||
| * How many seconds ban attacker |
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.
How many seconds to ban an attacker
templates/settings-admin.php
Outdated
| <h2 class="inlineblock"><?php p($l->t('Brute Force Protection')); ?></h2> | ||
| <span id="security-save-bfp-settings-message" class="msg"></span> | ||
| <div> | ||
| <label for="security-bfp-threshold-time"><?php p($l->t('Look failed login attempts in how many seconds?')) ?></label><br> |
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.
Count failed login attempts over how many seconds?
js/settings-admin.js
Outdated
| OC.AppConfig.setValue('security', 'brute_force_protection_time_threshold', thresholdTime); | ||
| OC.AppConfig.setValue('security', 'brute_force_protection_fail_tolerance', failTolerance); | ||
| OC.AppConfig.setValue('security', 'brute_force_protection_ban_period', banPeriod); | ||
| OC.msg.finishedSuccess('#security-save-bfp-settings-message', OC.L10N.translate('Security', 'Preferences are saved')); |
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.
please use t() instead of OC.L10N.translate - only using t() the extraction tool can extract strings - THX
tests/Db/DbServiceTest.php
Outdated
| $this->connection = \OC::$server->getDatabaseConnection(); | ||
| $this->factory = new TimeFactory(); | ||
| $this->dbService = new DbService($this->connection, $this->factory); | ||
| $this->configMock = $this->getMockBuilder('OCA\Security\SecurityConfig') |
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 comment for the future use:
SecurityConfig::class
tests/HooksTest.php
Outdated
|
|
||
| ->disableOriginalConstructor() | ||
| ->getMock(); | ||
| $this->dispatcherMock = $this->getMockBuilder('Symfony\Component\EventDispatcher\EventDispatcher') |
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.
::class - see above
bd6335f to
c25fcbd
Compare
|
Please use rebase instead of merge
|
0c43986 to
c84016a
Compare
c84016a to
20b85ce
Compare
|
@DeepDiver1975 any obstacle? |

Brute force settings now configurable.
Sleep is removed, #12
Ip will be blocked after too many failed attempts #11
admin settings style is enhanced #7
Indentation mistakes are fixed #18