Added doc comments
This commit is contained in:
parent
6a36fb6311
commit
7ee39a630d
@ -36,6 +36,9 @@ class AccessMap implements AccessMapInterface
|
||||
$this->map[] = array($requestMatcher, $roles, $channel);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public function getPatterns(Request $request)
|
||||
{
|
||||
foreach ($this->map as $elements) {
|
||||
|
@ -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'];
|
||||
|
@ -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;
|
||||
|
||||
|
@ -30,6 +30,9 @@ class BasicAuthenticationEntryPoint implements AuthenticationEntryPointInterface
|
||||
$this->realmName = $realmName;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function start(Request $request, AuthenticationException $authException = null)
|
||||
{
|
||||
$response = new Response();
|
||||
|
@ -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;
|
||||
|
@ -30,7 +30,7 @@ class FormAuthenticationEntryPoint implements AuthenticationEntryPointInterface
|
||||
private $httpUtils;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* Constructor.
|
||||
*
|
||||
* @param HttpKernelInterface $kernel
|
||||
* @param HttpUtils $httpUtils An HttpUtils instance
|
||||
|
@ -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';
|
||||
|
@ -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;
|
||||
|
||||
/**
|
||||
|
@ -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;
|
||||
|
@ -71,6 +71,9 @@ class Firewall implements EventSubscriberInterface
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritDoc}
|
||||
*/
|
||||
public static function getSubscribedEvents()
|
||||
{
|
||||
return array(KernelEvents::REQUEST => array('onKernelRequest', 8));
|
||||
|
@ -161,6 +161,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) {
|
||||
@ -181,6 +188,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
|
||||
|
@ -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)
|
||||
{
|
||||
|
@ -35,7 +35,7 @@ class RememberMeListener implements ListenerInterface
|
||||
private $dispatcher;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* Constructor.
|
||||
*
|
||||
* @param SecurityContextInterface $securityContext
|
||||
* @param RememberMeServicesInterface $rememberMeServices
|
||||
|
@ -36,6 +36,9 @@ class X509AuthenticationListener extends AbstractPreAuthenticatedListener
|
||||
$this->credentialKey = $credentialKey;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
protected function getPreAuthenticatedData(Request $request)
|
||||
{
|
||||
if (!$request->server->has($this->userKey)) {
|
||||
|
@ -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) {
|
||||
|
@ -13,6 +13,7 @@ namespace Symfony\Component\Security\Http;
|
||||
|
||||
use Symfony\Component\Security\Core\SecurityContextInterface;
|
||||
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpFoundation\RedirectResponse;
|
||||
use Symfony\Component\Routing\Matcher\UrlMatcherInterface;
|
||||
@ -37,6 +38,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)
|
||||
{
|
||||
@ -123,9 +126,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)
|
||||
{
|
||||
|
@ -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)
|
||||
{
|
||||
}
|
||||
|
@ -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');
|
||||
|
Reference in New Issue
Block a user