Skip to content

Commit

Permalink
bug #26774 [SecurityBundle] Add missing argument to security.authenti…
Browse files Browse the repository at this point in the history
…cation.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
  • Loading branch information
nicolas-grekas committed Apr 4, 2018
2 parents 34bb83d + c82c2f1 commit 3c54c4a
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 0 deletions.
Expand Up @@ -49,6 +49,7 @@ public function create(ContainerBuilder $container, $id, $config, $userProvider,
->replaceArgument(0, new Reference($config['authenticator']))
->replaceArgument(1, new Reference($userProvider))
->replaceArgument(2, $id)
->replaceArgument(3, new Reference('security.user_checker.'.$id))
;

// listener
Expand Down
Expand Up @@ -236,6 +236,7 @@
<argument /> <!-- Simple Authenticator -->
<argument /> <!-- User Provider -->
<argument /> <!-- Provider-shared Key -->
<argument>null</argument> <!-- UserChecker -->
</service>

<service id="security.authentication.provider.pre_authenticated" class="%security.authentication.provider.pre_authenticated.class%" abstract="true" public="false">
Expand Down
Expand Up @@ -101,6 +101,13 @@ public function testFirewalls()
'security.authentication.listener.anonymous.with_user_checker',
'security.access_listener',
),
array(
'security.channel_listener',
'security.context_listener.2',
'security.authentication.listener.simple_form.simple_auth',
'security.authentication.listener.anonymous.simple_auth',
'security.access_listener',
),
), $listeners);
}

Expand Down
Expand Up @@ -86,6 +86,11 @@
'anonymous' => true,
'http_basic' => true,
),
'simple_auth' => array(
'provider' => 'default',
'anonymous' => true,
'simple_form' => array('authenticator' => 'simple_authenticator'),
),
),

'access_control' => array(
Expand Down
Expand Up @@ -71,6 +71,11 @@
<user-checker>app.user_checker</user-checker>
</firewall>

<firewall name="simple_auth" provider="default">
<anonymous />
<simple-form authenticator="simple_authenticator" />
</firewall>

<role id="ROLE_ADMIN">ROLE_USER</role>
<role id="ROLE_SUPER_ADMIN">ROLE_USER,ROLE_ADMIN,ROLE_ALLOWED_TO_SWITCH</role>
<role id="ROLE_REMOTE">ROLE_USER,ROLE_ADMIN</role>
Expand Down
Expand Up @@ -70,6 +70,11 @@ security:
http_basic: ~
user_checker: app.user_checker

simple_auth:
provider: default
anonymous: ~
simple_form: { authenticator: simple_authenticator }

role_hierarchy:
ROLE_ADMIN: ROLE_USER
ROLE_SUPER_ADMIN: [ROLE_USER, ROLE_ADMIN, ROLE_ALLOWED_TO_SWITCH]
Expand Down

0 comments on commit 3c54c4a

Please sign in to comment.