8000 feature #50573 [SecurityBundle] Enabling `SecurityBundle` and not con… · symfony/symfony@fcec89b · GitHub
[go: up one dir, main page]

Skip to content

Commit fcec89b

Browse files
feature #50573 [SecurityBundle] Enabling SecurityBundle and not configuring it is not allowed (alexandre-daubois)
This PR was merged into the 7.0 branch. Discussion ---------- [SecurityBundle] Enabling `SecurityBundle` and not configuring it is not allowed | Q | A | ------------- | --- | Branch? | 7.0 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | - | License | MIT | Doc PR | - Removes the code deprecated in #48043 Commits ------- 2388239 [SecurityBundle] Enabling `SecurityBundle` and not configuring it is not allowed
2 parents aadd474 + 2388239 commit fcec89b

File tree

4 files changed

+17
-10
lines changed

4 files changed

+17
-10
lines changed

UPGRADE-7.0.md

+7-2
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,13 @@ Symfony 6.4 and Symfony 7.0 will be released simultaneously at the end of Novemb
55
release process, both versions will have the same features, but Symfony 7.0 won't include any deprecated features.
66
To upgrade, make sure to resolve all deprecation notices.
77

8+
SecurityBundle
9+
--------------
10+
11+
* Enabling SecurityBundle and not configuring it is not allowed
12+
813
Serializer
914
----------
1015

11-
* Remove denormalization support for `AbstractUid` in `UidNormalizer`, use one of `AbstractUid` child class instead
12-
* Denormalizing to an abstract class in `UidNormalizer` now throws an `\Error`
16+
* Remove denormalization support for `AbstractUid` in `UidNormalizer`, use one of `AbstractUid` child class instead
17+
* Denormalizing to an abstract class in `UidNormalizer` now throws an `\Error`

src/Symfony/Bundle/SecurityBundle/CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
CHANGELOG
22
=========
33

4+
7.0
5+
---
6+
7+
* Enabling SecurityBundle and not configuring it is not allowed
8+
49
6.3
510
---
611

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

+2-4
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
use Symfony\Component\Security\Core\Authorization\Strategy\PriorityStrategy;
5555
use Symfony\Component\Security\Core\Authorization\Strategy\UnanimousStrategy;
5656
use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
57+
use Symfony\Component\Security\Core\Exception\InvalidArgumentException;
5758
use Symfony\Component\Security\Core\User\ChainUserChecker;
5859
use Symfony\Component\Security\Core\User\ChainUserProvider;
5960
use Symfony\Component\Security\Core\User\UserCheckerInterface;
@@ -96,10 +97,7 @@ public function prepend(ContainerBuilder $container)
9697
public function load(array $configs, ContainerBuilder $container)
9798
{
9899
if (!array_filter($configs)) {
99-
trigger_deprecation('symfony/security-bundle', '6.3', 'Enabling bundle "%s" and not configuring it is deprecated.', SecurityBundle::class);
100-
// uncomment the following line in 7.0
101-
// throw new InvalidArgumentException(sprintf('Enabling bundle "%s" and not configuring it is not allowed.', SecurityBundle::class));
102-
return;
100+
throw new InvalidArgumentException(sprintf('Enabling bundle "%s" and not configuring it is not allowed.', SecurityBundle::class));
103101
}
104102

105103
$mainConfig = $this->getConfiguration($configs, $container);

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

+3-4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
use Symfony\Component\HttpFoundation\Response;
3131
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
3232
use Symfony\Component\Security\Core\Exception\AuthenticationException;
33+
use Symfony\Component\Security\Core\Exception\InvalidArgumentException;
3334
use Symfony\Component\Security\Core\User\InMemoryUserChecker;
3435
use Symfony\Component\Security\Core\User\UserCheckerInterface;
3536
use Symfony\Component\Security\Core\User\UserInterface;
@@ -871,16 +872,14 @@ public function testClearSiteDataLogoutListenerDisabled()
871872
$this->assertFalse($container->has('security.logout.listener.clear_site_data.'.$firewallId));
872873
}
873874

874-
/**
875-
* @group legacy
876-
*/
877875
public function testNothingDoneWithEmptyConfiguration()
878876
{
879877
$container = $this->getRawContainer();
880878

881879
$container->loadFromExtension('security');
882880

883-
$this->expectDeprecation('Since symfony/security-bundle 6.3: Enabling bundle "Symfony\Bundle\SecurityBundle\SecurityBundle" and not configuring it is deprecated.');
881+
$this->expectException(InvalidArgumentException::class);
882+
$this->expectExceptionMessage('Enabling bundle "Symfony\Bundle\SecurityBundle\SecurityBundle" and not configuring it is not allowed.');
884883

885884
$container->compile();
886885

0 commit comments

Comments
 (0)
0