refactor(security): add typed rate-limit event

Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
This commit is contained in:
2026-08-05 23:36:44 -04:00
parent 7c2a8dfbd3
commit 688afbe5a1
8 changed files with 169 additions and 31 deletions
@@ -13,6 +13,7 @@ use KTXC\Models\Tenant\TenantConfiguration;
use KTXC\Security\Event\AccessDeniedEvent;
use KTXC\Security\Event\AuthenticationFailedEvent;
use KTXC\Security\Event\BruteForceDetectedEvent;
use KTXC\Security\Event\RateLimitExceededEvent;
use KTXC\Service\FirewallService;
use KTXC\Service\FirewallRuleCache;
use KTXC\Service\FirewallRuleManager;
@@ -294,7 +295,7 @@ class FirewallServiceTest extends TestCase
&& $metadata['windowSeconds'] === 60;
}))
->willReturnArgument(0);
$event = \KTXC\Security\Event\SecurityEvent::rateLimitExceeded(
$event = new RateLimitExceededEvent(
'203.0.113.10',
101,
60,