Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commita9a4ebc

Browse files
OskarStarkclaude
andcommitted
[SecurityBundle] Remove deprecated hide_user_not_found option
Remove the deprecated hide_user_not_found configuration option,use expose_security_errors instead.- Remove BC BREAK prefix from CHANGELOG entry- Add UPGRADE-8.0.md entry with before/after examples- No legacy tests to remove- No need to remove symfony/deprecation-contracts (not present)🤖 Generated with [Claude Code](https://claude.ai/code)Co-Authored-By: Claude <noreply@anthropic.com>
1 parent6ab4a14 commita9a4ebc

File tree

4 files changed

+24
-55
lines changed

4 files changed

+24
-55
lines changed

‎UPGRADE-8.0.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -330,6 +330,27 @@ Security
330330
* Remove`AbstractListener::__invoke`
331331
* Remove`LazyFirewallContext::__invoke()`
332332

333+
SecurityBundle
334+
--------------
335+
336+
* Remove the deprecated`hide_user_not_found` configuration option, use`expose_security_errors` instead
337+
338+
*Before*
339+
```yaml
340+
# config/packages/security.yaml
341+
security:
342+
hide_user_not_found:false
343+
```
344+
345+
*After*
346+
```yaml
347+
# config/packages/security.yaml
348+
security:
349+
expose_security_errors:true
350+
```
351+
352+
Note:`expose_security_errors: true` is equivalent to `hide_user_not_found: false`. The logic is inverted.
353+
333354
Serializer
334355
----------
335356

‎src/Symfony/Bundle/SecurityBundle/CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@ CHANGELOG
44
8.0
55
---
66

7+
* Remove the deprecated`hide_user_not_found` configuration option, use`expose_security_errors` instead
8+
*[BC BREAK] Remove the deprecated`algorithm` and`key` options from the OIDC token handler configuration, use`algorithms` and`keyset` instead
9+
*[BC BREAK] Remove deprecated rate limiter factory autowiring aliases
710
* Remove`LazyFirewallContext::__invoke()`
811

912
7.4

‎src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -56,29 +56,12 @@ public function getConfigTreeBuilder(): TreeBuilder
5656

5757
$rootNode
5858
->docUrl('https://symfony.com/doc/{version:major}.{version:minor}/reference/configuration/security.html','symfony/security-bundle')
59-
->beforeNormalization()
60-
->always()
61-
->then(function ($v) {
62-
if (isset($v['hide_user_not_found']) &&isset($v['expose_security_errors'])) {
63-
thrownewInvalidConfigurationException('You cannot use both "hide_user_not_found" and "expose_security_errors" at the same time.');
64-
}
65-
66-
if (isset($v['hide_user_not_found']) && !isset($v['expose_security_errors'])) {
67-
$v['expose_security_errors'] =$v['hide_user_not_found'] ? ExposeSecurityLevel::None : ExposeSecurityLevel::All;
68-
}
69-
70-
return$v;
71-
})
72-
->end()
7359
->children()
7460
->scalarNode('access_denied_url')->defaultNull()->example('/foo/error403')->end()
7561
->enumNode('session_fixation_strategy')
7662
->values([SessionAuthenticationStrategy::NONE, SessionAuthenticationStrategy::MIGRATE, SessionAuthenticationStrategy::INVALIDATE])
7763
->defaultValue(SessionAuthenticationStrategy::MIGRATE)
7864
->end()
79-
->booleanNode('hide_user_not_found')
80-
->setDeprecated('symfony/security-bundle','7.3','The "%node%" option is deprecated and will be removed in 8.0. Use the "expose_security_errors" option instead.')
81-
->end()
8265
->enumNode('expose_security_errors')
8366
->beforeNormalization()->ifString()->then(fn ($v) => ExposeSecurityLevel::tryFrom($v))->end()
8467
->values(ExposeSecurityLevel::cases())

‎src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/MainConfigurationTest.php

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -259,42 +259,4 @@ public static function provideHideUserNotFoundData(): iterable
259259
yield [['expose_security_errors' =>'all'], ExposeSecurityLevel::All];
260260
}
261261

262-
/**
263-
* @dataProvider provideHideUserNotFoundLegacyData
264-
*
265-
* @group legacy
266-
*/
267-
publicfunctiontestExposeSecurityErrorsWithLegacyConfig(array$config,ExposeSecurityLevel$expectedExposeSecurityErrors, ?bool$expectedHideUserNotFound)
268-
{
269-
$this->expectUserDeprecationMessage('Since symfony/security-bundle 7.3: The "hide_user_not_found" option is deprecated and will be removed in 8.0. Use the "expose_security_errors" option instead.');
270-
271-
$config =array_merge(static::$minimalConfig,$config);
272-
273-
$processor =newProcessor();
274-
$configuration =newMainConfiguration([], []);
275-
$processedConfig =$processor->processConfiguration($configuration, [$config]);
276-
277-
$this->assertEquals($expectedExposeSecurityErrors,$processedConfig['expose_security_errors']);
278-
$this->assertEquals($expectedHideUserNotFound,$processedConfig['hide_user_not_found']);
279-
}
280-
281-
publicstaticfunctionprovideHideUserNotFoundLegacyData():iterable
282-
{
283-
yield [['hide_user_not_found' =>true], ExposeSecurityLevel::None,true];
284-
yield [['hide_user_not_found' =>false], ExposeSecurityLevel::All,false];
285-
}
286-
287-
publicfunctiontestCannotUseHideUserNotFoundAndExposeSecurityErrorsAtTheSameTime()
288-
{
289-
$processor =newProcessor();
290-
$configuration =newMainConfiguration([], []);
291-
292-
$this->expectException(InvalidConfigurationException::class);
293-
$this->expectExceptionMessage('You cannot use both "hide_user_not_found" and "expose_security_errors" at the same time.');
294-
295-
$processor->processConfiguration($configuration, [static::$minimalConfig + [
296-
'hide_user_not_found' =>true,
297-
'expose_security_errors' => ExposeSecurityLevel::None,
298-
]]);
299-
}
300262
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp