8000 bug #26774 [SecurityBundle] Add missing argument to security.authenti… · symfony/symfony@3c54c4a · GitHub
[go: up one dir, main page]

Skip to content

Commit 3c54c4a

Browse files
bug #26774 [SecurityBundle] Add missing argument to security.authentication.provider.simple (i3or1s, chalasr)
This PR was merged into the 2.8 branch. Discussion ---------- [SecurityBundle] Add missing argument to security.authentication.provider.simple | Q | A | ------------- | --- | Branch? | 3.4 | Bug fix? | yes | New feature? | no | BC breaks? | no | Deprecations? | no | Tests pass? | yes | Fixed tickets | #26753 | License | MIT | Doc PR | - Created PR in relation to a conversation in [PR](#26762) #26762 Commits ------- c82c2f1 [SecurityBundle] Add test for simple authentication config 1b26aac [SecurityBundle] Add missing argument to security.authentication.provider.simple
2 parents 34bb83d + c82c2f1 commit 3c54c4a

File tree

6 files changed

+24
-0
lines changed

6 files changed

+24
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ public function create(ContainerBuilder $container, $id, $config, $userProvider,
4949
->replaceArgument(0, new Reference($config['authenticator']))
5050
->replaceArgument(1, new Reference($userProvider))
5151
->replaceArgument(2, $id)
52+
->replaceArgument(3, new Reference('security.user_checker.'.$id))
5253
;
5354

5455
// listener

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,7 @@
236236
<argument /> <!-- Simple Authenticator -->
237237
<argument /> <!-- User Provider -->
238238
<argument /> <!-- Provider-shared Key -->
239+
<argument>null</argument> <!-- UserChecker -->
239240
</service>
240241

241242
<service id="security.authentication.provider.pre_authenticated" class="%security.authentication.provider.pre_authenticated.class%" abstract="true" public="false">

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTest.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,13 @@ public function testFirewalls()
101101
'security.authentication.listener.anonymous.with_user_checker',
102102
'security.access_listener',
103103
),
104+
array(
105+
'security.channel_listener',
106+
'security.context_listener.2',
107+
'security.authentication.listener.simple_form.simple_auth',
108+
'security.authentication.listener.anonymous.simple_auth',
109+
'security.access_listener',
110+
),
104111
), $listeners);
105112
}
106113

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@
8686
'anonymous' => true,
8787
'http_basic' => true,
8888
),
89+
'simple_auth' => array(
90+
'provider' => 'default',
91+
'anonymous' => true,
92+
'simple_form' => array('authenticator' => 'simple_authenticator'),
93+
),
8994
),
9095

9196
'access_control' => array(

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/xml/container1.xml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,11 @@
7171
<user-checker>app.user_checker</user-checker>
7272
</firewall>
7373

74+
<firewall name="simple_auth" provider="default">
75+
<anonymous />
76+
<simple-form authenticator="simple_authenticator" />
77+
</firewall>
78+
7479
<role id="ROLE_ADMIN">ROLE_USER</role>
7580
<role id="ROLE_SUPER_ADMIN">ROLE_USER,ROLE_ADMIN,ROLE_ALLOWED_TO_SWITCH</role>
7681
<role id="ROLE_REMOTE">ROLE_USER,ROLE_ADMIN</role>

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/yml/container1.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ security:
7070
http_basic: ~
7171
user_checker: app.user_checker
7272

73+
simple_auth:
74+
provider: default
75+
anonymous: ~
76+
simple_form: { authenticator: simple_authenticator }
77+
7378
role_hierarchy:
7479
ROLE_ADMIN: ROLE_USER
7580
ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]

0 commit comments

Comments
 (0)
0