#21809 [SecurityBundle] bugfix: if security provider's name contains upper cases then container didn't compile
This commit is contained in:
parent
a6b20d1e5c
commit
6d23c8c41c
@ -509,7 +509,7 @@ class SecurityExtension extends Extension
|
|||||||
// Parses a <provider> tag and returns the id for the related user provider service
|
// Parses a <provider> tag and returns the id for the related user provider service
|
||||||
private function createUserDaoProvider($name, $provider, ContainerBuilder $container)
|
private function createUserDaoProvider($name, $provider, ContainerBuilder $container)
|
||||||
{
|
{
|
||||||
$name = $this->getUserProviderId(strtolower($name));
|
$name = $this->getUserProviderId($name);
|
||||||
|
|
||||||
// Doctrine Entity and In-memory DAO provider are managed by factories
|
// Doctrine Entity and In-memory DAO provider are managed by factories
|
||||||
foreach ($this->userProviderFactories as $factory) {
|
foreach ($this->userProviderFactories as $factory) {
|
||||||
@ -533,7 +533,7 @@ class SecurityExtension extends Extension
|
|||||||
if (isset($provider['chain'])) {
|
if (isset($provider['chain'])) {
|
||||||
$providers = array();
|
$providers = array();
|
||||||
foreach ($provider['chain']['providers'] as $providerName) {
|
foreach ($provider['chain']['providers'] as $providerName) {
|
||||||
$providers[] = new Reference($this->getUserProviderId(strtolower($providerName)));
|
$providers[] = new Reference($this->getUserProviderId($providerName));
|
||||||
}
|
}
|
||||||
|
|
||||||
$container
|
$container
|
||||||
@ -548,7 +548,7 @@ class SecurityExtension extends Extension
|
|||||||
|
|
||||||
private function getUserProviderId($name)
|
private function getUserProviderId($name)
|
||||||
{
|
{
|
||||||
return 'security.user.provider.concrete.'.$name;
|
return 'security.user.provider.concrete.'.strtolower($name);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function createExceptionListener($container, $config, $id, $defaultEntryPoint, $stateless)
|
private function createExceptionListener($container, $config, $id, $defaultEntryPoint, $stateless)
|
||||||
|
@ -0,0 +1,16 @@
|
|||||||
|
<?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.
|
||||||
|
*/
|
||||||
|
|
||||||
|
return array(
|
||||||
|
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
|
||||||
|
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
|
||||||
|
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
|
||||||
|
);
|
@ -0,0 +1,30 @@
|
|||||||
|
imports:
|
||||||
|
- { resource: ./../config/framework.yml }
|
||||||
|
|
||||||
|
doctrine:
|
||||||
|
dbal:
|
||||||
|
driver: pdo_sqlite
|
||||||
|
memory: true
|
||||||
|
charset: UTF8
|
||||||
|
|
||||||
|
orm:
|
||||||
|
entity_managers:
|
||||||
|
default:
|
||||||
|
|
||||||
|
auto_mapping: true
|
||||||
|
|
||||||
|
security:
|
||||||
|
providers:
|
||||||
|
camelCasedName:
|
||||||
|
entity:
|
||||||
|
class: Symfony\Component\Security\Core\User\User
|
||||||
|
|
||||||
|
firewalls:
|
||||||
|
default:
|
||||||
|
anonymous: ~
|
||||||
|
provider: camelCasedName
|
||||||
|
|
||||||
|
encoders:
|
||||||
|
Symfony\Component\Security\Core\User\User: plaintext
|
||||||
|
|
||||||
|
|
@ -0,0 +1,20 @@
|
|||||||
|
<?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\Bundle\SecurityBundle\Tests\Functional;
|
||||||
|
|
||||||
|
class CamelCasedProvidersCausesExceptionsTest extends WebTestCase
|
||||||
|
{
|
||||||
|
public function testBugfixExceptionThenCamelCasedProviderIsGiven()
|
||||||
|
{
|
||||||
|
$client = $this->createClient(array('test_case' => 'CamelCasedProviders', 'root_config' => 'config.yml'));
|
||||||
|
}
|
||||||
|
}
|
Reference in New Issue
Block a user