Skip to content

Commit 69ca2d5

Browse files
committed
Merge branch '2.2' into 2.3
* 2.2: fixed Client when using the terminable event Fix problem with Windows file links (backslash in JavaScript string) [Security] fixed wrong phpdoc [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/HttpFoundation/Request.php
2 parents a6df56f + 0321aae commit 69ca2d5

18 files changed

+84
-12
lines changed

AccessMap.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ public function add(RequestMatcherInterface $requestMatcher, array $roles = arra
3636
$this->map[] = array($requestMatcher, $roles, $channel);
3737
}
3838

39+
/**
40+
* {@inheritDoc}
41+
*/
3942
public function getPatterns(Request $request)
4043
{
4144
foreach ($this->map as $elements) {

Authentication/DefaultAuthenticationFailureHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public function onAuthenticationFailure(Request $request, AuthenticationExceptio
6464
{
6565
if ($failureUrl = $request->get($this->options['failure_path_parameter'], null, true)) {
6666
$this->options['failure_path'] = $failureUrl;
67-
}
67+
}
6868

6969
if (null === $this->options['failure_path']) {
7070
$this->options['failure_path'] = $this->options['login_path'];

Authorization/AccessDeniedHandlerInterface.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
namespace Symfony\Component\Security\Http\Authorization;
1313

1414
use Symfony\Component\HttpFoundation\Request;
15+
use Symfony\Component\HttpFoundation\Response;
1516
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
1617
use Symfony\Component\HttpFoundation\Response;
1718

EntryPoint/BasicAuthenticationEntryPoint.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ public function __construct($realmName)
3030
$this->realmName = $realmName;
3131
}
3232

33+
/**
34+
* {@inheritdoc}
35+
*/
3336
public function start(Request $request, AuthenticationException $authException = null)
3437
{
3538
$response = new Response();

EntryPoint/DigestAuthenticationEntryPoint.php

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ public function __construct($realmName, $key, $nonceValiditySeconds = 300, Logge
3838
$this->logger = $logger;
3939
}
4040

41+
/**
42+
* {@inheritdoc}
43+
*/
4144
public function start(Request $request, AuthenticationException $authException = null)
4245
{
4346
$expiryTime = microtime(true) + $this->nonceValiditySeconds * 1000;
@@ -62,11 +65,17 @@ public function start(Request $request, AuthenticationException $authException =
6265
return $response;
6366
}
6467

68+
/**
69+
* @return string
70+
*/
6571
public function getKey()
6672
{
6773
return $this->key;
6874
}
6975

76+
/**
77+
* @return string
78+
*/
7079
public function getRealmName()
7180
{
7281
return $this->realmName;

EntryPoint/FormAuthenticationEntryPoint.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ class FormAuthenticationEntryPoint implements AuthenticationEntryPointInterface
3030
private $httpUtils;
3131

3232
/**
33-
* Constructor
33+
* Constructor.
3434
*
3535
* @param HttpKernelInterface $kernel
3636
* @param HttpUtils $httpUtils An HttpUtils instance

EntryPoint/RetryAuthenticationEntryPoint.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@ public function __construct($httpPort = 80, $httpsPort = 443)
3434
$this->httpsPort = $httpsPort;
3535
}
3636

37+
/**
38+
* {@inheritdoc}
39+
*/
3740
public function start(Request $request, AuthenticationException $authException = null)
3841
{
3942
$scheme = $request->isSecure() ? 'http' : 'https';

Event/InteractiveLoginEvent.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@
1515
use Symfony\Component\EventDispatcher\Event;
1616
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
1717

18+
/**
19+
* InteractiveLoginEvent
20+
*
21+
* @author Fabien Potencier <[email protected]>
22+
*/
1823
class InteractiveLoginEvent extends Event
1924
{
2025
private $request;
21-
2226
private $authenticationToken;
2327

2428
/**

Event/SwitchUserEvent.php

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@
1515
use Symfony\Component\Security\Core\User\UserInterface;
1616
use Symfony\Component\EventDispatcher\Event;
1717

18+
/**
19+
* SwitchUserEvent
20+
*
21+
* @author Fabien Potencier <[email protected]>
22+
*/
1823
class SwitchUserEvent extends Event
1924
{
2025
private $request;
21-
2226
private $targetUser;
2327

2428
public function __construct(Request $request, UserInterface $targetUser)
@@ -27,11 +31,17 @@ public function __construct(Request $request, UserInterface $targetUser)
2731
$this->targetUser = $targetUser;
2832
}
2933

34+
/**
35+
* @return Request
36+
*/
3037
public function getRequest()
3138
{
3239
return $this->request;
3340
}
3441

42+
/**
43+
* @return UserInterface
44+
*/
3545
public function getTargetUser()
3646
{
3747
return $this->targetUser;

Firewall.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,9 @@ public function onKernelRequest(GetResponseEvent $event)
7171
}
7272
}
7373

74+
/**
75+
* {@inheritDoc}
76+
*/
7477
public static function getSubscribedEvents()
7578
{
7679
return array(KernelEvents::REQUEST => array('onKernelRequest', 8));

Firewall/ExceptionListener.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -161,6 +161,13 @@ public function onKernelException(GetResponseForExceptionEvent $event)
161161
$event->setResponse($response);
162162
}
163163

164+
/**
165+
* @param Request $request
166+
* @param AuthenticationException $authException
167+
*
168+
* @return Response
169+
* @throws AuthenticationException
170+
*/
164171
private function startAuthentication(Request $request, AuthenticationException $authException)
165172
{
166173
if (null === $this->authenticationEntryPoint) {
@@ -181,6 +188,9 @@ private function startAuthentication(Request $request, AuthenticationException $
181188
return $this->authenticationEntryPoint->start($request, $authException);
182189
}
183190

191+
/**
192+
* @param Request $request
193+
*/
184194
protected function setTargetPath(Request $request)
185195
{
186196
// session isn't required when using http basic authentication mechanism for example

Firewall/LogoutListener.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ class LogoutListener implements ListenerInterface
3737
private $csrfProvider;
3838

3939
/**
40-
* Constructor
40+
* Constructor.
4141
*
4242
* @param SecurityContextInterface $securityContext
4343
* @param HttpUtils $httpUtils An HttpUtilsInterface instance
@@ -77,9 +77,8 @@ public function addHandler(LogoutHandlerInterface $handler)
7777
*
7878
* @param GetResponseEvent $event A GetResponseEvent instance
7979
*
80-
* @throws InvalidCsrfTokenException if the CSRF token is invalid
80+
* @throws LogoutException if the CSRF token is invalid
8181
* @throws \RuntimeException if the LogoutSuccessHandlerInterface instance does not return a response
82-
* @throws LogoutException
8382
*/
8483
public function handle(GetResponseEvent $event)
8584
{

Firewall/RememberMeListener.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ class RememberMeListener implements ListenerInterface
3535
private $dispatcher;
3636

3737
/**
38-
* Constructor
38+
* Constructor.
3939
*
4040
* @param SecurityContextInterface $securityContext
4141
* @param RememberMeServicesInterface $rememberMeServices

Firewall/X509AuthenticationListener.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ public function __construct(SecurityContextInterface $securityContext, Authentic
3636
$this->credentialKey = $credentialKey;
3737
}
3838

39+
/**
40+
* {@inheritdoc}
41+
*/
3942
protected function getPreAuthenticatedData(Request $request)
4043
{
4144
if (!$request->server->has($this->userKey)) {

FirewallMap.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,19 @@ class FirewallMap implements FirewallMapInterface
2525
{
2626
private $map = array();
2727

28+
/**
29+
* @param RequestMatcherInterface $requestMatcher
30+
* @param array $listeners
31+
* @param ExceptionListener $exceptionListener
32+
*/
2833
public function add(RequestMatcherInterface $requestMatcher = null, array $listeners = array(), ExceptionListener $exceptionListener = null)
2934
{
3035
$this->map[] = array($requestMatcher, $listeners, $exceptionListener);
3136
}
3237

38+
/**
39+
* {@inheritDoc}
40+
*/
3341
public function getListeners(Request $request)
3442
{
3543
foreach ($this->map as $elements) {

HttpUtils.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@
2020
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
2121
use Symfony\Component\Routing\Exception\MethodNotAllowedException;
2222
use Symfony\Component\Routing\Exception\ResourceNotFoundException;
23-
use Symfony\Component\HttpFoundation\Response;
2423

2524
/**
2625
* Encapsulates the logic needed to create sub-requests, redirect the user, and match URLs.
@@ -37,6 +36,8 @@ class HttpUtils
3736
*
3837
* @param UrlGeneratorInterface $urlGenerator A UrlGeneratorInterface instance
3938
* @param UrlMatcherInterface|RequestMatcherInterface $urlMatcher The Url or Request matcher
39+
*
40+
* @throws \InvalidArgumentException
4041
*/
4142
public function __construct(UrlGeneratorInterface $urlGenerator = null, $urlMatcher = null)
4243
{
@@ -54,7 +55,7 @@ public function __construct(UrlGeneratorInterface $urlGenerator = null, $urlMatc
5455
* @param string $path A path (an absolute path (/foo), an absolute URL (http://...), or a route name (foo))
5556
* @param integer $status The status code
5657
*
57-
* @return Response A RedirectResponse instance
58+
* @return RedirectResponse A RedirectResponse instance
5859
*/
5960
public function createRedirectResponse(Request $request, $path, $status = 302)
6061
{
@@ -123,9 +124,11 @@ public function checkRequestPath(Request $request, $path)
123124
* Generates a URI, based on the given path or absolute URL.
124125
*
125126
* @param Request $request A Request instance
126-
* @param string $path A path (an absolute path (/foo), an absolute URL (http://...), or a route name (foo))
127+
* @param string $path A path (an absolute path (/foo), an absolute URL (http://...), or a route name (foo))
127128
*
128129
* @return string An absolute URL
130+
*
131+
* @throws \LogicException
129132
*/
130133
public function generateUri($request, $path)
131134
{

RememberMe/AbstractRememberMeServices.php

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ abstract class AbstractRememberMeServices implements RememberMeServicesInterface
4040
private $userProviders;
4141

4242
/**
43-
* Constructor
43+
* Constructor.
4444
*
4545
* @param array $userProviders
4646
* @param string $key
@@ -80,6 +80,9 @@ public function getRememberMeParameter()
8080
return $this->options['remember_me_parameter'];
8181
}
8282

83+
/**
84+
* @return string
85+
*/
8386
public function getKey()
8487
{
8588
return $this->key;
@@ -94,6 +97,7 @@ public function getKey()
9497
* @return TokenInterface|null
9598
*
9699
* @throws CookieTheftException
100+
* @throws \RuntimeException
97101
*/
98102
final public function autoLogin(Request $request)
99103
{
@@ -219,6 +223,9 @@ final public function loginSuccess(Request $request, Response $response, TokenIn
219223
*/
220224
abstract protected function processAutoLoginCookie(array $cookieParts, Request $request);
221225

226+
/**
227+
* @param Request $request
228+
*/
222229
protected function onLoginFail(Request $request)
223230
{
224231
}

RememberMe/ResponseListener.php

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
*/
2323
class ResponseListener implements EventSubscriberInterface
2424
{
25+
/**
26+
* @param FilterResponseEvent $event
27+
*/
2528
public function onKernelResponse(FilterResponseEvent $event)
2629
{
2730
$request = $event->getRequest();
@@ -32,6 +35,9 @@ public function onKernelResponse(FilterResponseEvent $event)
3235
}
3336
}
3437

38+
/**
39+
* {@inheritDoc}
40+
*/
3541
public static function getSubscribedEvents()
3642
{
3743
return array(KernelEvents::RESPONSE => 'onKernelResponse');

0 commit comments

Comments
 (0)