Make BruteForceProtection annotation more clever
This makes the new `@BruteForceProtection` annotation more clever and moves the relevant code into it's own middleware.
Basically you can now set `@BruteForceProtection(action=$key)` as annotation and that will make the controller bruteforce protected. However, the difference to before is that you need to call `$responmse->throttle()` to increase the counter. Before the counter was increased every time which leads to all kind of unexpected problems.
Signed-off-by:
Lukas Reschke <lukas@statuscode.ch>
Showing
- core/Controller/LoginController.php 11 additions, 25 deletionscore/Controller/LoginController.php
- lib/composer/composer/autoload_classmap.php 1 addition, 0 deletionslib/composer/composer/autoload_classmap.php
- lib/composer/composer/autoload_static.php 1 addition, 0 deletionslib/composer/composer/autoload_static.php
- lib/private/AppFramework/DependencyInjection/DIContainer.php 14 additions, 3 deletionslib/private/AppFramework/DependencyInjection/DIContainer.php
- lib/private/AppFramework/Middleware/Security/BruteForceMiddleware.php 83 additions, 0 deletions...AppFramework/Middleware/Security/BruteForceMiddleware.php
- lib/private/AppFramework/Middleware/Security/SecurityMiddleware.php 1 addition, 14 deletions...e/AppFramework/Middleware/Security/SecurityMiddleware.php
- lib/public/AppFramework/Http/Response.php 19 additions, 0 deletionslib/public/AppFramework/Http/Response.php
- tests/Core/Controller/LoginControllerTest.php 3 additions, 130 deletionstests/Core/Controller/LoginControllerTest.php
- tests/lib/AppFramework/Http/ResponseTest.php 5 additions, 0 deletionstests/lib/AppFramework/Http/ResponseTest.php
- tests/lib/AppFramework/Middleware/Security/BruteForceMiddlewareTest.php 190 additions, 0 deletions...ramework/Middleware/Security/BruteForceMiddlewareTest.php
- tests/lib/AppFramework/Middleware/Security/SecurityMiddlewareTest.php 1 addition, 75 deletions...pFramework/Middleware/Security/SecurityMiddlewareTest.php
Loading
Please register or sign in to comment