diff --git a/src/DependencyInjection/CompilerPass/RefreshOAuthTokenCompilerPass.php b/src/DependencyInjection/CompilerPass/RefreshOAuthTokenCompilerPass.php deleted file mode 100644 index cd61c61ec..000000000 --- a/src/DependencyInjection/CompilerPass/RefreshOAuthTokenCompilerPass.php +++ /dev/null @@ -1,57 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace HWI\Bundle\OAuthBundle\DependencyInjection\CompilerPass; - -use Symfony\Component\DependencyInjection\Argument\IteratorArgument; -use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Reference; - -/** - * @deprecated For Symfony 4.4 only - * - * Adds already registered by OAuthFactory RefreshAccessTokenListenerOld to security.firewall.map.context. - * It's taking control immediately after token was passed from session to token storage. - */ -final class RefreshOAuthTokenCompilerPass implements CompilerPassInterface -{ - public function process(ContainerBuilder $container): void - { - foreach ($container->getDefinitions() as $listenerId => $listenerDef) { - if (!str_starts_with($listenerId, 'hwi_oauth.context_listener.token_refresher.')) { - continue; - } - - // Cut 'hwi_oauth.context_listener.token_refresher.' - $firewallName = substr($listenerId, 43); - $firewallMapContextId = 'security.firewall.map.context.'.$firewallName; - - if (!$container->has($firewallMapContextId)) { - continue; - } - - $firewallMapContextDef = $container->getDefinition($firewallMapContextId); - /* @var IteratorArgument $listenersIter */ - $listenerIter = $firewallMapContextDef->getArgument(0); - - $listenerRefs = $listenerIter->getValues(); - // add listener after security.context_listener.X - foreach ($listenerRefs as $pos => $posValue) { - if (str_starts_with($posValue, 'security.context_listener.')) { - array_splice($listenerRefs, $pos + 1, 0, [new Reference($listenerId)]); - break; - } - } - $listenerIter->setValues($listenerRefs); - } - } -} diff --git a/src/DependencyInjection/HWIOAuthExtension.php b/src/DependencyInjection/HWIOAuthExtension.php index b7fe2a8a7..c5a68e666 100644 --- a/src/DependencyInjection/HWIOAuthExtension.php +++ b/src/DependencyInjection/HWIOAuthExtension.php @@ -9,19 +9,6 @@ * file that was distributed with this source code. */ -namespace Symfony\Component\DependencyInjection\Loader\Configurator; - -// BC symfony 4.4 -class_exists(ContainerConfigurator::class); - -if (!\function_exists(__NAMESPACE__.'\\service')) { - function service($class): ReferenceConfigurator - { - /* @phpstan-ignore-next-line function ref not found */ - return ref($class); - } -} - namespace HWI\Bundle\OAuthBundle\DependencyInjection; use HWI\Bundle\OAuthBundle\OAuth\ResourceOwnerInterface; diff --git a/src/DependencyInjection/Security/Factory/OAuthFactory.php b/src/DependencyInjection/Security/Factory/OAuthFactory.php deleted file mode 100644 index 970cadc40..000000000 --- a/src/DependencyInjection/Security/Factory/OAuthFactory.php +++ /dev/null @@ -1,293 +0,0 @@ - - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace HWI\Bundle\OAuthBundle\DependencyInjection\Security\Factory; - -use HWI\Bundle\OAuthBundle\Security\Core\Authentication\Provider\OAuthProvider; -use HWI\Bundle\OAuthBundle\Security\Http\Firewall\RefreshAccessTokenListenerOld; -use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory; -use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition; -use Symfony\Component\Config\Definition\Builder\NodeDefinition; -use Symfony\Component\DependencyInjection\ChildDefinition; -use Symfony\Component\DependencyInjection\ContainerBuilder; -use Symfony\Component\DependencyInjection\Parameter; -use Symfony\Component\DependencyInjection\Reference; - -/** - * @author Geoffrey Bachelet - * @author Alexander - * - * @deprecated - */ -final class OAuthFactory extends AbstractFactory -{ - private \ArrayIterator $firewallNames; - - public function __construct(\ArrayIterator $firewallNames) - { - $this->firewallNames = $firewallNames; - } - - /** - * @param ArrayNodeDefinition $node - */ - public function addConfiguration(NodeDefinition $node): void - { - parent::addConfiguration($node); - - $builder = $node->children(); - $builder - ->scalarNode('login_path')->cannotBeEmpty()->isRequired()->end() - ; - - $this->addOAuthProviderConfiguration($node); - $this->addResourceOwnersConfiguration($node); - } - - /** - * {@inheritdoc} - */ - public function getKey(): string - { - return 'oauth'; - } - - /** - * {@inheritdoc} - */ - public function getPosition(): string - { - return 'http'; - } - - public function getPriority(): int - { - return 1; - } - - public function getFirewallNames(): \ArrayIterator - { - return $this->firewallNames; - } - - /** - * {@inheritDoc} - */ - public function createAuthenticator( - ContainerBuilder $container, - string $firewallName, - array $config, - string $userProviderId - ): string { - throw new \RuntimeException('Deprecated "OAuthFactory" cannot create new Symfony Authenticator!'); - } - - /** - * {@inheritdoc} - */ - protected function createAuthProvider(ContainerBuilder $container, $id, $config, $userProviderId): string - { - $providerId = 'hwi_oauth.authentication.provider.oauth.'.$id; - - $this->createResourceOwnerMap($container, $id, $config); - - $container - ->register('hwi_oauth.authentication.provider.oauth', OAuthProvider::class); - - $container - ->setDefinition($providerId, new ChildDefinition('hwi_oauth.authentication.provider.oauth')) - ->addArgument($this->createOAuthAwareUserProvider($container, $id, $config['oauth_user_provider'])) - ->addArgument($this->createResourceOwnerMapReference($id)) - ->addArgument(new Reference('hwi_oauth.user_checker')) - ->addArgument(new Reference('security.token_storage')) - ; - - $this->createRefreshTokenListeners($container, $providerId, $id); - - $this->firewallNames[$id] = true; - - return $providerId; - } - - protected function createOAuthAwareUserProvider(ContainerBuilder $container, $id, $config): Reference - { - $serviceId = 'hwi_oauth.user.provider.entity.'.$id; - - // todo: move this to factories? - switch (key($config)) { - case 'oauth': - $container - ->setDefinition($serviceId, new ChildDefinition('hwi_oauth.user.provider')) - ; - break; - case 'orm': - $container - ->setDefinition($serviceId, new ChildDefinition('hwi_oauth.user.provider.entity')) - ->addArgument($config['orm']['class']) - ->addArgument($config['orm']['properties']) - ->addArgument($config['orm']['manager_name']) - ; - break; - case 'service': - $container - ->setAlias($serviceId, $config['service']); - break; - } - - return new Reference($serviceId); - } - - /** - * {@inheritdoc} - */ - protected function createEntryPoint($container, $id, $config, $defaultEntryPointId): ?string - { - $entryPointId = 'hwi_oauth.authentication.entry_point.oauth.'.$id; - - $container - ->setDefinition($entryPointId, new ChildDefinition('hwi_oauth.authentication.entry_point.oauth')) - ->addArgument($config['login_path']) - ->addArgument($config['use_forward']) - ; - - return $entryPointId; - } - - /** - * {@inheritdoc} - */ - protected function createListener($container, $id, $config, $userProvider): string - { - $listenerId = parent::createListener($container, $id, $config, $userProvider); - - $checkPaths = $config['resource_owners']; - - $container - ->getDefinition($listenerId) - ->addMethodCall('setResourceOwnerMap', [$this->createResourceOwnerMapReference($id)]) - ->addMethodCall('setCheckPaths', [$checkPaths]) - ; - - return $listenerId; - } - - protected function createRefreshTokenListeners(ContainerBuilder $container, string $providerId, string $id): void - { - $listenerId = 'hwi_oauth.context_listener.token_refresher.'.$id; - - $listenerDef = $container->setDefinition($listenerId, new ChildDefinition('hwi_oauth.context_listener.abstract_token_refresher')); - - $listenerDef - ->addMethodCall('setResourceOwnerMap', [$this->createResourceOwnerMapReference($id)]) - ->setClass(RefreshAccessTokenListenerOld::class) - ->replaceArgument(0, new Reference($providerId)); - } - - /** - * {@inheritdoc} - */ - protected function getListenerId(): string - { - return 'hwi_oauth.authentication.listener.oauth'; - } - - /** - * Gets a reference to the resource owner map. - */ - private function createResourceOwnerMapReference(string $firewallName): Reference - { - return new Reference('hwi_oauth.resource_ownermap.'.$firewallName); - } - - /** - * Creates a resource owner map for the given configuration. - * - * @param ContainerBuilder $container Container to build for - * @param array $config Configuration - */ - private function createResourceOwnerMap(ContainerBuilder $container, string $firewallName, array $config): void - { - $resourceOwnersMap = []; - foreach ($config['resource_owners'] as $name => $checkPath) { - $resourceOwnersMap[$name] = $checkPath; - } - $container->setParameter('hwi_oauth.resource_ownermap.configured.'.$firewallName, $resourceOwnersMap); - - $container - ->setDefinition( - $this->createResourceOwnerMapReference($firewallName), - new ChildDefinition('hwi_oauth.abstract_resource_ownermap') - ) - ->replaceArgument('$resourceOwners', new Parameter('hwi_oauth.resource_ownermap.configured.'.$firewallName)) - ->setPublic(true) - ; - } - - private function addOAuthProviderConfiguration(ArrayNodeDefinition $node): void - { - $builder = $node->children(); - $builder - ->arrayNode('oauth_user_provider') - ->isRequired() - ->children() - ->arrayNode('orm') - ->children() - ->scalarNode('class')->isRequired()->cannotBeEmpty()->end() - ->scalarNode('manager_name')->defaultNull()->end() - ->arrayNode('properties') - ->isRequired() - ->useAttributeAsKey('name') - ->prototype('scalar') - ->end() - ->end() - ->end() - ->end() - ->scalarNode('service')->cannotBeEmpty()->end() - ->scalarNode('oauth')->end() - ->end() - ->validate() - ->ifTrue(function ($c) { - return 1 !== \count($c) || !\in_array(key($c), ['oauth', 'orm', 'service'], true); - }) - ->thenInvalid("You should configure (only) one of: 'oauth', 'orm', 'service'.") - ->end() - ->end() - ; - } - - private function addResourceOwnersConfiguration(ArrayNodeDefinition $node): void - { - $builder = $node->children(); - $builder - ->arrayNode('resource_owners') - ->isRequired() - ->useAttributeAsKey('name') - ->prototype('scalar') - ->end() - ->validate() - ->ifTrue(function ($c) { - $checkPaths = []; - foreach ($c as $checkPath) { - if (\in_array($checkPath, $checkPaths, true)) { - return true; - } - - $checkPaths[] = $checkPath; - } - - return false; - }) - ->thenInvalid('Each resource owner should have a unique "check_path".') - ->end() - ->end() - ; - } -} diff --git a/src/HWIOAuthBundle.php b/src/HWIOAuthBundle.php index 238ffb3c9..7efc0f6f7 100644 --- a/src/HWIOAuthBundle.php +++ b/src/HWIOAuthBundle.php @@ -12,15 +12,12 @@ namespace HWI\Bundle\OAuthBundle; use HWI\Bundle\OAuthBundle\DependencyInjection\CompilerPass\EnableRefreshOAuthTokenListenerCompilerPass; -use HWI\Bundle\OAuthBundle\DependencyInjection\CompilerPass\RefreshOAuthTokenCompilerPass; use HWI\Bundle\OAuthBundle\DependencyInjection\CompilerPass\ResourceOwnerCompilerPass; use HWI\Bundle\OAuthBundle\DependencyInjection\Security\Factory\OAuthAuthenticatorFactory; -use HWI\Bundle\OAuthBundle\DependencyInjection\Security\Factory\OAuthFactory; use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Extension\ExtensionInterface; use Symfony\Component\HttpKernel\Bundle\Bundle; -use Symfony\Component\Security\Core\Authentication\Provider\AuthenticationProviderInterface; /** * @author Geoffrey Bachelet @@ -42,13 +39,11 @@ public function build(ContainerBuilder $container) if (method_exists($extension, 'addAuthenticatorFactory')) { $extension->addAuthenticatorFactory(new OAuthAuthenticatorFactory($firewallNames)); - } elseif (interface_exists(AuthenticationProviderInterface::class)) { - // @phpstan-ignore-next-line Symfony 4.4 BC layer - $extension->addSecurityListenerFactory(new OAuthFactory($firewallNames)); - $container->addCompilerPass(new RefreshOAuthTokenCompilerPass()); - } else { - // @phpstan-ignore-next-line Symfony < 5.4 BC layer + } elseif (method_exists($extension, 'addSecurityListenerFactory')) { + // Symfony < 5.4 BC layer $extension->addSecurityListenerFactory(new OAuthAuthenticatorFactory($firewallNames)); + } else { + throw new \RuntimeException('Unsupported Symfony Security component version'); } $container->addCompilerPass(new ResourceOwnerCompilerPass()); diff --git a/src/Resources/config/oauth.php b/src/Resources/config/oauth.php index f5fe3d081..69f7cf89c 100644 --- a/src/Resources/config/oauth.php +++ b/src/Resources/config/oauth.php @@ -44,10 +44,7 @@ $services->set('hwi_oauth.context_listener.abstract_token_refresher', AbstractRefreshAccessTokenListener::class) ->abstract() - ->arg(0, \function_exists(__NAMESPACE__.'\abstract_arg') - ? abstract_arg('OAuthAuthenticator or AuthenticationProviderInterface') - : null // Symfony 4.4 - ) + ->arg(0, abstract_arg('OAuthAuthenticator or AuthenticationProviderInterface')) ->call('setTokenStorage', [service('security.token_storage')]); // Session storage diff --git a/src/Security/Core/Exception/AccountNotLinkedException.php b/src/Security/Core/Exception/AccountNotLinkedException.php index ddab8ca2a..a1b870865 100644 --- a/src/Security/Core/Exception/AccountNotLinkedException.php +++ b/src/Security/Core/Exception/AccountNotLinkedException.php @@ -12,217 +12,109 @@ namespace HWI\Bundle\OAuthBundle\Security\Core\Exception; use HWI\Bundle\OAuthBundle\Security\Core\Authentication\Token\AbstractOAuthToken; -use Symfony\Component\Security\Core\Exception\UsernameNotFoundException; use Symfony\Component\Security\Core\Exception\UserNotFoundException; -if (class_exists(UserNotFoundException::class)) { - final class AccountNotLinkedException extends UserNotFoundException implements OAuthAwareExceptionInterface +final class AccountNotLinkedException extends UserNotFoundException implements OAuthAwareExceptionInterface +{ + private ?string $resourceOwnerName = null; + + /** + * {@inheritdoc} + */ + public function __serialize(): array + { + return [ + $this->resourceOwnerName, + parent::__serialize(), + ]; + } + + /** + * {@inheritdoc} + */ + public function __unserialize(array $data): void + { + [ + $this->resourceOwnerName, + $parentData + ] = $data; + + parent::__unserialize($parentData); + } + + /** + * {@inheritdoc} + */ + public function getMessageKey(): string + { + return 'Account could not be linked correctly.'; + } + + /** + * {@inheritdoc} + */ + public function getAccessToken(): string + { + /** @var AbstractOAuthToken $token */ + $token = $this->getToken(); + + return $token->getAccessToken(); + } + + public function getRawToken(): array + { + /** @var AbstractOAuthToken $token */ + $token = $this->getToken(); + + return $token->getRawToken(); + } + + /** + * {@inheritdoc} + */ + public function getRefreshToken(): ?string + { + /** @var AbstractOAuthToken $token */ + $token = $this->getToken(); + + return $token->getRefreshToken(); + } + + /** + * {@inheritdoc} + */ + public function getExpiresIn(): ?int + { + /** @var AbstractOAuthToken $token */ + $token = $this->getToken(); + + return $token->getExpiresIn(); + } + + /** + * {@inheritdoc} + */ + public function getTokenSecret(): ?string + { + /** @var AbstractOAuthToken $token */ + $token = $this->getToken(); + + return $token->getTokenSecret(); + } + + /** + * {@inheritdoc} + */ + public function getResourceOwnerName(): ?string { - private ?string $resourceOwnerName = null; - - /** - * {@inheritdoc} - */ - public function __serialize(): array - { - return [ - $this->resourceOwnerName, - parent::__serialize(), - ]; - } - - /** - * {@inheritdoc} - */ - public function __unserialize(array $data): void - { - [ - $this->resourceOwnerName, - $parentData - ] = $data; - - parent::__unserialize($parentData); - } - - /** - * {@inheritdoc} - */ - public function getMessageKey(): string - { - return 'Account could not be linked correctly.'; - } - - /** - * {@inheritdoc} - */ - public function getAccessToken(): string - { - /** @var AbstractOAuthToken $token */ - $token = $this->getToken(); - - return $token->getAccessToken(); - } - - public function getRawToken(): array - { - /** @var AbstractOAuthToken $token */ - $token = $this->getToken(); - - return $token->getRawToken(); - } - - /** - * {@inheritdoc} - */ - public function getRefreshToken(): ?string - { - /** @var AbstractOAuthToken $token */ - $token = $this->getToken(); - - return $token->getRefreshToken(); - } - - /** - * {@inheritdoc} - */ - public function getExpiresIn(): ?int - { - /** @var AbstractOAuthToken $token */ - $token = $this->getToken(); - - return $token->getExpiresIn(); - } - - /** - * {@inheritdoc} - */ - public function getTokenSecret(): ?string - { - /** @var AbstractOAuthToken $token */ - $token = $this->getToken(); - - return $token->getTokenSecret(); - } - - /** - * {@inheritdoc} - */ - public function getResourceOwnerName(): ?string - { - return $this->resourceOwnerName; - } - - /** - * {@inheritdoc} - */ - public function setResourceOwnerName($resourceOwnerName): void - { - $this->resourceOwnerName = $resourceOwnerName; - } + return $this->resourceOwnerName; } -} else { - final class AccountNotLinkedException extends UsernameNotFoundException implements OAuthAwareExceptionInterface + + /** + * {@inheritdoc} + */ + public function setResourceOwnerName($resourceOwnerName): void { - private ?string $resourceOwnerName = null; - - /** - * {@inheritdoc} - */ - public function __serialize(): array - { - return [ - $this->resourceOwnerName, - parent::__serialize(), - ]; - } - - /** - * {@inheritdoc} - */ - public function __unserialize(array $data): void - { - [ - $this->resourceOwnerName, - $parentData - ] = $data; - - parent::__unserialize($parentData); - } - - /** - * {@inheritdoc} - */ - public function getMessageKey(): string - { - return 'Account could not be linked correctly.'; - } - - /** - * {@inheritdoc} - */ - public function getAccessToken(): string - { - /** @var AbstractOAuthToken $token */ - $token = $this->getToken(); - - return $token->getAccessToken(); - } - - public function getRawToken(): array - { - /** @var AbstractOAuthToken $token */ - $token = $this->getToken(); - - return $token->getRawToken(); - } - - /** - * {@inheritdoc} - */ - public function getRefreshToken(): ?string - { - /** @var AbstractOAuthToken $token */ - $token = $this->getToken(); - - return $token->getRefreshToken(); - } - - /** - * {@inheritdoc} - */ - public function getExpiresIn(): ?int - { - /** @var AbstractOAuthToken $token */ - $token = $this->getToken(); - - return $token->getExpiresIn(); - } - - /** - * {@inheritdoc} - */ - public function getTokenSecret(): ?string - { - /** @var AbstractOAuthToken $token */ - $token = $this->getToken(); - - return $token->getTokenSecret(); - } - - /** - * {@inheritdoc} - */ - public function getResourceOwnerName(): ?string - { - return $this->resourceOwnerName; - } - - /** - * {@inheritdoc} - */ - public function setResourceOwnerName($resourceOwnerName): void - { - $this->resourceOwnerName = $resourceOwnerName; - } + $this->resourceOwnerName = $resourceOwnerName; } } diff --git a/src/Security/Core/User/EntityUserProvider.php b/src/Security/Core/User/EntityUserProvider.php index 314ddd710..25aa93940 100644 --- a/src/Security/Core/User/EntityUserProvider.php +++ b/src/Security/Core/User/EntityUserProvider.php @@ -17,7 +17,6 @@ use HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface; use Symfony\Component\PropertyAccess\PropertyAccess; use Symfony\Component\Security\Core\Exception\UnsupportedUserException; -use Symfony\Component\Security\Core\Exception\UsernameNotFoundException; use Symfony\Component\Security\Core\Exception\UserNotFoundException; use Symfony\Component\Security\Core\User\UserInterface; use Symfony\Component\Security\Core\User\UserProviderInterface; @@ -57,10 +56,7 @@ public function loadUserByIdentifier(string $identifier): UserInterface $user = $this->findUser(['username' => $identifier]); if (!$user) { - $exception = new UserNotFoundException(sprintf("User '%s' not found.", $identifier)); - $exception->setUserIdentifier($identifier); - - throw $exception; + throw $this->createUserNotFoundException($identifier, sprintf("User '%s' not found.", $identifier)); } return $user; @@ -75,12 +71,7 @@ public function loadUserByIdentifier(string $identifier): UserInterface */ public function loadUserByUsername($username) { - $user = $this->findUser(['username' => $username]); - if (!$user) { - throw $this->createUserNotFoundException($username, sprintf("User '%s' not found.", $username)); - } - - return $user; + return $this->loadUserByIdentifier($username); } public function loadUserByOAuthUserResponse(UserResponseInterface $response): ?UserInterface @@ -133,24 +124,10 @@ private function findUser(array $criteria): ?UserInterface return $this->repository->findOneBy($criteria); } - /** - * @return UsernameNotFoundException|UserNotFoundException - */ - private function createUserNotFoundException(string $username, string $message) + private function createUserNotFoundException(string $username, string $message): UserNotFoundException { - if (class_exists(UserNotFoundException::class)) { - $exception = new UserNotFoundException($message); - $exception->setUserIdentifier($username); - } else { - if (!class_exists(UsernameNotFoundException::class)) { - throw new \RuntimeException('Unsupported Symfony version used!'); - } - - $exception = new UsernameNotFoundException($message); - if (method_exists($exception, 'setUsername')) { - $exception->setUsername($username); // @phpstan-ignore-this-line Symfony <5.4 BC layer - } - } + $exception = new UserNotFoundException($message); + $exception->setUserIdentifier($username); return $exception; } diff --git a/src/Security/Core/User/OAuthAwareUserProviderInterface.php b/src/Security/Core/User/OAuthAwareUserProviderInterface.php index f2b222b78..759722c64 100644 --- a/src/Security/Core/User/OAuthAwareUserProviderInterface.php +++ b/src/Security/Core/User/OAuthAwareUserProviderInterface.php @@ -12,7 +12,6 @@ namespace HWI\Bundle\OAuthBundle\Security\Core\User; use HWI\Bundle\OAuthBundle\OAuth\Response\UserResponseInterface; -use Symfony\Component\Security\Core\Exception\UsernameNotFoundException; use Symfony\Component\Security\Core\Exception\UserNotFoundException; use Symfony\Component\Security\Core\User\UserInterface; @@ -28,7 +27,7 @@ interface OAuthAwareUserProviderInterface * * @return UserInterface * - * @throws UsernameNotFoundException|UserNotFoundException if the user is not found + * @throws UserNotFoundException if the user is not found */ public function loadUserByOAuthUserResponse(UserResponseInterface $response); } diff --git a/tests/DependencyInjection/HWIOAuthExtensionTest.php b/tests/DependencyInjection/HWIOAuthExtensionTest.php index f28c99966..0744d1613 100644 --- a/tests/DependencyInjection/HWIOAuthExtensionTest.php +++ b/tests/DependencyInjection/HWIOAuthExtensionTest.php @@ -282,7 +282,7 @@ public function testConfigurationPassValidOAuth2WithPaths(): void } /** - * @legacy + * @group legacy */ public function testConfigurationPassValidOAuth1WithClass(): void { @@ -312,7 +312,7 @@ public function testConfigurationPassValidOAuth1WithClass(): void } /** - * @legacy + * @group legacy */ public function testConfigurationPassValidOAuth2WithClassOnly(): void { @@ -333,7 +333,7 @@ public function testConfigurationPassValidOAuth2WithClassOnly(): void } /** - * @legacy + * @group legacy */ public function testConfigurationPassValidOAuth2WithPathsAndClass(): void { diff --git a/tests/Functional/IntegrationTest.php b/tests/Functional/IntegrationTest.php index c6c63b1e2..ab3c22144 100644 --- a/tests/Functional/IntegrationTest.php +++ b/tests/Functional/IntegrationTest.php @@ -149,7 +149,8 @@ function ($method, $url, $options) { public function testRequestCheckApi(): void { - if (Kernel::MAJOR_VERSION === 6) { + // @phpstan-ignore-next-line + if (Kernel::MAJOR_VERSION >= 6) { $this->markTestSkipped('Skipped due to bug in Symfony Security component: https://github.com/symfony/symfony/issues/51319'); }