Skip to content

Commit e67b362

Browse files
committed
bug #60419 [SecurityBundle] normalize string values to a single ExposeSecurityLevel instance (xabbuh)
This PR was merged into the 7.3 branch. Discussion ---------- [SecurityBundle] normalize string values to a single ExposeSecurityLevel instance | Q | A | ------------- | --- | Branch? | 7.3 | Bug fix? | yes | New feature? | no | Deprecations? | no | Issues | | License | MIT Commits ------- d120484 normalize string values to a single ExposeSecurityLevel instance
2 parents 5955b14 + d120484 commit e67b362

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ public function getConfigTreeBuilder(): TreeBuilder
7676
->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.')
7777
->end()
7878
->enumNode('expose_security_errors')
79-
->beforeNormalization()->ifString()->then(fn ($v) => ['value' => ExposeSecurityLevel::tryFrom($v)])->end()
79+
->beforeNormalization()->ifString()->then(fn ($v) => ExposeSecurityLevel::tryFrom($v))->end()
8080
->values(ExposeSecurityLevel::cases())
8181
->defaultValue(ExposeSecurityLevel::None)
8282
->end()

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

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,9 @@ public static function provideHideUserNotFoundData(): iterable
254254
yield [['expose_security_errors' => ExposeSecurityLevel::None], ExposeSecurityLevel::None];
255255
yield [['expose_security_errors' => ExposeSecurityLevel::AccountStatus], ExposeSecurityLevel::AccountStatus];
256256
yield [['expose_security_errors' => ExposeSecurityLevel::All], ExposeSecurityLevel::All];
257+
yield [['expose_security_errors' => 'none'], ExposeSecurityLevel::None];
258+
yield [['expose_security_errors' => 'account_status'], ExposeSecurityLevel::AccountStatus];
259+
yield [['expose_security_errors' => 'all'], ExposeSecurityLevel::All];
257260
}
258261

259262
/**

0 commit comments

Comments
 (0)