Skip to content

Commit aece9de

Browse files
committed
[Security] Deprecate UserInterface::eraseCredentials()
1 parent 8c841e3 commit aece9de

File tree

143 files changed

+260
-37
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

143 files changed

+260
-37
lines changed

UPGRADE-7.3.md

Lines changed: 28 additions & 0 deletions

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/CacheAttributeListener/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ services:
1010
public: true
1111

1212
security:
13+
erase_credentials: false
1314
providers:
1415
main:
1516
memory:

src/Symfony/Bundle/FrameworkBundle/Tests/Functional/app/Security/config.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ services:
88
- container.service_subscriber
99

1010
security:
11+
erase_credentials: false
1112
providers:
1213
main:
1314
memory:

src/Symfony/Bundle/SecurityBundle/CHANGELOG.md

Lines changed: 3 additions & 1 deletion

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,9 @@ public function load(array $configs, ContainerBuilder $container): void
135135

136136
// set some global scalars
137137
$container->setParameter('security.access.denied_url', $config['access_denied_url']);
138+
if (true === $config['erase_credentials']) {
139+
trigger_deprecation('symfony/security-bundle', '7.3', 'Setting the "security.erase_credentials" config option to true is deprecated and won\'t have any effect in 8.0, set it to false instead and use your own erasing logic if needed.');
140+
}
138141
$container->setParameter('security.authentication.manager.erase_credentials', $config['erase_credentials']);
139142
$container->setParameter('security.authentication.session_strategy.strategy', $config['session_fixation_strategy']);
140143

src/Symfony/Bundle/SecurityBundle/Tests/Debug/TraceableFirewallListenerTest.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,9 @@ public function testOnKernelRequestRecordsAuthenticatorsInfo()
103103
[new TraceableAuthenticator($notSupportingAuthenticator), new TraceableAuthenticator($supportingAuthenticator)],
104104
$tokenStorage,
105105
$dispatcher,
106-
'main'
106+
'main',
107+
null,
108+
false
107109
);
108110

109111
$listener = new TraceableAuthenticatorManagerListener(new AuthenticatorManagerListener($authenticatorManager));

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/AddSessionDomainConstraintPassTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ private function createContainer($sessionStorageOptions)
139139

140140
$config = [
141141
'security' => [
142+
'erase_credentials' => false,
142143
'providers' => ['some_provider' => ['id' => 'foo']],
143144
'firewalls' => ['some_firewall' => ['security' => false]],
144145
],

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/MakeFirewallsEventDispatcherTraceablePassTest.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ protected function setUp(): void
3434

3535
$this->container->registerExtension(new SecurityExtension());
3636
$this->container->loadFromExtension('security', [
37+
'erase_credentials' => false,
3738
'firewalls' => ['main' => ['pattern' => '/', 'http_basic' => true]],
3839
]);
3940

src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/RegisterGlobalSecurityEventListenersPassTest.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,7 @@ protected function setUp(): void
5656
public function testEventIsPropagated(string $configuredEvent, string $registeredEvent)
5757
{
5858
$this->container->loadFromExtension('security', [
59+
'erase_credentials' => false,
5960
'firewalls' => ['main' => ['pattern' => '/', 'http_basic' => true]],
6061
]);
6162

@@ -89,6 +90,7 @@ public static function providePropagatedEvents(): array
8990
public function testRegisterCustomListener()
9091
{
9192
$this->container->loadFromExtension('security', [
93+
'erase_credentials' => false,
9294
'firewalls' => ['main' => ['pattern' => '/', 'http_basic' => true]],
9395
]);
9496

@@ -109,6 +111,7 @@ public function testRegisterCustomListener()
109111
public function testRegisterCustomSubscriber()
110112
{
111113
$this->container->loadFromExtension('security', [
114+
'erase_credentials' => false,
112115
'firewalls' => ['main' => ['pattern' => '/', 'http_basic' => true]],
113116
]);
114117

@@ -128,6 +131,7 @@ public function testRegisterCustomSubscriber()
128131
public function testMultipleFirewalls()
129132
{
130133
$this->container->loadFromExtension('security', [
134+
'erase_credentials' => false,
131135
'firewalls' => ['main' => ['pattern' => '/', 'http_basic' => true], 'api' => ['pattern' => '/api', 'http_basic' => true]],
132136
]);
133137

@@ -157,6 +161,7 @@ public function testMultipleFirewalls()
157161
public function testListenerAlreadySpecific()
158162
{
159163
$this->container->loadFromExtension('security', [
164+
'erase_credentials' => false,
160165
'firewalls' => ['main' => ['pattern' => '/', 'http_basic' => true]],
161166
]);
162167

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22

33
$container->loadFromExtension('security', [
4+
'erase_credentials' => false,
45
'access_decision_manager' => [
56
'allow_if_all_abstain' => true,
67
'allow_if_equal_granted_denied' => false,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy