Skip to content

[SecurityBundle][Security][Translation] trigger some deprecations for legacy methods #25131

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 26, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions UPGRADE-4.1.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
UPGRADE FROM 4.0 to 4.1
=======================

Security
--------

* The `ContextListener::setLogoutOnUserChange()` method is deprecated and will be removed in 5.0.

SecurityBundle
--------------

* The `logout_on_user_change` firewall option is deprecated and will be removed in 5.0.

Translation
-----------

* The `FileDumper::setBackup()` method is deprecated and will be removed in 5.0.
* The `TranslationWriter::disableBackup()` method is deprecated and will be removed in 5.0.
18 changes: 18 additions & 0 deletions UPGRADE-5.0.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
UPGRADE FROM 4.x to 5.0
=======================

Security
--------

* The `ContextListener::setLogoutOnUserChange()` method has been removed.

SecurityBundle
--------------

* The `logout_on_user_change` firewall option has been removed.

Translation
-----------

* The `FileDumper::setBackup()` method has been removed.
* The `TranslationWriter::disableBackup()` method has been removed.
5 changes: 5 additions & 0 deletions src/Symfony/Bundle/SecurityBundle/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
CHANGELOG
=========

4.1.0
-----

* The `logout_on_user_change` firewall option is deprecated and will be removed in 5.0.

4.0.0
-----

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@ private function addFirewallsSection(ArrayNodeDefinition $rootNode, array $facto
->booleanNode('logout_on_user_change')
->defaultTrue()
->info('When true, it will trigger a logout for the user if something has changed.')
->setDeprecated('The "%path%.%node%" configuration key has been deprecated in Symfony 4.1 and will be removed in 5.0.')
->end()
->arrayNode('logout')
->treatTrueLike(array())
Expand Down Expand Up @@ -290,17 +291,6 @@ private function addFirewallsSection(ArrayNodeDefinition $rootNode, array $facto
return $firewall;
})
->end()
->validate()
->ifTrue(function ($v) {
return (isset($v['stateless']) && true === $v['stateless']) || (isset($v['security']) && false === $v['security']);
})
->then(function ($v) {
// this option doesn't change behavior when true when stateless, so prevent deprecations
$v['logout_on_user_change'] = true;

return $v;
})
->end()
;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,8 +181,6 @@ private function createFirewalls($config, ContainerBuilder $container)
$customUserChecker = true;
}

$contextListenerDefinition->addMethodCall('setLogoutOnUserChange', array($firewall['logout_on_user_change']));

$configId = 'security.firewall.map.config.'.$name;

list($matcher, $listeners, $exceptionListener) = $this->createFirewall($container, $name, $firewall, $authenticationProviders, $providerIds, $configId);
Expand Down Expand Up @@ -410,7 +408,7 @@ private function createAuthenticationListeners($container, $id, $firewall, &$aut
throw new InvalidConfigurationException(sprintf('Invalid firewall "%s": user provider "%s" not found.', $id, $firewall[$key]['provider']));
}
$userProvider = $providerIds[$normalizedName];
} elseif($defaultProvider) {
} elseif ($defaultProvider) {
$userProvider = $defaultProvider;
} else {
throw new InvalidConfigurationException(sprintf('Not configuring explicitly the provider for the "%s" listener on "%s" firewall is ambiguous as there is more than one registered provider.', $key, $id));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
'main' => array(
'form_login' => false,
'http_basic' => null,
'logout_on_user_change' => true,
),
),
));
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@
'logout' => true,
'remember_me' => array('secret' => 'TheSecret'),
'user_checker' => null,
'logout_on_user_change' => true,
),
'host' => array(
'provider' => 'default',
Expand All @@ -81,14 +80,12 @@
'methods' => array('GET', 'POST'),
'anonymous' => true,
'http_basic' => true,
'logout_on_user_change' => true,
),
'with_user_checker' => array(
'provider' => 'default',
'user_checker' => 'app.user_checker',
'anonymous' => true,
'http_basic' => true,
'logout_on_user_change' => true,
),
),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,10 @@
'main' => array(
'provider' => 'default',
'form_login' => true,
'logout_on_user_change' => true,
),
'other' => array(
'provider' => 'with-dash',
'form_login' => true,
'logout_on_user_change' => true,
),
),
));
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
'main' => array(
'provider' => 'undefined',
'form_login' => true,
'logout_on_user_change' => true,
),
),
));
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
'firewalls' => array(
'main' => array(
'form_login' => array('provider' => 'default'),
'logout_on_user_change' => true,
),
),
));
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
'firewalls' => array(
'main' => array(
'form_login' => array('provider' => 'undefined'),
'logout_on_user_change' => true,
),
),
));
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
'main' => array(
'form_login' => false,
'http_basic' => null,
'logout_on_user_change' => true,
),
),

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
'form_login' => array(
'login_path' => '/login',
),
'logout_on_user_change' => true,
),
),
'role_hierarchy' => array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
'catch_exceptions' => false,
'token_provider' => 'token_provider_id',
),
'logout_on_user_change' => true,
),
),
));
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

