10000 Merge branch '4.0' into 4.1 · palex-fpt/symfony@8bbda2c · GitHub
[go: up one dir, main page]

Skip to content

Commit 8bbda2c

Browse files
Merge branch '4.0' into 4.1
* 4.0: fixed CS Avoiding session migration for stateless firewall UsernamePasswordJsonAuthenticationListener fixed CS Avoid migration on stateless firewalls [Serializer] deserialize from xml: Fix a collection that contains the only one element [PhpUnitBridge] Fix error on some Windows OS [DI] Deduplicate generated proxy classes
2 parents 836f121 + e540a16 commit 8bbda2c

24 files changed

+493
-27
lines changed

src/Symfony/Bridge/PhpUnit/bin/simple-phpunit

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,8 @@ if (!file_exists("$PHPUNIT_DIR/phpunit-$PHPUNIT_VERSION/phpunit") || md5_file(__
9999
throw new \RuntimeException("Could not find $remoteZip");
100100
}
101101
stream_copy_to_stream($remoteZipStream, fopen("$PHPUNIT_VERSION.zip", 'wb'));
102+
} elseif ('\\' === DIRECTORY_SEPARATOR) {
103+
passthru("certutil -urlcache -split -f \"https://github.com/sebastianbergmann/phpunit/archive/$PHPUNIT_VERSION.zip\" $PHPUNIT_VERSION.zip");
102104
} else {
103105
@unlink("$PHPUNIT_VERSION.zip");
104106
passthru("wget -q https://github.com/sebastianbergmann/phpunit/archive/$PHPUNIT_VERSION.zip");

src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/GuardAuthenticationFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public function create(ContainerBuilder $container, $id, $config, $userProvider,
8080
$listener = $container->setDefinition($listenerId, new ChildDefinition('security.authentication.listener.guard'));
8181
$listener->replaceArgument(2, $id);
8282
$listener->replaceArgument(3, $authenticators);
83+
$listener->addMethodCall('setSessionAuthenticationStrategy', array(new Reference('security.authentication.session_strategy.'.$id)));
8384

8485
// determine the entryPointId to use
8586
$entryPointId = $this->determineEntryPoint($defaultEntryPoint, $config);

src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/HttpBasicFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ public function create(ContainerBuilder $container, $id, $config, $userProvider,
4141
$listener = $container->setDefinition($listenerId, new ChildDefinition('security.authentication.listener.basic'));
4242
$listener->replaceArgument(2, $id);
4343
$listener->replaceArgument(3, new Reference($entryPointId));
44+
$listener->addMethodCall('setSessionAuthenticationStrategy', array(new Reference('security.authentication.session_strategy.'.$id)));
4445

4546
return array($provider, $listenerId, $entryPointId);
4647
}

src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/JsonLoginFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ protected function createListener($container, $id, $config, $userProvider)
8989
$listener->replaceArgument(4, isset($config['success_handler']) ? new Reference($this->createAuthenticationSuccessHandler($container, $id, $config)) : null);
9090
$listener->replaceArgument(5, isset($config['failure_handler']) ? new Reference($this->createAuthenticationFailureHandler($container, $id, $config)) : null);
9191
$listener->replaceArgument(6, array_intersect_key($config, $this->options));
92+
$listener->addMethodCall('setSessionAuthenticationStrategy', array(new Reference('security.authentication.session_strategy.'.$id)));
9293

9394
$listenerId .= '.'.$id;
9495
$container->setDefinition($listenerId, $listener);

src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/RemoteUserFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ public function create(ContainerBuilder $container, $id, $config, $userProvider,
3838
$listener = $container->setDefinition($listenerId, new ChildDefinition('security.authentication.listener.remote_user'));
3939
$listener->replaceArgument(2, $id);
4040
$listener->replaceArgument(3, $config['user']);
41+
$listener->addMethodCall('setSessionAuthenticationStrategy', array(new Reference('security.authentication.session_strategy.'.$id)));
4142

4243
return array($providerId, $listenerId, $defaultEntryPoint);
4344
}

src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/SimplePreAuthenticationFactory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public function create(ContainerBuilder $container, $id, $config, $userProvider,
5757
$listener = $container->setDefinition($listenerId, new ChildDefinition('security.authentication.listener.simple_preauth'));
5858
$listener->replaceArgument(2, $id);
5959
$listener->replaceArgument(3, new Reference($config['authenticator']));
60+
$listener->addMethodCall('setSessionAuthenticationStrategy', array(new Reference('security.authentication.session_strategy.'.$id)));
6061

6162
return array($provider, $listenerId, null);
6263
}

src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/X509Factory.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public function create(ContainerBuilder $container, $id, $config, $userProvider,
3939
$listener->replaceArgument(2, $id);
4040
$listener->replaceArgument(3, $config['user']);
4141
$listener->replaceArgument(4, $config['credentials']);
42+
$listener->addMethodCall('setSessionAuthenticationStrategy', array(new Reference('security.authentication.session_strategy.'.$id)));
4243

4344
return array($providerId, $listenerId, $defaultEntryPoint);
4445
}

src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -285,7 +285,11 @@ private function createFirewall(ContainerBuilder $container, $id, $firewall, &$a
285285
}
286286

287287
$listeners[] = new Reference($this->createContextListener($container, $contextKey));
288+
$sessionStrategyId = 'security.authentication.session_strategy';
289+
} else {
290+
$sessionStrategyId = 'security.authentication.session_strategy_noop';
288291
}
292+
$container->setAlias(new Alias('security.authentication.session_strategy.'.$id, false), $sessionStrategyId);
289293

290294
$config->replaceArgument(6, $contextKey);
291295

src/Symfony/Bundle/SecurityBundle/Resources/config/security.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@
6464
</service>
6565
<service id="Symfony\Component\Security\Http\Session\SessionAuthenticationStrategyInterface" alias="security.authentication.session_strategy" />
6666

67+
<service id="security.authentication.session_strategy_noop" class="Symfony\Component\Security\Http\Session\SessionAuthenticationStrategy" public="false">
68+
<argument>none</argument>
69+
</service>
70+
6771
<service id="security.encoder_factory.generic" class="Symfony\Component\Security\Core\Encoder\EncoderFactory">
6872
<argument type="collection" />
6973
</service>

src/Symfony/Bundle/SecurityBundle/composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
"require": {
1919
"php": "^7.1.3",
2020
"ext-xml": "*",
21-
"symfony/security": "~4.1",
21+
"symfony/security": "^4.1.1",
2222
"symfony/dependency-injection": "^3.4.3|^4.0.3",
2323
"symfony/http-kernel": "^4.1"
2424
},

0 commit comments

Comments
 (0)
0