summaryrefslogtreecommitdiffstats
path: root/Http
diff options
context:
space:
mode:
Diffstat (limited to 'Http')
-rw-r--r--Http/Authentication/AuthenticationFailureHandlerInterface.php6
-rw-r--r--Http/Authentication/AuthenticationSuccessHandlerInterface.php6
-rw-r--r--Http/Authorization/AccessDeniedHandlerInterface.php6
-rw-r--r--Http/EntryPoint/AuthenticationEntryPointInterface.php6
-rw-r--r--Http/EntryPoint/BasicAuthenticationEntryPoint.php4
-rw-r--r--Http/EntryPoint/DigestAuthenticationEntryPoint.php4
-rw-r--r--Http/EntryPoint/FormAuthenticationEntryPoint.php4
-rw-r--r--Http/EntryPoint/RetryAuthenticationEntryPoint.php4
-rw-r--r--Http/Event/InteractiveLoginEvent.php (renamed from Http/Event/InteractiveLoginEventArgs.php)4
-rw-r--r--Http/Event/SwitchUserEvent.php (renamed from Http/Event/SwitchUserEventArgs.php)4
-rw-r--r--Http/Firewall.php24
-rw-r--r--Http/Firewall/AbstractAuthenticationListener.php36
-rw-r--r--Http/Firewall/AbstractPreAuthenticatedListener.php24
-rw-r--r--Http/Firewall/AccessListener.php8
-rw-r--r--Http/Firewall/AnonymousAuthenticationListener.php6
-rw-r--r--Http/Firewall/BasicAuthenticationListener.php8
-rw-r--r--Http/Firewall/ChannelListener.php16
-rw-r--r--Http/Firewall/ContextListener.php26
-rw-r--r--Http/Firewall/DigestAuthenticationListener.php20
-rw-r--r--Http/Firewall/ExceptionListener.php36
-rw-r--r--Http/Firewall/ListenerInterface.php8
-rw-r--r--Http/Firewall/LogoutListener.php10
-rw-r--r--Http/Firewall/RememberMeListener.php26
-rw-r--r--Http/Firewall/SwitchUserListener.php30
-rw-r--r--Http/Firewall/UsernamePasswordFormAuthenticationListener.php6
-rw-r--r--Http/Firewall/X509AuthenticationListener.php6
-rw-r--r--Http/Logout/LogoutSuccessHandlerInterface.php6
27 files changed, 172 insertions, 172 deletions
diff --git a/Http/Authentication/AuthenticationFailureHandlerInterface.php b/Http/Authentication/AuthenticationFailureHandlerInterface.php
index b35c232..e2d8eb2 100644
--- a/Http/Authentication/AuthenticationFailureHandlerInterface.php
+++ b/Http/Authentication/AuthenticationFailureHandlerInterface.php
@@ -2,7 +2,7 @@
namespace Symfony\Component\Security\Http\Authentication;
-use Symfony\Component\HttpKernel\Event\GetResponseEventArgs;
+use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\HttpFoundation\Request;
@@ -22,12 +22,12 @@ interface AuthenticationFailureHandlerInterface
* called by authentication listeners inheriting from
* AbstractAuthenticationListener.
*
- * @param GetResponseEventArgs $eventArgs the "onCoreSecurity" event, this event always
+ * @param GetResponseEvent $event the "onCoreSecurity" event, this event always
* has the kernel as target
* @param Request $request
* @param AuthenticationException $exception
*
* @return Response the response to return
*/
- function onAuthenticationFailure(GetResponseEventArgs $eventArgs, Request $request, AuthenticationException $exception);
+ function onAuthenticationFailure(GetResponseEvent $event, Request $request, AuthenticationException $exception);
} \ No newline at end of file
diff --git a/Http/Authentication/AuthenticationSuccessHandlerInterface.php b/Http/Authentication/AuthenticationSuccessHandlerInterface.php
index 30b5e26..d7f8488 100644
--- a/Http/Authentication/AuthenticationSuccessHandlerInterface.php
+++ b/Http/Authentication/AuthenticationSuccessHandlerInterface.php
@@ -2,7 +2,7 @@
namespace Symfony\Component\Security\Http\Authentication;
-use Symfony\Component\HttpKernel\Event\GetResponseEventArgs;
+use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\HttpFoundation\Request;
@@ -22,12 +22,12 @@ interface AuthenticationSuccessHandlerInterface
* is called by authentication listeners inheriting from
* AbstractAuthenticationListener.
*
- * @param GetResponseEventArgs $eventArgs the "onCoreSecurity" event, this event always
+ * @param GetResponseEvent $event the "onCoreSecurity" event, this event always
* has the kernel as target
* @param Request $request
* @param TokenInterface $token
*
* @return Response the response to return
*/
- function onAuthenticationSuccess(GetResponseEventArgs $eventArgs, Request $request, TokenInterface $token);
+ function onAuthenticationSuccess(GetResponseEvent $event, Request $request, TokenInterface $token);
} \ No newline at end of file
diff --git a/Http/Authorization/AccessDeniedHandlerInterface.php b/Http/Authorization/AccessDeniedHandlerInterface.php
index b2fb9ee..8474fce 100644
--- a/Http/Authorization/AccessDeniedHandlerInterface.php
+++ b/Http/Authorization/AccessDeniedHandlerInterface.php
@@ -3,7 +3,7 @@
namespace Symfony\Component\Security\Http\Authorization;
use Symfony\Component\HttpFoundation\Request;
-use Symfony\Component\HttpKernel\Event\ExceptionEventArgs;
+use Symfony\Component\HttpKernel\Event\ExceptionEvent;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
/**
@@ -17,11 +17,11 @@ interface AccessDeniedHandlerInterface
/**
* Handles an access denied failure.
*
- * @param ExceptionEventArgs $eventArgs
+ * @param ExceptionEvent $event
* @param Request $request
* @param AccessDeniedException $accessDeniedException
*
* @return Response may return null
*/
- function handle(ExceptionEventArgs $eventArgs, Request $request, AccessDeniedException $accessDeniedException);
+ function handle(ExceptionEvent $event, Request $request, AccessDeniedException $accessDeniedException);
} \ No newline at end of file
diff --git a/Http/EntryPoint/AuthenticationEntryPointInterface.php b/Http/EntryPoint/AuthenticationEntryPointInterface.php
index 7d75cbc..0cf6240 100644
--- a/Http/EntryPoint/AuthenticationEntryPointInterface.php
+++ b/Http/EntryPoint/AuthenticationEntryPointInterface.php
@@ -11,7 +11,7 @@
namespace Symfony\Component\Security\Http\EntryPoint;
-use Symfony\Component\HttpKernel\Event\GetResponseEventArgs;
+use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\HttpFoundation\Request;
@@ -26,9 +26,9 @@ interface AuthenticationEntryPointInterface
/**
* Starts the authentication scheme.
*
- * @param GetResponseEventArgs $eventArgs The "onCoreSecurity" event
+ * @param GetResponseEvent $event The "onCoreSecurity" event
* @param object $request The request that resulted in an AuthenticationException
* @param AuthenticationException $authException The exception that started the authentication process
*/
- function start(GetResponseEventArgs $eventArgs, Request $request, AuthenticationException $authException = null);
+ function start(GetResponseEvent $event, Request $request, AuthenticationException $authException = null);
}
diff --git a/Http/EntryPoint/BasicAuthenticationEntryPoint.php b/Http/EntryPoint/BasicAuthenticationEntryPoint.php
index 984fbec..8ac0f64 100644
--- a/Http/EntryPoint/BasicAuthenticationEntryPoint.php
+++ b/Http/EntryPoint/BasicAuthenticationEntryPoint.php
@@ -15,7 +15,7 @@ use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
-use Symfony\Component\HttpKernel\Event\GetResponseEventArgs;
+use Symfony\Component\HttpKernel\Event\GetResponseEvent;
/**
* BasicAuthenticationEntryPoint starts an HTTP Basic authentication.
@@ -31,7 +31,7 @@ class BasicAuthenticationEntryPoint implements AuthenticationEntryPointInterface
$this->realmName = $realmName;
}
- public function start(GetResponseEventArgs $event, Request $request, AuthenticationException $authException = null)
+ public function start(GetResponseEvent $event, Request $request, AuthenticationException $authException = null)
{
$response = new Response();
$response->headers->set('WWW-Authenticate', sprintf('Basic realm="%s"', $this->realmName));
diff --git a/Http/EntryPoint/DigestAuthenticationEntryPoint.php b/Http/EntryPoint/DigestAuthenticationEntryPoint.php
index 578a3e8..81f99b1 100644
--- a/Http/EntryPoint/DigestAuthenticationEntryPoint.php
+++ b/Http/EntryPoint/DigestAuthenticationEntryPoint.php
@@ -17,7 +17,7 @@ use Symfony\Component\Security\Core\Exception\NonceExpiredException;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Log\LoggerInterface;
-use Symfony\Component\HttpKernel\Event\GetResponseEventArgs;
+use Symfony\Component\HttpKernel\Event\GetResponseEvent;
/**
* DigestAuthenticationEntryPoint starts an HTTP Digest authentication.
@@ -39,7 +39,7 @@ class DigestAuthenticationEntryPoint implements AuthenticationEntryPointInterfac
$this->logger = $logger;
}
- public function start(GetResponseEventArgs $eventArgs, Request $request, AuthenticationException $authException = null)
+ public function start(GetResponseEvent $event, Request $request, AuthenticationException $authException = null)
{
$expiryTime = microtime(true) + $this->nonceValiditySeconds * 1000;
$signatureValue = md5($expiryTime.':'.$this->key);
diff --git a/Http/EntryPoint/FormAuthenticationEntryPoint.php b/Http/EntryPoint/FormAuthenticationEntryPoint.php
index f45f9ea..899de47 100644
--- a/Http/EntryPoint/FormAuthenticationEntryPoint.php
+++ b/Http/EntryPoint/FormAuthenticationEntryPoint.php
@@ -17,7 +17,7 @@ use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface;
use Symfony\Component\HttpKernel\HttpKernelInterface;
-use Symfony\Component\HttpKernel\Event\GetResponseEventArgs;
+use Symfony\Component\HttpKernel\Event\GetResponseEvent;
/**
* FormAuthenticationEntryPoint starts an authentication via a login form.
@@ -44,7 +44,7 @@ class FormAuthenticationEntryPoint implements AuthenticationEntryPointInterface
/**
* {@inheritdoc}
*/
- public function start(GetResponseEventArgs $eventArgs, Request $request, AuthenticationException $authException = null)
+ public function start(GetResponseEvent $event, Request $request, AuthenticationException $authException = null)
{
if ($this->useForward) {
return $event->getKernel()->handle(Request::create($this->loginPath), HttpKernelInterface::SUB_REQUEST);
diff --git a/Http/EntryPoint/RetryAuthenticationEntryPoint.php b/Http/EntryPoint/RetryAuthenticationEntryPoint.php
index 1fb6cc1..5439f19 100644
--- a/Http/EntryPoint/RetryAuthenticationEntryPoint.php
+++ b/Http/EntryPoint/RetryAuthenticationEntryPoint.php
@@ -16,7 +16,7 @@ use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request;
-use Symfony\Component\HttpKernel\Event\GetResponseEventArgs;
+use Symfony\Component\HttpKernel\Event\GetResponseEvent;
/**
* RetryAuthenticationEntryPoint redirects URL based on the configured scheme.
@@ -36,7 +36,7 @@ class RetryAuthenticationEntryPoint implements AuthenticationEntryPointInterface
$this->httpsPort = $httpsPort;
}
- public function start(GetResponseEventArgs $eventArgs, Request $request, AuthenticationException $authException = null)
+ public function start(GetResponseEvent $event, Request $request, AuthenticationException $authException = null)
{
$scheme = $request->isSecure() ? 'http' : 'https';
if ('http' === $scheme && 80 != $this->httpPort) {
diff --git a/Http/Event/InteractiveLoginEventArgs.php b/Http/Event/InteractiveLoginEvent.php
index 7ca4f4e..1265fe2 100644
--- a/Http/Event/InteractiveLoginEventArgs.php
+++ b/Http/Event/InteractiveLoginEvent.php
@@ -12,9 +12,9 @@
namespace Symfony\Component\Security\Http\Event;
use Symfony\Component\HttpFoundation\Request;
-use Doctrine\Common\EventArgs;
+use Symfony\Component\EventDispatcher\Event;
-class InteractiveLoginEventArgs extends EventArgs
+class InteractiveLoginEvent extends Event
{
private $request;
diff --git a/Http/Event/SwitchUserEventArgs.php b/Http/Event/SwitchUserEvent.php
index c88a500..ed293cc 100644
--- a/Http/Event/SwitchUserEventArgs.php
+++ b/Http/Event/SwitchUserEvent.php
@@ -13,9 +13,9 @@ namespace Symfony\Component\Security\Http\Event;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\User\UserInterface;
-use Doctrine\Common\EventArgs;
+use Symfony\Component\EventDispatcher\Event;
-class SwitchUserEventArgs extends EventArgs
+class SwitchUserEvent extends Event
{
private $request;
diff --git a/Http/Firewall.php b/Http/Firewall.php
index bff88b9..7bdda2a 100644
--- a/Http/Firewall.php
+++ b/Http/Firewall.php
@@ -13,9 +13,9 @@ namespace Symfony\Component\Security\Http;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Events;
-use Symfony\Component\HttpKernel\Event\GetResponseEventArgs;
+use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpFoundation\Request;
-use Doctrine\Common\EventManager;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
/**
* Firewall uses a FirewallMap to register security listeners for the given
@@ -30,7 +30,7 @@ use Doctrine\Common\EventManager;
class Firewall
{
private $map;
- private $evm;
+ private $dispatcher;
private $currentListeners;
/**
@@ -38,35 +38,35 @@ class Firewall
*
* @param FirewallMap $map A FirewallMap instance
*/
- public function __construct(FirewallMapInterface $map, EventManager $evm)
+ public function __construct(FirewallMapInterface $map, EventDispatcherInterface $dispatcher)
{
$this->map = $map;
- $this->evm = $evm;
+ $this->dispatcher = $dispatcher;
$this->currentListeners = array();
}
/**
* Handles security.
*
- * @param GetResponseEventArgs $eventArgs An GetResponseEventArgs instance
+ * @param GetResponseEvent $event An GetResponseEvent instance
*/
- public function onCoreRequest(GetResponseEventArgs $eventArgs)
+ public function onCoreRequest(GetResponseEvent $event)
{
- if (HttpKernelInterface::MASTER_REQUEST !== $eventArgs->getRequestType()) {
+ if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
return;
}
// register listeners for this firewall
- list($listeners, $exception) = $this->map->getListeners($eventArgs->getRequest());
+ list($listeners, $exception) = $this->map->getListeners($event->getRequest());
if (null !== $exception) {
- $exception->register($this->evm);
+ $exception->register($this->dispatcher);
}
// initiate the listener chain
foreach ($listeners as $listener) {
- $response = $listener->handle($eventArgs);
+ $response = $listener->handle($event);
- if ($eventArgs->hasResponse()) {
+ if ($event->hasResponse()) {
break;
}
}
diff --git a/Http/Firewall/AbstractAuthenticationListener.php b/Http/Firewall/AbstractAuthenticationListener.php
index f00d5e8..d045b7b 100644
--- a/Http/Firewall/AbstractAuthenticationListener.php
+++ b/Http/Firewall/AbstractAuthenticationListener.php
@@ -21,12 +21,12 @@ use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\HttpKernel\Log\LoggerInterface;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Events as KernelEvents;
-use Symfony\Component\HttpKernel\Event\GetResponseEventArgs;
+use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
-use Doctrine\Common\EventManager;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
/**
* The AbstractAuthenticationListener is the preferred base class for all
@@ -53,7 +53,7 @@ abstract class AbstractAuthenticationListener implements ListenerInterface
protected $providerKey;
private $securityContext;
private $sessionStrategy;
- private $evm;
+ private $dispatcher;
private $successHandler;
private $failureHandler;
private $rememberMeServices;
@@ -66,7 +66,7 @@ abstract class AbstractAuthenticationListener implements ListenerInterface
* @param array $options An array of options for the processing of a successful, or failed authentication attempt
* @param LoggerInterface $logger A LoggerInterface instance
*/
- public function __construct(SecurityContextInterface $securityContext, AuthenticationManagerInterface $authenticationManager, SessionAuthenticationStrategyInterface $sessionStrategy, $providerKey, array $options = array(), AuthenticationSuccessHandlerInterface $successHandler = null, AuthenticationFailureHandlerInterface $failureHandler = null, LoggerInterface $logger = null, EventManager $evm = null)
+ public function __construct(SecurityContextInterface $securityContext, AuthenticationManagerInterface $authenticationManager, SessionAuthenticationStrategyInterface $sessionStrategy, $providerKey, array $options = array(), AuthenticationSuccessHandlerInterface $successHandler = null, AuthenticationFailureHandlerInterface $failureHandler = null, LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null)
{
if (empty($providerKey)) {
throw new \InvalidArgumentException('$providerKey must not be empty.');
@@ -89,7 +89,7 @@ abstract class AbstractAuthenticationListener implements ListenerInterface
'failure_forward' => false,
), $options);
$this->logger = $logger;
- $this->evm = $evm;
+ $this->dispatcher = $dispatcher;
}
/**
@@ -107,9 +107,9 @@ abstract class AbstractAuthenticationListener implements ListenerInterface
*
* @param Event $event An Event instance
*/
- public function onCoreSecurity(GetResponseEventArgs $eventArgs)
+ public function onCoreSecurity(GetResponseEvent $event)
{
- $request = $eventArgs->getRequest();
+ $request = $event->getRequest();
if (!$this->requiresAuthentication($request)) {
return;
@@ -123,17 +123,17 @@ abstract class AbstractAuthenticationListener implements ListenerInterface
if ($returnValue instanceof TokenInterface) {
$this->sessionStrategy->onAuthentication($request, $returnValue);
- $response = $this->onSuccess($eventArgs, $request, $returnValue);
+ $response = $this->onSuccess($event, $request, $returnValue);
} else if ($returnValue instanceof Response) {
$response = $returnValue;
} else {
throw new \RuntimeException('attemptAuthentication() must either return a Response, an implementation of TokenInterface, or null.');
}
} catch (AuthenticationException $e) {
- $response = $this->onFailure($eventArgs, $request, $e);
+ $response = $this->onFailure($event, $request, $e);
}
- $eventArgs->setResponse($response);
+ $event->setResponse($response);
}
/**
@@ -163,7 +163,7 @@ abstract class AbstractAuthenticationListener implements ListenerInterface
*/
abstract protected function attemptAuthentication(Request $request);
- private function onFailure(GetResponseEventArgs $eventArgs, Request $request, AuthenticationException $failed)
+ private function onFailure(GetResponseEvent $event, Request $request, AuthenticationException $failed)
{
if (null !== $this->logger) {
$this->logger->debug(sprintf('Authentication request failed: %s', $failed->getMessage()));
@@ -172,7 +172,7 @@ abstract class AbstractAuthenticationListener implements ListenerInterface
$this->securityContext->setToken(null);
if (null !== $this->failureHandler) {
- return $this->failureHandler->onAuthenticationFailure($eventArgs, $request, $failed);
+ return $this->failureHandler->onAuthenticationFailure($event, $request, $failed);
}
if (null === $this->options['failure_path']) {
@@ -187,7 +187,7 @@ abstract class AbstractAuthenticationListener implements ListenerInterface
$subRequest = Request::create($this->options['failure_path']);
$subRequest->attributes->set(SecurityContextInterface::AUTHENTICATION_ERROR, $failed);
- return $eventArgs->getSubject()->handle($subRequest, HttpKernelInterface::SUB_REQUEST);
+ return $event->getSubject()->handle($subRequest, HttpKernelInterface::SUB_REQUEST);
}
if (null !== $this->logger) {
@@ -199,7 +199,7 @@ abstract class AbstractAuthenticationListener implements ListenerInterface
return new RedirectResponse(0 !== strpos($this->options['failure_path'], 'http') ? $request->getUriForPath($this->options['failure_path']) : $this->options['failure_path'], 302);
}
- private function onSuccess(GetResponseEventArgs $eventArgs, Request $request, TokenInterface $token)
+ private function onSuccess(GetResponseEvent $event, Request $request, TokenInterface $token)
{
if (null !== $this->logger) {
$this->logger->debug('User has been authenticated successfully');
@@ -211,13 +211,13 @@ abstract class AbstractAuthenticationListener implements ListenerInterface
$session->remove(SecurityContextInterface::AUTHENTICATION_ERROR);
$session->remove(SecurityContextInterface::LAST_USERNAME);
- if (null !== $this->evm) {
- $loginEventArgs = new InteractiveLoginEventArgs($request, $token);
- $this->evm->dispatchEvent(Events::onSecurityInteractiveLogin, $loginEventArgs);
+ if (null !== $this->dispatcher) {
+ $loginEvent = new InteractiveLoginEvent($request, $token);
+ $this->dispatcher->dispatchEvent(Events::onSecurityInteractiveLogin, $loginEvent);
}
if (null !== $this->successHandler) {
- $response = $this->successHandler->onAuthenticationSuccess($eventArgs, $request, $token);
+ $response = $this->successHandler->onAuthenticationSuccess($event, $request, $token);
} else {
$path = $this->determineTargetUrl($request);
$response = new RedirectResponse(0 !== strpos($path, 'http') ? $request->getUriForPath($path) : $path, 302);
diff --git a/Http/Firewall/AbstractPreAuthenticatedListener.php b/Http/Firewall/AbstractPreAuthenticatedListener.php
index 0177ab7..eddb079 100644
--- a/Http/Firewall/AbstractPreAuthenticatedListener.php
+++ b/Http/Firewall/AbstractPreAuthenticatedListener.php
@@ -15,13 +15,13 @@ use Symfony\Component\Security\Core\SecurityContextInterface;
use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface;
use Symfony\Component\Security\Core\Authentication\Token\PreAuthenticatedToken;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
-use Symfony\Component\Security\Http\Event\InteractiveLoginEventArgs;
+use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
use Symfony\Component\Security\Http\Events;
-use Symfony\Component\HttpKernel\Event\GetResponseEventArgs;
+use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Events as KernelEvents;
use Symfony\Component\HttpKernel\Log\LoggerInterface;
use Symfony\Component\HttpFoundation\Request;
-use Doctrine\Common\EventManager;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
/**
* AbstractPreAuthenticatedListener is the base class for all listener that
@@ -36,25 +36,25 @@ abstract class AbstractPreAuthenticatedListener implements ListenerInterface
private $securityContext;
private $authenticationManager;
private $providerKey;
- private $evm;
+ private $dispatcher;
- public function __construct(SecurityContextInterface $securityContext, AuthenticationManagerInterface $authenticationManager, $providerKey, LoggerInterface $logger = null, EventManager $evm = null)
+ public function __construct(SecurityContextInterface $securityContext, AuthenticationManagerInterface $authenticationManager, $providerKey, LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null)
{
$this->securityContext = $securityContext;
$this->authenticationManager = $authenticationManager;
$this->providerKey = $providerKey;
$this->logger = $logger;
- $this->evm = $evm;
+ $this->dispatcher = $dispatcher;
}
/**
* Handles X509 authentication.
*
- * @param GetResponseEventArgs $eventArgs A GetResponseEventArgs instance
+ * @param GetResponseEvent $event A GetResponseEvent instance
*/
- public function onCoreSecurity(GetResponseEventArgs $eventArgs)
+ public function onCoreSecurity(GetResponseEvent $event)
{
- $request = $eventArgs->getRequest();
+ $request = $event->getRequest();
if (null !== $this->logger) {
$this->logger->debug(sprintf('Checking secure context token: %s', $this->securityContext->getToken()));
@@ -80,9 +80,9 @@ abstract class AbstractPreAuthenticatedListener implements ListenerInterface
}
$this->securityContext->setToken($token);
- if (null !== $this->evm) {
- $loginEventArgs = new InteractiveLoginEventArgs($request, $token);
- $this->evm->notify(Events::onSecurityInteractiveLogin, $loginEventArgs);
+ if (null !== $this->dispatcher) {
+ $loginEvent = new InteractiveLoginEvent($request, $token);
+ $this->dispatcher->notify(Events::onSecurityInteractiveLogin, $loginEvent);
}
} catch (AuthenticationException $failed) {
$this->securityContext->setToken(null);
diff --git a/Http/Firewall/AccessListener.php b/Http/Firewall/AccessListener.php
index acbb255..02c5e71 100644
--- a/Http/Firewall/AccessListener.php
+++ b/Http/Firewall/AccessListener.php
@@ -16,7 +16,7 @@ use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface
use Symfony\Component\Security\Http\AccessMap;
use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface;
use Symfony\Component\HttpKernel\Log\LoggerInterface;
-use Symfony\Component\HttpKernel\Event\GetResponseEventArgs;
+use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Events;
use Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
@@ -46,15 +46,15 @@ class AccessListener implements ListenerInterface
/**
* Handles access authorization.
*
- * @param GetResponseEventArgs $eventArgs A GetResponseEventArgs instance
+ * @param GetResponseEvent $event A GetResponseEvent instance
*/
- public function onCoreSecurity(GetResponseEventArgs $eventArgs)
+ public function onCoreSecurity(GetResponseEvent $event)
{
if (null === $token = $this->context->getToken()) {
throw new AuthenticationCredentialsNotFoundException('A Token was not found in the SecurityContext.');
}
- $request = $eventArgs->getRequest();
+ $request = $event->getRequest();
list($attributes, $channel) = $this->map->getPatterns($request);
diff --git a/Http/Firewall/AnonymousAuthenticationListener.php b/Http/Firewall/AnonymousAuthenticationListener.php
index bbdef5d..26d6464 100644
--- a/Http/Firewall/AnonymousAuthenticationListener.php
+++ b/Http/Firewall/AnonymousAuthenticationListener.php
@@ -13,7 +13,7 @@ namespace Symfony\Component\Security\Http\Firewall;
use Symfony\Component\Security\Core\SecurityContextInterface;
use Symfony\Component\HttpKernel\Log\LoggerInterface;
-use Symfony\Component\HttpKernel\Event\GetResponseEventArgs;
+use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Events;
use Symfony\Component\Security\Core\Authentication\Token\AnonymousToken;
@@ -39,9 +39,9 @@ class AnonymousAuthenticationListener implements ListenerInterface
/**
* Handles anonymous authentication.
*
- * @param GetResponseEventArgs $eventArgs A GetResponseEventArgs instance
+ * @param GetResponseEvent $event A GetResponseEvent instance
*/
- public function onCoreSecurity(GetResponseEventArgs $eventArgs)
+ public function onCoreSecurity(GetResponseEvent $event)
{
if (null !== $this->context->getToken()) {
return;
diff --git a/Http/Firewall/BasicAuthenticationListener.php b/Http/Firewall/BasicAuthenticationListener.php
index 87d10b8..002e292 100644
--- a/Http/Firewall/BasicAuthenticationListener.php
+++ b/Http/Firewall/BasicAuthenticationListener.php
@@ -15,7 +15,7 @@ use Symfony\Component\Security\Core\SecurityContextInterface;
use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterface;
use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface;
use Symfony\Component\HttpKernel\Log\LoggerInterface;
-use Symfony\Component\HttpKernel\Event\GetResponseEventArgs;
+use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Events;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
@@ -51,11 +51,11 @@ class BasicAuthenticationListener implements ListenerInterface
/**
* Handles basic authentication.
*
- * @param GetResponseEventArgs $eventArgs A GetResponseEventArgs instance
+ * @param GetResponseEvent $event A GetResponseEvent instance
*/
- public function onCoreSecurity(GetResponseEventArgs $eventArgs)
+ public function onCoreSecurity(GetResponseEvent $event)
{
- $request = $eventArgs->getRequest();
+ $request = $event->getRequest();
if (false === $username = $request->server->get('PHP_AUTH_USER', false)) {
return;
diff --git a/Http/Firewall/ChannelListener.php b/Http/Firewall/ChannelListener.php
index e2b3423..4abe7b7 100644
--- a/Http/Firewall/ChannelListener.php
+++ b/Http/Firewall/ChannelListener.php
@@ -14,7 +14,7 @@ namespace Symfony\Component\Security\Http\Firewall;
use Symfony\Component\Security\Http\AccessMap;
use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface;
use Symfony\Component\HttpKernel\Log\LoggerInterface;
-use Symfony\Component\HttpKernel\Event\GetResponseEventArgs;
+use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Events;
/**
@@ -39,11 +39,11 @@ class ChannelListener implements ListenerInterface
/**
* Handles channel management.
*
- * @param GetResponseEventArgs $eventArgs A GetResponseEventArgs instance
+ * @param GetResponseEvent $event A GetResponseEvent instance
*/
- public function onCoreSecurity(GetResponseEventArgs $eventArgs)
+ public function onCoreSecurity(GetResponseEvent $event)
{
- $request = $eventArgs->getRequest();
+ $request = $event->getRequest();
list($attributes, $channel) = $this->map->getPatterns($request);
@@ -52,9 +52,9 @@ class ChannelListener implements ListenerInterface
$this->logger->debug('Redirecting to HTTPS');
}
- $response = $this->authenticationEntryPoint->start($eventArgs, $request);
+ $response = $this->authenticationEntryPoint->start($event, $request);
- $eventArgs->setResponse($response);
+ $event->setResponse($response);
return;
}
@@ -64,9 +64,9 @@ class ChannelListener implements ListenerInterface
$this->logger->debug('Redirecting to HTTP');
}
- $response = $this->authenticationEntryPoint->start($eventArgs, $request);
+ $response = $this->authenticationEntryPoint->start($event, $request);
- $eventArgs->setResponse($response);
+ $event->setResponse($response);
}
}
}
diff --git a/Http/Firewall/ContextListener.php b/Http/Firewall/ContextListener.php
index 72dab1e..332ae5d 100644
--- a/Http/Firewall/ContextListener.php
+++ b/Http/Firewall/ContextListener.php
@@ -14,8 +14,8 @@ namespace Symfony\Component\Security\Http\Firewall;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Log\LoggerInterface;
-use Symfony\Component\HttpKernel\Event\GetResponseEventArgs;
-use Symfony\Component\HttpKernel\Event\FilterResponseEventArgs;
+use Symfony\Component\HttpKernel\Event\GetResponseEvent;
+use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\Events;
use Symfony\Component\Security\Core\Authentication\Token\AnonymousToken;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
@@ -23,7 +23,7 @@ use Symfony\Component\Security\Core\Exception\UsernameNotFoundException;
use Symfony\Component\Security\Core\Exception\UnsupportedUserException;
use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\Security\Core\User\UserInterface;
-use Doctrine\Common\EventManager;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
/**
* ContextListener manages the SecurityContext persistence through a session.
@@ -38,7 +38,7 @@ class ContextListener implements ListenerInterface
private $logger;
private $userProviders;
- public function __construct(SecurityContext $context, array $userProviders, $contextKey, LoggerInterface $logger = null, EventManager $evm = null)
+ public function __construct(SecurityContext $context, array $userProviders, $contextKey, LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null)
{
if (empty($contextKey)) {
throw new \InvalidArgumentException('$contextKey must not be empty.');
@@ -48,19 +48,19 @@ class ContextListener implements ListenerInterface
$this->userProviders = $userProviders;
$this->contextKey = $contextKey;
- if (null !== $evm) {
- $evm->connect(Events::onCoreResponse, $this);
+ if (null !== $dispatcher) {
+ $dispatcher->connect(Events::onCoreResponse, $this);
}
}
/**
* Reads the SecurityContext from the session.
*
- * @param GetResponseEventArgs $eventArgs A GetResponseEventArgs instance
+ * @param GetResponseEvent $event A GetResponseEvent instance
*/
- public function onCoreSecurity(GetResponseEventArgs $eventArgs)
+ public function onCoreSecurity(GetResponseEvent $event)
{
- $request = $eventArgs->getRequest();
+ $request = $event->getRequest();
$session = $request->hasSession() ? $request->getSession() : null;
@@ -84,11 +84,11 @@ class ContextListener implements ListenerInterface
/**
* Writes the SecurityContext to the session.
*
- * @param FilterResponseEventArgs $eventArgs A FilterResponseEventArgs instance
+ * @param FilterResponseEvent $event A FilterResponseEvent instance
*/
- public function filterCoreResponse(FilterResponseEventArgs $eventArgs)
+ public function filterCoreResponse(FilterResponseEvent $event)
{
- if (HttpKernelInterface::MASTER_REQUEST !== $eventArgs->getRequestType()) {
+ if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
return;
}
@@ -104,7 +104,7 @@ class ContextListener implements ListenerInterface
$this->logger->debug('Write SecurityContext in the session');
}
- $eventArgs->getRequest()->getSession()->set('_security_'.$this->contextKey, serialize($token));
+ $event->getRequest()->getSession()->set('_security_'.$this->contextKey, serialize($token));
}
/**
diff --git a/Http/Firewall/DigestAuthenticationListener.php b/Http/Firewall/DigestAuthenticationListener.php
index 70b32be..f2f925f 100644
--- a/Http/Firewall/DigestAuthenticationListener.php
+++ b/Http/Firewall/DigestAuthenticationListener.php
@@ -15,7 +15,7 @@ use Symfony\Component\Security\Core\SecurityContextInterface;
use Symfony\Component\Security\Core\User\UserProviderInterface;
use Symfony\Component\Security\Http\EntryPoint\DigestAuthenticationEntryPoint;
use Symfony\Component\HttpKernel\Log\LoggerInterface;
-use Symfony\Component\HttpKernel\Event\GetResponseEventArgs;
+use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Events;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
use Symfony\Component\Security\Core\Exception\BadCredentialsException;
@@ -54,11 +54,11 @@ class DigestAuthenticationListener implements ListenerInterface
/**
* Handles digest authentication.
*
- * @param GetResponseEventArgs $eventArgs A GetResponseEventArgs instance
+ * @param GetResponseEvent $event A GetResponseEvent instance
*/
- public function onCoreSecurity(GetResponseEventArgs $eventArgs)
+ public function onCoreSecurity(GetResponseEvent $event)
{
- $request = $eventArgs->getRequest();
+ $request = $event->getRequest();
if (!$header = $request->server->get('PHP_AUTH_DIGEST')) {
return;
@@ -79,7 +79,7 @@ class DigestAuthenticationListener implements ListenerInterface
try {
$digestAuth->validateAndDecode($this->authenticationEntryPoint->getKey(), $this->authenticationEntryPoint->getRealmName());
} catch (BadCredentialsException $e) {
- $this->fail($eventArgs, $request, $e);
+ $this->fail($event, $request, $e);
return;
}
@@ -93,7 +93,7 @@ class DigestAuthenticationListener implements ListenerInterface
$serverDigestMd5 = $digestAuth->calculateServerDigest($user->getPassword(), $request->getMethod());
} catch (UsernameNotFoundException $notFound) {
- $this->fail($eventArgs, $request, new BadCredentialsException(sprintf('Username %s not found.', $digestAuth->getUsername())));
+ $this->fail($event, $request, new BadCredentialsException(sprintf('Username %s not found.', $digestAuth->getUsername())));
return;
}
@@ -103,13 +103,13 @@ class DigestAuthenticationListener implements ListenerInterface
$this->logger->debug(sprintf("Expected response: '%s' but received: '%s'; is AuthenticationDao returning clear text passwords?", $serverDigestMd5, $digestAuth->getResponse()));
}
- $this->fail($eventArgs, $request, new BadCredentialsException('Incorrect response'));
+ $this->fail($event, $request, new BadCredentialsException('Incorrect response'));
return;
}
if ($digestAuth->isNonceExpired()) {
- $this->fail($eventArgs, $request, new NonceExpiredException('Nonce has expired/timed out.'));
+ $this->fail($event, $request, new NonceExpiredException('Nonce has expired/timed out.'));
return;
}
@@ -121,7 +121,7 @@ class DigestAuthenticationListener implements ListenerInterface
$this->securityContext->setToken(new UsernamePasswordToken($user, $user->getPassword(), $this->providerKey));
}
- private function fail(GetResponseEventArgs $eventArgs, Request $request, AuthenticationException $authException)
+ private function fail(GetResponseEvent $event, Request $request, AuthenticationException $authException)
{
$this->securityContext->setToken(null);
@@ -129,7 +129,7 @@ class DigestAuthenticationListener implements ListenerInterface
$this->logger->debug($authException);
}
- $this->authenticationEntryPoint->start($eventArgs, $request, $authException);
+ $this->authenticationEntryPoint->start($event, $request, $authException);
}
}
diff --git a/Http/Firewall/ExceptionListener.php b/Http/Firewall/ExceptionListener.php
index e88b84f..153aec8 100644
--- a/Http/Firewall/ExceptionListener.php
+++ b/Http/Firewall/ExceptionListener.php
@@ -24,7 +24,7 @@ use Symfony\Component\Security\Core\Exception\InsufficientAuthenticationExceptio
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Events;
-use Doctrine\Common\EventManager;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
/**
* ExceptionListener catches authentication exception and converts them to
@@ -54,22 +54,22 @@ class ExceptionListener
/**
* Registers a onCoreException listener to take care of security exceptions.
*
- * @param EventManager $evm An EventManager instance
+ * @param EventDispatcherInterface $dispatcher An EventDispatcherInterface instance
*/
- public function register(EventManager $evm)
+ public function register(EventDispatcherInterface $dispatcher)
{
- $evm->connect(Events::onCoreException, $this);
+ $dispatcher->connect(Events::onCoreException, $this);
}
/**
* Handles security related exceptions.
*
- * @param ExceptionEventArgs $event An ExceptionEventArgs instance
+ * @param ExceptionEvent $event An ExceptionEvent instance
*/
- public function onCoreException(ExceptionEventArgs $eventArgs)
+ public function onCoreException(ExceptionEvent $event)
{
- $exception = $eventArgs->getException();
- $request = $eventArgs->getRequest();
+ $exception = $event->getException();
+ $request = $event->getRequest();
if ($exception instanceof AuthenticationException) {
if (null !== $this->logger) {
@@ -77,9 +77,9 @@ class ExceptionListener
}
try {
- $response = $this->startAuthentication($eventArgs, $request, $exception);
+ $response = $this->startAuthentication($event, $request, $exception);
} catch (\Exception $e) {
- $eventArgs->set('exception', $e);
+ $event->set('exception', $e);
return;
}
@@ -91,9 +91,9 @@ class ExceptionListener
}
try {
- $response = $this->startAuthentication($eventArgs, $request, new InsufficientAuthenticationException('Full authentication is required to access this resource.', $token, 0, $exception));
+ $response = $this->startAuthentication($event, $request, new InsufficientAuthenticationException('Full authentication is required to access this resource.', $token, 0, $exception));
} catch (\Exception $e) {
- $eventArgs->set('exception', $e);
+ $event->set('exception', $e);
return;
}
@@ -104,7 +104,7 @@ class ExceptionListener
try {
if (null !== $this->accessDeniedHandler) {
- $response = $this->accessDeniedHandler->handle($eventArgs, $request, $exception);
+ $response = $this->accessDeniedHandler->handle($event, $request, $exception);
if (!$response instanceof Response) {
return;
@@ -117,7 +117,7 @@ class ExceptionListener
$subRequest = Request::create($this->errorPage);
$subRequest->attributes->set(SecurityContextInterface::ACCESS_DENIED_ERROR, $exception);
- $response = $eventArgs->getKernel()->handle($subRequest, HttpKernelInterface::SUB_REQUEST, true);
+ $response = $event->getKernel()->handle($subRequest, HttpKernelInterface::SUB_REQUEST, true);
$response->setStatusCode(403);
}
} catch (\Exception $e) {
@@ -125,7 +125,7 @@ class ExceptionListener
$this->logger->err(sprintf('Exception thrown when handling an exception (%s: %s)', get_class($e), $e->getMessage()));
}
- $eventArgs->setException(new \RuntimeException('Exception thrown when handling an exception.', 0, $e));
+ $event->setException(new \RuntimeException('Exception thrown when handling an exception.', 0, $e));
return;
}
@@ -134,10 +134,10 @@ class ExceptionListener
return;
}
- $eventArgs->setResponse($response);
+ $event->setResponse($response);
}
- private function startAuthentication(ExceptionEventArgs $eventArgs, Request $request, AuthenticationException $authException)
+ private function startAuthentication(ExceptionEvent $event, Request $request, AuthenticationException $authException)
{
$this->context->setToken(null);
@@ -154,6 +154,6 @@ class ExceptionListener
$request->getSession()->set('_security.target_path', $request->getUri());
}
- return $this->authenticationEntryPoint->start($eventArgs, $request, $authException);
+ return $this->authenticationEntryPoint->start($event, $request, $authException);
}
}
diff --git a/Http/Firewall/ListenerInterface.php b/Http/Firewall/ListenerInterface.php
index bfc7478..e451103 100644
--- a/Http/Firewall/ListenerInterface.php
+++ b/Http/Firewall/ListenerInterface.php
@@ -11,8 +11,8 @@
namespace Symfony\Component\Security\Http\Firewall;
-use Symfony\Component\HttpKernel\Event\GetResponseEventArgs;
-use Doctrine\Common\EventManager;
+use Symfony\Component\HttpKernel\Event\GetResponseEvent;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
/**
* Interface that must be implemented by firewall listeners
@@ -24,7 +24,7 @@ interface ListenerInterface
/**
* This interface must be implemented by firewall listeners.
*
- * @param GetResponseEventArgs $eventArgs
+ * @param GetResponseEvent $event
*/
- function onCoreSecurity(GetResponseEventArgs $eventArgs);
+ function onCoreSecurity(GetResponseEvent $event);
} \ No newline at end of file
diff --git a/Http/Firewall/LogoutListener.php b/Http/Firewall/LogoutListener.php
index d2b18cf..18b37f3 100644
--- a/Http/Firewall/LogoutListener.php
+++ b/Http/Firewall/LogoutListener.php
@@ -17,7 +17,7 @@ use Symfony\Component\Security\Http\Logout\LogoutHandlerInterface;
use Symfony\Component\Security\Core\SecurityContextInterface;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpFoundation\RedirectResponse;
-use Symfony\Component\Kernel\Event\GetResponseEventArgs;
+use Symfony\Component\Kernel\Event\GetResponseEvent;
use Symfony\Component\Kernel\Events;
/**
@@ -63,18 +63,18 @@ class LogoutListener implements ListenerInterface
/**
* Performs the logout if requested
*
- * @param GetResponseEventArgs $eventArgs A GetResponseEventArgs instance
+ * @param GetResponseEvent $event A GetResponseEvent instance
*/
- public function onCoreSecurity(GetResponseEventArgs $eventArgs)
+ public function onCoreSecurity(GetResponseEvent $event)
{
- $request = $eventArgs->getRequest();
+ $request = $event->getRequest();
if ($this->logoutPath !== $request->getPathInfo()) {
return;
}
if (null !== $this->successHandler) {
- $response = $this->successHandler->onLogoutSuccess($eventArgs, $request);
+ $response = $this->successHandler->onLogoutSuccess($event, $request);
if (!$response instanceof Response) {
throw new \RuntimeException('Logout Success Handler did not return a Response.');
diff --git a/Http/Firewall/RememberMeListener.php b/Http/Firewall/RememberMeListener.php
index af5fc83..0706410 100644
--- a/Http/Firewall/RememberMeListener.php
+++ b/Http/Firewall/RememberMeListener.php
@@ -4,8 +4,8 @@ namespace Symfony\Component\Security\Http\Firewall;
use Symfony\Component\HttpKernel\HttpKernelInterface;
use Symfony\Component\HttpKernel\Log\LoggerInterface;
-use Symfony\Component\HttpKernel\Event\GetResponseEventArgs;
-use Symfony\Component\HttpKernel\Event\FilterResponseEventArgs;
+use Symfony\Component\HttpKernel\Event\GetResponseEvent;
+use Symfony\Component\HttpKernel\Event\FilterResponseEvent;
use Symfony\Component\HttpKernel\Events as KernelEvents;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
@@ -14,9 +14,9 @@ use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Core\Exception\CookieTheftException;
use Symfony\Component\Security\Core\SecurityContext;
use Symfony\Component\Security\Http\RememberMe\RememberMeServicesInterface;
-use Symfony\Component\Security\Http\Event\InteractiveLoginEventArgs;
+use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
use Symfony\Component\Security\Http\Events;
-use Doctrine\Common\EventManager;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
/*
* This file is part of the Symfony framework.
@@ -38,7 +38,7 @@ class RememberMeListener implements ListenerInterface
private $rememberMeServices;
private $authenticationManager;
private $logger;
- private $evm;
+ private $dispatcher;
/**
* Constructor
@@ -48,27 +48,27 @@ class RememberMeListener implements ListenerInterface
* @param AuthenticationManagerInterface $authenticationManager
* @param LoggerInterface $logger
*/
- public function __construct(SecurityContext $securityContext, RememberMeServicesInterface $rememberMeServices, AuthenticationManagerInterface $authenticationManager, LoggerInterface $logger = null, EventManager $evm = null)
+ public function __construct(SecurityContext $securityContext, RememberMeServicesInterface $rememberMeServices, AuthenticationManagerInterface $authenticationManager, LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null)
{
$this->securityContext = $securityContext;
$this->rememberMeServices = $rememberMeServices;
$this->authenticationManager = $authenticationManager;
$this->logger = $logger;
- $this->evm = $evm;
+ $this->dispatcher = $dispatcher;
}
/**
* Handles remember-me cookie based authentication.
*
- * @param GetResponseEventArgs $eventArgs A GetResponseEventArgs instance
+ * @param GetResponseEvent $event A GetResponseEvent instance
*/
- public function onCoreSecurity(GetResponseEventArgs $eventArgs)
+ public function onCoreSecurity(GetResponseEvent $event)
{
if (null !== $this->securityContext->getToken()) {
return;
}
- $request = $eventArgs->getRequest();
+ $request = $event->getRequest();
if (null === $token = $this->rememberMeServices->autoLogin($request)) {
return;
}
@@ -77,9 +77,9 @@ class RememberMeListener implements ListenerInterface
$token = $this->authenticationManager->authenticate($token);
$this->securityContext->setToken($token);
- if (null !== $this->evm) {
- $loginEventArgs = new InteractiveLoginEventArgs($request, $token);
- $this->evm->dispatchEvent(Events::onSecurityInteractiveLogin, $loginEventArgs);
+ if (null !== $this->dispatcher) {
+ $loginEvent = new InteractiveLoginEvent($request, $token);
+ $this->dispatcher->dispatchEvent(Events::onSecurityInteractiveLogin, $loginEvent);
}
if (null !== $this->logger) {
diff --git a/Http/Firewall/SwitchUserListener.php b/Http/Firewall/SwitchUserListener.php
index 11671ef..6c89a54 100644
--- a/Http/Firewall/SwitchUserListener.php
+++ b/Http/Firewall/SwitchUserListener.php
@@ -16,7 +16,7 @@ use Symfony\Component\Security\Core\User\UserProviderInterface;
use Symfony\Component\Security\Core\User\UserCheckerInterface;
use Symfony\Component\Security\Core\Authorization\AccessDecisionManagerInterface;
use Symfony\Component\HttpKernel\Log\LoggerInterface;
-use Symfony\Component\HttpKernel\Event\GetResponseEventArgs;
+use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\HttpKernel\Events;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\HttpFoundation\Response;
@@ -26,9 +26,9 @@ use Symfony\Component\Security\Core\Role\SwitchUserRole;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
use Symfony\Component\Security\Core\Exception\AuthenticationCredentialsNotFoundException;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
-use Symfony\Component\Security\Http\Event\SwitchUserEventArgs;
+use Symfony\Component\Security\Http\Event\SwitchUserEvent;
use Symfony\Component\Security\Http\Events;
-use Doctrine\Common\EventManager;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
/**
* SwitchUserListener allows a user to impersonate another one temporarily
@@ -46,12 +46,12 @@ class SwitchUserListener implements ListenerInterface
private $usernameParameter;
private $role;
private $logger;
- private $evm;
+ private $dispatcher;
/**
* Constructor.
*/
- public function __construct(SecurityContextInterface $securityContext, UserProviderInterface $provider, UserCheckerInterface $userChecker, $providerKey, AccessDecisionManagerInterface $accessDecisionManager, LoggerInterface $logger = null, $usernameParameter = '_switch_user', $role = 'ROLE_ALLOWED_TO_SWITCH', EventManager $evm = null)
+ public function __construct(SecurityContextInterface $securityContext, UserProviderInterface $provider, UserCheckerInterface $userChecker, $providerKey, AccessDecisionManagerInterface $accessDecisionManager, LoggerInterface $logger = null, $usernameParameter = '_switch_user', $role = 'ROLE_ALLOWED_TO_SWITCH', EventDispatcherInterface $dispatcher = null)
{
if (empty($providerKey)) {
throw new \InvalidArgumentException('$providerKey must not be empty.');
@@ -65,17 +65,17 @@ class SwitchUserListener implements ListenerInterface
$this->usernameParameter = $usernameParameter;
$this->role = $role;
$this->logger = $logger;
- $this->evm = $evm;
+ $this->dispatcher = $dispatcher;
}
/**
* Handles digest authentication.
*
- * @param GetResponseEventArgs $eventArgs A GetResponseEventArgs instance
+ * @param GetResponseEvent $event A GetResponseEvent instance
*/
- public function onCoreSecurity(GetResponseEventArgs $eventArgs)
+ public function onCoreSecurity(GetResponseEvent $event)
{
- $request = $eventArgs->getRequest();
+ $request = $event->getRequest();
if (!$request->get($this->usernameParameter)) {
return;
@@ -129,9 +129,9 @@ class SwitchUserListener implements ListenerInterface
$token = new UsernamePasswordToken($user, $user->getPassword(), $this->providerKey, $roles);
- if (null !== $this->evm) {
- $switchEventArgs = new SwitchUserEventArgs($request, $token->getUser());
- $this->evm->dispatchEvent(Events::onSecuritySwitchUser, $switchEventArgs);
+ if (null !== $this->dispatcher) {
+ $switchEvent = new SwitchUserEvent($request, $token->getUser());
+ $this->dispatcher->dispatchEvent(Events::onSecuritySwitchUser, $switchEvent);
}
return $token;
@@ -150,9 +150,9 @@ class SwitchUserListener implements ListenerInterface
throw new AuthenticationCredentialsNotFoundException(sprintf('Could not find original Token object.'));
}
- if (null !== $this->evm) {
- $switchEventArgs = new SwitchUserEventArgs($request, $original->getUser());
- $this->evm->notify(Events::onSecuritySwitchUser, $switchEventArgs);
+ if (null !== $this->dispatcher) {
+ $switchEvent = new SwitchUserEvent($request, $original->getUser());
+ $this->dispatcher->notify(Events::onSecuritySwitchUser, $switchEvent);
}
return $original;
diff --git a/Http/Firewall/UsernamePasswordFormAuthenticationListener.php b/Http/Firewall/UsernamePasswordFormAuthenticationListener.php
index 7f60daa..5a84391 100644
--- a/Http/Firewall/UsernamePasswordFormAuthenticationListener.php
+++ b/Http/Firewall/UsernamePasswordFormAuthenticationListener.php
@@ -21,7 +21,7 @@ use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterfac
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
use Symfony\Component\Security\Core\Exception\InvalidCsrfTokenException;
use Symfony\Component\Security\Core\SecurityContextInterface;
-use Doctrine\Common\EventManager;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
/**
* UsernamePasswordFormAuthenticationListener is the default implementation of
@@ -36,7 +36,7 @@ class UsernamePasswordFormAuthenticationListener extends AbstractAuthenticationL
/**
* {@inheritdoc}
*/
- public function __construct(SecurityContextInterface $securityContext, AuthenticationManagerInterface $authenticationManager, SessionAuthenticationStrategyInterface $sessionStrategy, $providerKey, array $options = array(), AuthenticationSuccessHandlerInterface $successHandler = null, AuthenticationFailureHandlerInterface $failureHandler = null, LoggerInterface $logger = null, EventManager $evm = null, CsrfProviderInterface $csrfProvider = null)
+ public function __construct(SecurityContextInterface $securityContext, AuthenticationManagerInterface $authenticationManager, SessionAuthenticationStrategyInterface $sessionStrategy, $providerKey, array $options = array(), AuthenticationSuccessHandlerInterface $successHandler = null, AuthenticationFailureHandlerInterface $failureHandler = null, LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null, CsrfProviderInterface $csrfProvider = null)
{
parent::__construct($securityContext, $authenticationManager, $sessionStrategy, $providerKey, array_merge(array(
'username_parameter' => '_username',
@@ -44,7 +44,7 @@ class UsernamePasswordFormAuthenticationListener extends AbstractAuthenticationL
'csrf_parameter' => '_csrf_token',
'csrf_page_id' => 'form_login',
'post_only' => true,
- ), $options), $successHandler, $failureHandler, $logger, $evm);
+ ), $options), $successHandler, $failureHandler, $logger, $dispatcher);
$this->csrfProvider = $csrfProvider;
}
diff --git a/Http/Firewall/X509AuthenticationListener.php b/Http/Firewall/X509AuthenticationListener.php
index 509f541..831ca02 100644
--- a/Http/Firewall/X509AuthenticationListener.php
+++ b/Http/Firewall/X509AuthenticationListener.php
@@ -16,7 +16,7 @@ use Symfony\Component\Security\Core\Authentication\AuthenticationManagerInterfac
use Symfony\Component\HttpKernel\Log\LoggerInterface;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\Exception\BadCredentialsException;
-use Doctrine\Common\EventManager;
+use Symfony\Component\EventDispatcher\EventDispatcherInterface;
/**
* X509 authentication listener.
@@ -28,9 +28,9 @@ class X509AuthenticationListener extends AbstractPreAuthenticatedListener
protected $userKey;
protected $credentialKey;
- public function __construct(SecurityContextInterface $securityContext, AuthenticationManagerInterface $authenticationManager, $providerKey, $userKey = 'SSL_CLIENT_S_DN_Email', $credentialKey = 'SSL_CLIENT_S_DN', LoggerInterface $logger = null, EventManager $evm = null)
+ public function __construct(SecurityContextInterface $securityContext, AuthenticationManagerInterface $authenticationManager, $providerKey, $userKey = 'SSL_CLIENT_S_DN_Email', $credentialKey = 'SSL_CLIENT_S_DN', LoggerInterface $logger = null, EventDispatcherInterface $dispatcher = null)
{
- parent::__construct($securityContext, $authenticationManager, $providerKey, $logger, $evm);
+ parent::__construct($securityContext, $authenticationManager, $providerKey, $logger, $dispatcher);
$this->userKey = $userKey;
$this->credentialKey = $credentialKey;
diff --git a/Http/Logout/LogoutSuccessHandlerInterface.php b/Http/Logout/LogoutSuccessHandlerInterface.php
index 9338256..21dbb81 100644
--- a/Http/Logout/LogoutSuccessHandlerInterface.php
+++ b/Http/Logout/LogoutSuccessHandlerInterface.php
@@ -3,7 +3,7 @@
namespace Symfony\Component\Security\Http\Logout;
use Symfony\Component\HttpFoundation\Request;
-use Symfony\Component\HttpKernel\Event\GetResponseEventArgs;
+use Symfony\Component\HttpKernel\Event\GetResponseEvent;
/**
* LogoutSuccesshandlerInterface.
@@ -21,9 +21,9 @@ interface LogoutSuccessHandlerInterface
/**
* Creates a Response object to send upon a successful logout.
*
- * @param GetResponseEventArgs $eventArgs
+ * @param GetResponseEvent $event
* @param Request $request
* @return Response never null
*/
- function onLogoutSuccess(GetResponseEventArgs $eventArgs, Request $request);
+ function onLogoutSuccess(GetResponseEvent $event, Request $request);
} \ No newline at end of file