summaryrefslogtreecommitdiffstats
path: root/Http/EntryPoint
diff options
context:
space:
mode:
authorJohannes Schmitt <schmittjoh@gmail.com>2011-03-18 18:26:55 +0100
committerJohannes Schmitt <schmittjoh@gmail.com>2011-03-18 18:26:55 +0100
commitdf50cc3b4031f45308ea05f7d40a5327fb8bf295 (patch)
treeef0afd5390b426ef5de123be8017e5b83447e5b2 /Http/EntryPoint
parent66ddc5d30f049972a4ce9ba4b1f1c0206bd78ee9 (diff)
downloadsymfony-security-df50cc3b4031f45308ea05f7d40a5327fb8bf295.zip
symfony-security-df50cc3b4031f45308ea05f7d40a5327fb8bf295.tar.gz
symfony-security-df50cc3b4031f45308ea05f7d40a5327fb8bf295.tar.bz2
[Security] removed un-needed event parameter from many interfaces
Diffstat (limited to 'Http/EntryPoint')
-rw-r--r--Http/EntryPoint/AuthenticationEntryPointInterface.php8
-rw-r--r--Http/EntryPoint/BasicAuthenticationEntryPoint.php3
-rw-r--r--Http/EntryPoint/DigestAuthenticationEntryPoint.php3
-rw-r--r--Http/EntryPoint/FormAuthenticationEntryPoint.php10
-rw-r--r--Http/EntryPoint/RetryAuthenticationEntryPoint.php3
5 files changed, 13 insertions, 14 deletions
diff --git a/Http/EntryPoint/AuthenticationEntryPointInterface.php b/Http/EntryPoint/AuthenticationEntryPointInterface.php
index 3095b5c..9fc3501 100644
--- a/Http/EntryPoint/AuthenticationEntryPointInterface.php
+++ b/Http/EntryPoint/AuthenticationEntryPointInterface.php
@@ -11,7 +11,6 @@
namespace Symfony\Component\Security\Http\EntryPoint;
-use Symfony\Component\HttpKernel\Event\GetResponseEvent;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\HttpFoundation\Request;
@@ -26,9 +25,10 @@ interface AuthenticationEntryPointInterface
/**
* Starts the authentication scheme.
*
- * @param GetResponseEvent $event The "onCoreRequest" event
- * @param object $request The request that resulted in an AuthenticationException
+ * @param Request $request The request that resulted in an AuthenticationException
* @param AuthenticationException $authException The exception that started the authentication process
+ *
+ * @return Response
*/
- function start(GetResponseEvent $event, Request $request, AuthenticationException $authException = null);
+ function start(Request $request, AuthenticationException $authException = null);
}
diff --git a/Http/EntryPoint/BasicAuthenticationEntryPoint.php b/Http/EntryPoint/BasicAuthenticationEntryPoint.php
index 8ac0f64..4f13c90 100644
--- a/Http/EntryPoint/BasicAuthenticationEntryPoint.php
+++ b/Http/EntryPoint/BasicAuthenticationEntryPoint.php
@@ -15,7 +15,6 @@ 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\GetResponseEvent;
/**
* BasicAuthenticationEntryPoint starts an HTTP Basic authentication.
@@ -31,7 +30,7 @@ class BasicAuthenticationEntryPoint implements AuthenticationEntryPointInterface
$this->realmName = $realmName;
}
- public function start(GetResponseEvent $event, Request $request, AuthenticationException $authException = null)
+ public function start(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 81f99b1..e422cb0 100644
--- a/Http/EntryPoint/DigestAuthenticationEntryPoint.php
+++ b/Http/EntryPoint/DigestAuthenticationEntryPoint.php
@@ -17,7 +17,6 @@ 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\GetResponseEvent;
/**
* DigestAuthenticationEntryPoint starts an HTTP Digest authentication.
@@ -39,7 +38,7 @@ class DigestAuthenticationEntryPoint implements AuthenticationEntryPointInterfac
$this->logger = $logger;
}
- public function start(GetResponseEvent $event, Request $request, AuthenticationException $authException = null)
+ public function start(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 899de47..2650a07 100644
--- a/Http/EntryPoint/FormAuthenticationEntryPoint.php
+++ b/Http/EntryPoint/FormAuthenticationEntryPoint.php
@@ -17,7 +17,6 @@ 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\GetResponseEvent;
/**
* FormAuthenticationEntryPoint starts an authentication via a login form.
@@ -28,15 +27,18 @@ class FormAuthenticationEntryPoint implements AuthenticationEntryPointInterface
{
private $loginPath;
private $useForward;
+ private $httpKernel;
/**
* Constructor
*
+ * @param HttpKernelInterface $kernel
* @param string $loginPath The path to the login form
* @param Boolean $useForward Whether to forward or redirect to the login form
*/
- public function __construct($loginPath, $useForward = false)
+ public function __construct(HttpKernelInterface $kernel, $loginPath, $useForward = false)
{
+ $this->httpKernel = $kernel;
$this->loginPath = $loginPath;
$this->useForward = (Boolean) $useForward;
}
@@ -44,10 +46,10 @@ class FormAuthenticationEntryPoint implements AuthenticationEntryPointInterface
/**
* {@inheritdoc}
*/
- public function start(GetResponseEvent $event, Request $request, AuthenticationException $authException = null)
+ public function start(Request $request, AuthenticationException $authException = null)
{
if ($this->useForward) {
- return $event->getKernel()->handle(Request::create($this->loginPath), HttpKernelInterface::SUB_REQUEST);
+ return $this->httpKernel->handle(Request::create($this->loginPath), HttpKernelInterface::SUB_REQUEST);
}
return new RedirectResponse(0 !== strpos($this->loginPath, 'http') ? $request->getUriForPath($this->loginPath) : $this->loginPath, 302);
diff --git a/Http/EntryPoint/RetryAuthenticationEntryPoint.php b/Http/EntryPoint/RetryAuthenticationEntryPoint.php
index 5439f19..114d122 100644
--- a/Http/EntryPoint/RetryAuthenticationEntryPoint.php
+++ b/Http/EntryPoint/RetryAuthenticationEntryPoint.php
@@ -16,7 +16,6 @@ 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\GetResponseEvent;
/**
* RetryAuthenticationEntryPoint redirects URL based on the configured scheme.
@@ -36,7 +35,7 @@ class RetryAuthenticationEntryPoint implements AuthenticationEntryPointInterface
$this->httpsPort = $httpsPort;
}
- public function start(GetResponseEvent $event, Request $request, AuthenticationException $authException = null)
+ public function start(Request $request, AuthenticationException $authException = null)
{
$scheme = $request->isSecure() ? 'http' : 'https';
if ('http' === $scheme && 80 != $this->httpPort) {