<provider name="default" id="foo" />

<firewall name="main" logout-on-user-change="true">
<firewall name="main">
<form-login login-path="/login" />
</firewall>
</config>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@
<remember-me secret="TheSecret"/>
</firewall>

<firewall name="host" pattern="/test" host="foo\.example\.org" methods="GET,POST" logout-on-user-change="true" provider="default">
<firewall name="host" pattern="/test" host="foo\.example\.org" methods="GET,POST" provider="default">
<anonymous />
<http-basic />
</firewall>

<firewall name="with_user_checker" logout-on-user-change="true" provider="default">
<firewall name="with_user_checker" provider="default">
<anonymous />
<http-basic />
<user-checker>app.user_checker</user-checker>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</sec:providers>

<sec:firewalls>
<sec:firewall name="main" provider="with-dash" logout-on-user-change="true">
<sec:firewall name="main" provider="with-dash">
<sec:form_login />
</sec:firewall>
</sec:firewalls>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</sec:providers>

<sec:firewalls>
<sec:firewall name="main" provider="undefined" logout-on-user-change="true">
<sec:firewall name="main" provider="undefined">
<sec:form_login />
</sec:firewall>
</sec:firewalls>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</sec:providers>

<sec:firewalls>
<sec:firewall name="main" logout-on-user-change="true">
<sec:firewall name="main">
<sec:form_login provider="default" />
</sec:firewall>
</sec:firewalls>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
</sec:providers>

<sec:firewalls>
<sec:firewall name="main" logout-on-user-change="true">
<sec:firewall name="main">
<sec:form_login provider="undefined" />
</sec:firewall>
</sec:firewalls>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<sec:config>
<sec:provider name="default" id="foo" />

<sec:firewall name="main" form-login="false" logout-on-user-change="true">
<sec:firewall name="main" form-login="false">
<sec:http-basic />
</sec:firewall>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
xsi:schemaLocation="http://symfony.com/schema/dic/services http://symfony.com/schema/dic/services/services-1.0.xsd">

<config>
<firewall name="main" logout-on-user-change="true">
<firewall name="main">
<form-login login-path="/login" />
</firewall>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<sec:providers>
<sec:default id="foo"/>
</sec:providers>
<sec:firewall name="main" logout-on-user-change="true">
<sec:firewall name="main">
<sec:form-login/>
<sec:remember-me secret="TheSecret" catch-exceptions="false" token-provider="token_provider_id" />
</sec:firewall>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ security:
main:
form_login: false
http_basic: ~
logout_on_user_change: true
Original file line number Diff line number Diff line change
Expand Up @@ -64,14 +64,12 @@ security:
methods: [GET,POST]
anonymous: true
http_basic: true
logout_on_user_change: true

with_user_checker:
provider: default
anonymous: ~
http_basic: ~
user_checker: app.user_checker
logout_on_user_change: true

role_hierarchy:
ROLE_ADMIN: ROLE_USER
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,6 @@ security:
main:
provider: default
form_login: true
logout_on_user_change: true
other:
provider: with-dash
form_login: true
logout_on_user_change: true
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ security:
main:
provider: undefined
form_login: true
logout_on_user_change: true
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ security:
main:
form_login:
provider: default
logout_on_user_change: true
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,3 @@ security:
main:
form_login:
provider: undefined
logout_on_user_change: true
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ security:
main:
form_login: false
http_basic: ~
logout_on_user_change: true

role_hierarchy:
FOO: [MOO]
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ security:
main:
form_login:
login_path: /login
logout_on_user_change: true

role_hierarchy:
FOO: BAR
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,3 @@ security:
secret: TheSecret
catch_exceptions: false
token_provider: token_provider_id
logout_on_user_change: true
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ class MainConfigurationTest extends TestCase
),
'firewalls' => array(
'stub' => array(),
'logout_on_user_change' => true,
),
);

Expand Down Expand Up @@ -77,7 +76,6 @@ public function testCsrfAliases()
'csrf_token_generator' => 'a_token_generator',
'csrf_token_id' => 'a_token_id',
),
'logout_on_user_change' => true,
),
),
);
Expand Down Expand Up @@ -107,7 +105,6 @@ public function testUserCheckers()
'firewalls' => array(
'stub' => array(
'user_checker' => 'app.henk_checker',
'logout_on_user_change' => true,
),
),
);
Expand Down
Loading