From 912a75c054b54b6ba8c6a7eaef5a0f8af450db88 Mon Sep 17 00:00:00 2001 From: Robin Chalas Date: Thu, 5 Oct 2023 15:08:48 +0200 Subject: [PATCH] [Security] Fix resetting traceable listeners --- .../Debug/TraceableAuthenticatorManagerListener.php | 8 +++++++- composer.json | 5 +++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Authenticator/Debug/TraceableAuthenticatorManagerListener.php b/Authenticator/Debug/TraceableAuthenticatorManagerListener.php index 3286ce26..e67e3322 100644 --- a/Authenticator/Debug/TraceableAuthenticatorManagerListener.php +++ b/Authenticator/Debug/TraceableAuthenticatorManagerListener.php @@ -16,13 +16,14 @@ use Symfony\Component\Security\Http\Firewall\AbstractListener; use Symfony\Component\Security\Http\Firewall\AuthenticatorManagerListener; use Symfony\Component\VarDumper\Caster\ClassStub; +use Symfony\Contracts\Service\ResetInterface; /** * Decorates the AuthenticatorManagerListener to collect information about security authenticators. * * @author Robin Chalas */ -final class TraceableAuthenticatorManagerListener extends AbstractListener +final class TraceableAuthenticatorManagerListener extends AbstractListener implements ResetInterface { private $authenticationManagerListener; private $authenticatorsInfo = []; @@ -78,4 +79,9 @@ public function getAuthenticatorsInfo(): array { return $this->authenticatorsInfo; } + + public function reset(): void + { + $this->authenticatorsInfo = []; + } } diff --git a/composer.json b/composer.json index a5378b3c..deb09da8 100644 --- a/composer.json +++ b/composer.json @@ -18,12 +18,13 @@ "require": { "php": ">=7.2.5", "symfony/deprecation-contracts": "^2.1|^3", - "symfony/security-core": "^5.4.19|~6.0.19|~6.1.11|^6.2.5", "symfony/http-foundation": "^5.3|^6.0", "symfony/http-kernel": "^5.3|^6.0", "symfony/polyfill-mbstring": "~1.0", "symfony/polyfill-php80": "^1.16", - "symfony/property-access": "^4.4|^5.0|^6.0" + "symfony/property-access": "^4.4|^5.0|^6.0", + "symfony/security-core": "^5.4.19|~6.0.19|~6.1.11|^6.2.5", + "symfony/service-contracts": "^1.10|^2|^3" }, "require-dev": { "symfony/cache": "^4.4|^5.0|^6.0",