summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFabien Potencier <fabien.potencier@gmail.com>2013-09-29 21:43:28 +0200
committerFabien Potencier <fabien.potencier@gmail.com>2013-09-29 21:43:28 +0200
commit46c7d3e11f3ab534ce84dfaeadd7c2870dba1a36 (patch)
tree742f5653e60dddcd960331a77dedaf50fb602b75
parenta940d57cac60a12146e2fd1cd543c59109105ad9 (diff)
parent8969dd88b7a4c3e60cee10ad4094dcd05de62965 (diff)
downloadsymfony-security-46c7d3e11f3ab534ce84dfaeadd7c2870dba1a36.zip
symfony-security-46c7d3e11f3ab534ce84dfaeadd7c2870dba1a36.tar.gz
symfony-security-46c7d3e11f3ab534ce84dfaeadd7c2870dba1a36.tar.bz2
Merge branch '2.3'
* 2.3: fixed Client when using the terminable event Fix problem with Windows file links (backslash in JavaScript string) [Security] fixed wrong phpdoc [DependencyInjection] Prevented inlining of lazy loaded private service definitions. [Routing] removed extra argument [HttpFoundation] Header `HTTP_X_FORWARDED_PROTO` can contain various values Some proxies use `ssl` instead of `https`, as well as Lighttpd mod_proxy allows value chaining (`https, http`, where `https` is always first when request is encrypted). Added doc comments Conflicts: src/Symfony/Component/Routing/Router.php src/Symfony/Component/Security/Http/Firewall.php
-rw-r--r--Http/AccessMap.php3
-rw-r--r--Http/Authentication/DefaultAuthenticationFailureHandler.php2
-rw-r--r--Http/Authorization/AccessDeniedHandlerInterface.php1
-rw-r--r--Http/EntryPoint/BasicAuthenticationEntryPoint.php3
-rw-r--r--Http/EntryPoint/DigestAuthenticationEntryPoint.php9
-rw-r--r--Http/EntryPoint/FormAuthenticationEntryPoint.php2
-rw-r--r--Http/EntryPoint/RetryAuthenticationEntryPoint.php3
-rw-r--r--Http/Event/InteractiveLoginEvent.php6
-rw-r--r--Http/Event/SwitchUserEvent.php12
-rw-r--r--Http/Firewall.php3
-rw-r--r--Http/Firewall/ExceptionListener.php10
-rw-r--r--Http/Firewall/LogoutListener.php5
-rw-r--r--Http/Firewall/RememberMeListener.php2
-rw-r--r--Http/Firewall/X509AuthenticationListener.php3
-rw-r--r--Http/FirewallMap.php8
-rw-r--r--Http/HttpUtils.php9
-rw-r--r--Http/RememberMe/AbstractRememberMeServices.php9
-rw-r--r--Http/RememberMe/ResponseListener.php6
18 files changed, 84 insertions, 12 deletions
diff --git a/Http/AccessMap.php b/Http/AccessMap.php
index bf1d540..dc2e66a 100644
--- a/Http/AccessMap.php
+++ b/Http/AccessMap.php
@@ -36,6 +36,9 @@ class AccessMap implements AccessMapInterface
$this->map[] = array($requestMatcher, $attributes, $channel);
}
+ /**
+ * {@inheritDoc}
+ */
public function getPatterns(Request $request)
{
foreach ($this->map as $elements) {
diff --git a/Http/Authentication/DefaultAuthenticationFailureHandler.php b/Http/Authentication/DefaultAuthenticationFailureHandler.php
index 64f84f0..70dcd1e 100644
--- a/Http/Authentication/DefaultAuthenticationFailureHandler.php
+++ b/Http/Authentication/DefaultAuthenticationFailureHandler.php
@@ -64,7 +64,7 @@ class DefaultAuthenticationFailureHandler implements AuthenticationFailureHandle
{
if ($failureUrl = $request->get($this->options['failure_path_parameter'], null, true)) {
$this->options['failure_path'] = $failureUrl;
- }
+ }
if (null === $this->options['failure_path']) {
$this->options['failure_path'] = $this->options['login_path'];
diff --git a/Http/Authorization/AccessDeniedHandlerInterface.php b/Http/Authorization/AccessDeniedHandlerInterface.php
index 5f60fd6..262ccc5 100644
--- a/Http/Authorization/AccessDeniedHandlerInterface.php
+++ b/Http/Authorization/AccessDeniedHandlerInterface.php
@@ -12,6 +12,7 @@
namespace Symfony\Component\Security\Http\Authorization;
use Symfony\Component\HttpFoundation\Request;
+use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Component\HttpFoundation\Response;
diff --git a/Http/EntryPoint/BasicAuthenticationEntryPoint.php b/Http/EntryPoint/BasicAuthenticationEntryPoint.php
index 44ece5e..e03de7d 100644
--- a/Http/EntryPoint/BasicAuthenticationEntryPoint.php
+++ b/Http/EntryPoint/BasicAuthenticationEntryPoint.php
@@ -30,6 +30,9 @@ class BasicAuthenticationEntryPoint implements AuthenticationEntryPointInterface
$this->realmName = $realmName;
}
+ /**
+ * {@inheritdoc}
+ */
public function start(Request $request, AuthenticationException $authException = null)
{
$response = new Response();
diff --git a/Http/EntryPoint/DigestAuthenticationEntryPoint.php b/Http/EntryPoint/DigestAuthenticationEntryPoint.php
index 1131b58..4029d79 100644
--- a/Http/EntryPoint/DigestAuthenticationEntryPoint.php
+++ b/Http/EntryPoint/DigestAuthenticationEntryPoint.php
@@ -38,6 +38,9 @@ class DigestAuthenticationEntryPoint implements AuthenticationEntryPointInterfac
$this->logger = $logger;
}
+ /**
+ * {@inheritdoc}
+ */
public function start(Request $request, AuthenticationException $authException = null)
{
$expiryTime = microtime(true) + $this->nonceValiditySeconds * 1000;
@@ -62,11 +65,17 @@ class DigestAuthenticationEntryPoint implements AuthenticationEntryPointInterfac
return $response;
}
+ /**
+ * @return string
+ */
public function getKey()
{
return $this->key;
}
+ /**
+ * @return string
+ */
public function getRealmName()
{
return $this->realmName;
diff --git a/Http/EntryPoint/FormAuthenticationEntryPoint.php b/Http/EntryPoint/FormAuthenticationEntryPoint.php
index 3eaae82..45a7ea9 100644
--- a/Http/EntryPoint/FormAuthenticationEntryPoint.php
+++ b/Http/EntryPoint/FormAuthenticationEntryPoint.php
@@ -30,7 +30,7 @@ class FormAuthenticationEntryPoint implements AuthenticationEntryPointInterface
private $httpUtils;
/**
- * Constructor
+ * Constructor.
*
* @param HttpKernelInterface $kernel
* @param HttpUtils $httpUtils An HttpUtils instance
diff --git a/Http/EntryPoint/RetryAuthenticationEntryPoint.php b/Http/EntryPoint/RetryAuthenticationEntryPoint.php
index 532601a..091e0ee 100644
--- a/Http/EntryPoint/RetryAuthenticationEntryPoint.php
+++ b/Http/EntryPoint/RetryAuthenticationEntryPoint.php
@@ -34,6 +34,9 @@ class RetryAuthenticationEntryPoint implements AuthenticationEntryPointInterface
$this->httpsPort = $httpsPort;
}
+ /**
+ * {@inheritdoc}
+ */
public function start(Request $request, AuthenticationException $authException = null)
{
$scheme = $request->isSecure() ? 'http' : 'https';
diff --git a/Http/Event/InteractiveLoginEvent.php b/Http/Event/InteractiveLoginEvent.php
index 2225d92..575352c 100644
--- a/Http/Event/InteractiveLoginEvent.php
+++ b/Http/Event/InteractiveLoginEvent.php
@@ -15,10 +15,14 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\EventDispatcher\Event;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
+/**
+ * InteractiveLoginEvent
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ */
class InteractiveLoginEvent extends Event
{
private $request;
-
private $authenticationToken;
/**
diff --git a/Http/Event/SwitchUserEvent.php b/Http/Event/SwitchUserEvent.php
index 4a7dcaf..a553154 100644
--- a/Http/Event/SwitchUserEvent.php
+++ b/Http/Event/SwitchUserEvent.php
@@ -15,10 +15,14 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Security\Core\User\UserInterface;
use Symfony\Component\EventDispatcher\Event;
+/**
+ * SwitchUserEvent
+ *
+ * @author Fabien Potencier <fabien@symfony.com>
+ */
class SwitchUserEvent extends Event
{
private $request;
-
private $targetUser;
public function __construct(Request $request, UserInterface $targetUser)
@@ -27,11 +31,17 @@ class SwitchUserEvent extends Event
$this->targetUser = $targetUser;
}
+ /**
+ * @return Request
+ */
public function getRequest()
{
return $this->request;
}
+ /**
+ * @return UserInterface
+ */
public function getTargetUser()
{
return $this->targetUser;
diff --git a/Http/Firewall.php b/Http/Firewall.php
index 5a1e9d5..98fda5e 100644
--- a/Http/Firewall.php
+++ b/Http/Firewall.php
@@ -84,6 +84,9 @@ class Firewall implements EventSubscriberInterface
}
}
+ /**
+ * {@inheritDoc}
+ */
public static function getSubscribedEvents()
{
return array(
diff --git a/Http/Firewall/ExceptionListener.php b/Http/Firewall/ExceptionListener.php
index 0cca0c4..c1f29f7 100644
--- a/Http/Firewall/ExceptionListener.php
+++ b/Http/Firewall/ExceptionListener.php
@@ -167,6 +167,13 @@ class ExceptionListener
$event->setResponse($response);
}
+ /**
+ * @param Request $request
+ * @param AuthenticationException $authException
+ *
+ * @return Response
+ * @throws AuthenticationException
+ */
private function startAuthentication(Request $request, AuthenticationException $authException)
{
if (null === $this->authenticationEntryPoint) {
@@ -187,6 +194,9 @@ class ExceptionListener
return $this->authenticationEntryPoint->start($request, $authException);
}
+ /**
+ * @param Request $request
+ */
protected function setTargetPath(Request $request)
{
// session isn't required when using http basic authentication mechanism for example
diff --git a/Http/Firewall/LogoutListener.php b/Http/Firewall/LogoutListener.php
index 653c644..983eab0 100644
--- a/Http/Firewall/LogoutListener.php
+++ b/Http/Firewall/LogoutListener.php
@@ -37,7 +37,7 @@ class LogoutListener implements ListenerInterface
private $csrfProvider;
/**
- * Constructor
+ * Constructor.
*
* @param SecurityContextInterface $securityContext
* @param HttpUtils $httpUtils An HttpUtilsInterface instance
@@ -77,9 +77,8 @@ class LogoutListener implements ListenerInterface
*
* @param GetResponseEvent $event A GetResponseEvent instance
*
- * @throws InvalidCsrfTokenException if the CSRF token is invalid
+ * @throws LogoutException if the CSRF token is invalid
* @throws \RuntimeException if the LogoutSuccessHandlerInterface instance does not return a response
- * @throws LogoutException
*/
public function handle(GetResponseEvent $event)
{
diff --git a/Http/Firewall/RememberMeListener.php b/Http/Firewall/RememberMeListener.php
index 5a856e2..6ca3842 100644
--- a/Http/Firewall/RememberMeListener.php
+++ b/Http/Firewall/RememberMeListener.php
@@ -35,7 +35,7 @@ class RememberMeListener implements ListenerInterface
private $dispatcher;
/**
- * Constructor
+ * Constructor.
*
* @param SecurityContextInterface $securityContext
* @param RememberMeServicesInterface $rememberMeServices
diff --git a/Http/Firewall/X509AuthenticationListener.php b/Http/Firewall/X509AuthenticationListener.php
index 0b5a6ae..5aabf75 100644
--- a/Http/Firewall/X509AuthenticationListener.php
+++ b/Http/Firewall/X509AuthenticationListener.php
@@ -36,6 +36,9 @@ class X509AuthenticationListener extends AbstractPreAuthenticatedListener
$this->credentialKey = $credentialKey;
}
+ /**
+ * {@inheritdoc}
+ */
protected function getPreAuthenticatedData(Request $request)
{
if (!$request->server->has($this->userKey)) {
diff --git a/Http/FirewallMap.php b/Http/FirewallMap.php
index dfc0984..0554bed 100644
--- a/Http/FirewallMap.php
+++ b/Http/FirewallMap.php
@@ -25,11 +25,19 @@ class FirewallMap implements FirewallMapInterface
{
private $map = array();
+ /**
+ * @param RequestMatcherInterface $requestMatcher
+ * @param array $listeners
+ * @param ExceptionListener $exceptionListener
+ */
public function add(RequestMatcherInterface $requestMatcher = null, array $listeners = array(), ExceptionListener $exceptionListener = null)
{
$this->map[] = array($requestMatcher, $listeners, $exceptionListener);
}
+ /**
+ * {@inheritDoc}
+ */
public function getListeners(Request $request)
{
foreach ($this->map as $elements) {
diff --git a/Http/HttpUtils.php b/Http/HttpUtils.php
index c3ff865..65ab914 100644
--- a/Http/HttpUtils.php
+++ b/Http/HttpUtils.php
@@ -20,7 +20,6 @@ use Symfony\Component\Routing\Matcher\RequestMatcherInterface;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
-use Symfony\Component\HttpFoundation\Response;
/**
* Encapsulates the logic needed to create sub-requests, redirect the user, and match URLs.
@@ -37,6 +36,8 @@ class HttpUtils
*
* @param UrlGeneratorInterface $urlGenerator A UrlGeneratorInterface instance
* @param UrlMatcherInterface|RequestMatcherInterface $urlMatcher The Url or Request matcher
+ *
+ * @throws \InvalidArgumentException
*/
public function __construct(UrlGeneratorInterface $urlGenerator = null, $urlMatcher = null)
{
@@ -54,7 +55,7 @@ class HttpUtils
* @param string $path A path (an absolute path (/foo), an absolute URL (http://...), or a route name (foo))
* @param integer $status The status code
*
- * @return Response A RedirectResponse instance
+ * @return RedirectResponse A RedirectResponse instance
*/
public function createRedirectResponse(Request $request, $path, $status = 302)
{
@@ -123,9 +124,11 @@ class HttpUtils
* Generates a URI, based on the given path or absolute URL.
*
* @param Request $request A Request instance
- * @param string $path A path (an absolute path (/foo), an absolute URL (http://...), or a route name (foo))
+ * @param string $path A path (an absolute path (/foo), an absolute URL (http://...), or a route name (foo))
*
* @return string An absolute URL
+ *
+ * @throws \LogicException
*/
public function generateUri($request, $path)
{
diff --git a/Http/RememberMe/AbstractRememberMeServices.php b/Http/RememberMe/AbstractRememberMeServices.php
index ae61dd7..6a47a7a 100644
--- a/Http/RememberMe/AbstractRememberMeServices.php
+++ b/Http/RememberMe/AbstractRememberMeServices.php
@@ -40,7 +40,7 @@ abstract class AbstractRememberMeServices implements RememberMeServicesInterface
private $userProviders;
/**
- * Constructor
+ * Constructor.
*
* @param array $userProviders
* @param string $key
@@ -80,6 +80,9 @@ abstract class AbstractRememberMeServices implements RememberMeServicesInterface
return $this->options['remember_me_parameter'];
}
+ /**
+ * @return string
+ */
public function getKey()
{
return $this->key;
@@ -94,6 +97,7 @@ abstract class AbstractRememberMeServices implements RememberMeServicesInterface
* @return TokenInterface|null
*
* @throws CookieTheftException
+ * @throws \RuntimeException
*/
final public function autoLogin(Request $request)
{
@@ -219,6 +223,9 @@ abstract class AbstractRememberMeServices implements RememberMeServicesInterface
*/
abstract protected function processAutoLoginCookie(array $cookieParts, Request $request);
+ /**
+ * @param Request $request
+ */
protected function onLoginFail(Request $request)
{
}
diff --git a/Http/RememberMe/ResponseListener.php b/Http/RememberMe/ResponseListener.php
index 03c71c7..6087587 100644
--- a/Http/RememberMe/ResponseListener.php
+++ b/Http/RememberMe/ResponseListener.php
@@ -22,6 +22,9 @@ use Symfony\Component\EventDispatcher\EventSubscriberInterface;
*/
class ResponseListener implements EventSubscriberInterface
{
+ /**
+ * @param FilterResponseEvent $event
+ */
public function onKernelResponse(FilterResponseEvent $event)
{
$request = $event->getRequest();
@@ -32,6 +35,9 @@ class ResponseListener implements EventSubscriberInterface
}
}
+ /**
+ * {@inheritDoc}
+ */
public static function getSubscribedEvents()
{
return array(KernelEvents::RESPONSE => 'onKernelResponse');