diff options
author | Fabien Potencier <fabien.potencier@gmail.com> | 2015-07-26 11:09:51 +0200 |
---|---|---|
committer | Fabien Potencier <fabien.potencier@gmail.com> | 2015-07-26 11:09:51 +0200 |
commit | 365eb182a78b1688d8f0d2b97843cd38432963fa (patch) | |
tree | 562df7ba6d927730d6d1097f3f6a46c790e8dd1e | |
parent | 8fe231fc0510fcd1c8ed2259044783a82551f830 (diff) | |
parent | ba8446776f5a32d3c1a6ae82ea28f8c9ab81026b (diff) | |
download | symfony-security-365eb182a78b1688d8f0d2b97843cd38432963fa.zip symfony-security-365eb182a78b1688d8f0d2b97843cd38432963fa.tar.gz symfony-security-365eb182a78b1688d8f0d2b97843cd38432963fa.tar.bz2 |
Merge branch '2.8'
* 2.8:
[Yaml] throw a ParseException on invalid data type
[TwigBridge] type-dependent path discovery
Resources as string have the same problem
Introduce failing test case when a SplFileInfo object is passed to the extract() method in the TwigExtractor.
#15331 add infos about deprecated classes to UPGRADE-3.0
[Asset] removed unused private property.
[Twig+FrameworkBundle] Fix forward compat with Form 2.8
[2.6] Static Code Analysis for Components
[Security/Http] Fix test relying on a private property
[Serializer] Fix bugs reported in https://github.com/symfony/symfony/commit/b5990be49149501bef7bb83a797a1aea2eb5fbe0#commitcomment-12301266
[Form] Fix not-BC test assertion
[Security] Moved Simple{Form,Pre}AuthenticatorInterfaces to Security\Http
[Security] removed useless else condition in SwitchUserListener class.
[travis] Tests deps=low with PHP 5.6
Implement resettable containers
[Console] Fix console output with closed stdout
-rw-r--r-- | CHANGELOG.md | 4 | ||||
-rw-r--r-- | Core/Authentication/SimpleFormAuthenticatorInterface.php | 2 | ||||
-rw-r--r-- | Core/Authentication/SimplePreAuthenticatorInterface.php | 2 | ||||
-rw-r--r-- | Http/Authentication/SimpleFormAuthenticatorInterface.php | 21 | ||||
-rw-r--r-- | Http/Authentication/SimplePreAuthenticatorInterface.php | 21 | ||||
-rw-r--r-- | Http/Firewall/SwitchUserListener.php | 4 | ||||
-rw-r--r-- | Http/Tests/Firewall/AnonymousAuthenticationListenerTest.php | 7 |
7 files changed, 55 insertions, 6 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md index 2b601a5..f202692 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -6,6 +6,10 @@ CHANGELOG * deprecated `getKey()` of the `AnonymousToken`, `RememberMeToken` and `AbstractRememberMeServices` classes in favor of `getSecret()`. + * deprecated `Symfony\Component\Security\Core\Authentication\SimplePreAuthenticatorInterface`, use + `Symfony\Component\Security\Http\Authentication\SimplePreAuthenticatorInterface` instead + * deprecated `Symfony\Component\Security\Core\Authentication\SimpleFormAuthenticatorInterface`, use + `Symfony\Component\Security\Http\Authentication\SimpleFormAuthenticatorInterface` instead 2.7.0 ----- diff --git a/Core/Authentication/SimpleFormAuthenticatorInterface.php b/Core/Authentication/SimpleFormAuthenticatorInterface.php index 95ee881..ae2b58b 100644 --- a/Core/Authentication/SimpleFormAuthenticatorInterface.php +++ b/Core/Authentication/SimpleFormAuthenticatorInterface.php @@ -14,6 +14,8 @@ namespace Symfony\Component\Security\Core\Authentication; use Symfony\Component\HttpFoundation\Request; /** + * @deprecated Deprecated since version 2.8, to be removed in 3.0. Use the same interface from Security\Http\Authentication instead. + * * @author Jordi Boggiano <j.boggiano@seld.be> */ interface SimpleFormAuthenticatorInterface extends SimpleAuthenticatorInterface diff --git a/Core/Authentication/SimplePreAuthenticatorInterface.php b/Core/Authentication/SimplePreAuthenticatorInterface.php index 6164e7d..c01f064 100644 --- a/Core/Authentication/SimplePreAuthenticatorInterface.php +++ b/Core/Authentication/SimplePreAuthenticatorInterface.php @@ -14,6 +14,8 @@ namespace Symfony\Component\Security\Core\Authentication; use Symfony\Component\HttpFoundation\Request; /** + * @deprecated Since version 2.8, to be removed in 3.0. Use the same interface from Security\Http\Authentication instead. + * * @author Jordi Boggiano <j.boggiano@seld.be> */ interface SimplePreAuthenticatorInterface extends SimpleAuthenticatorInterface diff --git a/Http/Authentication/SimpleFormAuthenticatorInterface.php b/Http/Authentication/SimpleFormAuthenticatorInterface.php new file mode 100644 index 0000000..112688c --- /dev/null +++ b/Http/Authentication/SimpleFormAuthenticatorInterface.php @@ -0,0 +1,21 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Security\Http\Authentication; + +use Symfony\Component\Security\Core\Authentication\SimpleFormAuthenticatorInterface as BaseSimpleFormAuthenticatorInterface; + +/** + * @author Jordi Boggiano <j.boggiano@seld.be> + */ +interface SimpleFormAuthenticatorInterface extends BaseSimpleFormAuthenticatorInterface +{ +} diff --git a/Http/Authentication/SimplePreAuthenticatorInterface.php b/Http/Authentication/SimplePreAuthenticatorInterface.php new file mode 100644 index 0000000..afa8049 --- /dev/null +++ b/Http/Authentication/SimplePreAuthenticatorInterface.php @@ -0,0 +1,21 @@ +<?php + +/* + * This file is part of the Symfony package. + * + * (c) Fabien Potencier <fabien@symfony.com> + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Symfony\Component\Security\Http\Authentication; + +use Symfony\Component\Security\Core\Authentication\SimplePreAuthenticatorInterface as BaseSimplePreAuthenticatorInterface; + +/** + * @author Jordi Boggiano <j.boggiano@seld.be> + */ +interface SimplePreAuthenticatorInterface extends BaseSimplePreAuthenticatorInterface +{ +} diff --git a/Http/Firewall/SwitchUserListener.php b/Http/Firewall/SwitchUserListener.php index 8746d2b..7c068fe 100644 --- a/Http/Firewall/SwitchUserListener.php +++ b/Http/Firewall/SwitchUserListener.php @@ -115,9 +115,9 @@ class SwitchUserListener implements ListenerInterface if (false !== $originalToken) { if ($token->getUsername() === $request->get($this->usernameParameter)) { return $token; - } else { - throw new \LogicException(sprintf('You are already switched to "%s" user.', $token->getUsername())); } + + throw new \LogicException(sprintf('You are already switched to "%s" user.', $token->getUsername())); } if (false === $this->accessDecisionManager->decide($token, array($this->role))) { diff --git a/Http/Tests/Firewall/AnonymousAuthenticationListenerTest.php b/Http/Tests/Firewall/AnonymousAuthenticationListenerTest.php index 6188962..d99b562 100644 --- a/Http/Tests/Firewall/AnonymousAuthenticationListenerTest.php +++ b/Http/Tests/Firewall/AnonymousAuthenticationListenerTest.php @@ -54,10 +54,9 @@ class AnonymousAuthenticationListenerTest extends \PHPUnit_Framework_TestCase $authenticationManager ->expects($this->once()) ->method('authenticate') - ->with(self::logicalAnd( - $this->isInstanceOf('Symfony\Component\Security\Core\Authentication\Token\AnonymousToken'), - $this->attributeEqualTo('secret', 'TheSecret') - )) + ->with($this->callback(function ($token) { + return 'TheSecret' === $token->getSecret(); + })) ->will($this->returnValue($anonymousToken)) ; |