8000 [SecurityBundle] Enabling `SecurityBundle` and not configuring it is not allowed by alexandre-daubois · Pull Request #50573 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[SecurityBundle] Enabling SecurityBundle and not configuring it is not allowed #50573

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
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
9 changes: 7 additions & 2 deletions UPGRADE-7.0.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ Symfony 6.4 and Symfony 7.0 will be released simultaneously at the end of Novemb
release process, both versions will have the same features, but Symfony 7.0 won't include any deprecated features.
To upgrade, make sure to resolve all deprecation notices.

Security
--------

* Enabling SecurityBundle and not configuring it is not allowed

Serializer
----------

* Remove denormalization support for `AbstractUid` in `UidNormalizer`, use one of `AbstractUid` child class instead
* Denormalizing to an abstract class in `UidNormalizer` now throws an `\Error`
* Remove denormalization support for `AbstractUid` in `UidNormalizer`, use one of `AbstractUid` child class instead
* Denormalizing to an abstract class in `UidNormalizer` now throws an `\Error`
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
=========

7.0
---

* Enabling SecurityBundle and not configuring it is not allowed

6.3
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
use Symfony\Component\Security\Core\Authorization\Strategy\PriorityStrategy;
use Symfony\Component\Security\Core\Authorization\Strategy\UnanimousStrategy;
use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
use Symfony\Component\Security\Core\Exception\InvalidArgumentException;
use Symfony\Component\Security\Core\User\ChainUserChecker;
use Symfony\Component\Security\Core\User\ChainUserProvider;
use Symfony\Component\Security\Core\User\UserCheckerInterface;
Expand Down Expand Up @@ -96,10 +97,7 @@ public function prepend(ContainerBuilder $container)
public function load(array $configs, ContainerBuilder $container)
{
if (!array_filter($configs)) {
trigger_deprecation('symfony/security-bundle', '6.3', 'Enabling bundle "%s" and not configuring it is deprecated.', SecurityBundle::class);
// uncomment the following line in 7.0
// throw new InvalidArgumentException(sprintf('Enabling bundle "%s" and not configuring it is not allowed.', SecurityBundle::class));
return;
throw new InvalidArgumentException(sprintf('Enabling bundle "%s" and not configuring it is not allowed.', SecurityBundle::class));
}

$mainConfig = $this->getConfiguration($configs, $container);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Core\Exception\InvalidArgumentException;
use Symfony\Component\Security\Core\User\InMemoryUserChecker;
use Symfony\Component\Security\Core\User\UserCheckerInterface;
use Symfony\Component\Security\Core\User\UserInterface;
Expand Down Expand Up @@ -871,16 +872,14 @@ public function testClearSiteDataLogoutListenerDisabled()
$this->assertFalse($container->has('security.logout.listener.clear_site_data.'.$firewallId));
}

/**
* @group legacy
*/
public function testNothingDoneWithEmptyConfiguration()
{
$container = $this->getRawContainer();

$container->loadFromExtension('security');

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

$container->compile();

Expand Down
0