Skip to content

Commit

Permalink
[Security] Fix resetting traceable listeners
Browse files Browse the repository at this point in the history
  • Loading branch information
chalasr committed Oct 6, 2023
1 parent 7815edb commit 912a75c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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 <robin.chalas@gmail.com>
*/
final class TraceableAuthenticatorManagerListener extends AbstractListener
final class TraceableAuthenticatorManagerListener extends AbstractListener implements ResetInterface
{
private $authenticationManagerListener;
private $authenticatorsInfo = [];
Expand Down Expand Up @@ -78,4 +79,9 @@ public function getAuthenticatorsInfo(): array
{
return $this->authenticatorsInfo;
}

public function reset(): void
{
$this->authenticatorsInfo = [];
}
}
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 912a75c

Please sign in to comment.