prefix stringlengths 512 512 | suffix stringlengths 256 256 | middle stringlengths 14 229 | meta dict |
|---|---|---|---|
buted with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Command;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\SecurityBundle\Command\DebugFirewallCommand;
use Symfony\Bundle\SecurityBundle\Security\FirewallConfig;
use Symfony\Bundle\SecurityBundle\Security\FirewallContext;
use Symfony\Bun... | Names = ['main', 'api'];
$command = new DebugFirewallCommand($firewallNames, new Container(), new Container(), []);
$tester = new CommandTester($command);
$this->assertSame(0, $tester->execute([]));
$this->assertStringCont | cher\EventDispatcher;
use Symfony\Component\Security\Http\Authenticator\AuthenticatorInterface;
class DebugFirewallCommandTest extends TestCase
{
public function testFirewallListOutputMatchesFixture()
{
$firewall | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Command/DebugFirewallCommandTest.php",
"language": "php",
"file_size": 7141,
"cut_index": 716,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Command;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\SecurityBundle\Command\Sec... | 'ROLE_USER'],
];
$roleHierarchy = new RoleHierarchy($hierarchy);
$command = new SecurityRoleHierarchyDumpCommand($roleHierarchy);
$commandTester = new CommandTester($command);
$exitCode = $commandTester->execute([] | SecurityRoleHierarchyDumpCommandTest extends TestCase
{
public function testExecuteWithRoleHierarchy()
{
$hierarchy = [
'ROLE_ADMIN' => ['ROLE_USER'],
'ROLE_SUPER_ADMIN' => ['ROLE_ADMIN', | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Command/SecurityRoleHierarchyDumpCommandTest.php",
"language": "php",
"file_size": 2673,
"cut_index": 563,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\EventListener;
use PHPUnit\Framework\TestCase;
... | $traceableAccessDecisionManager = $this
->getMockBuilder(TraceableAccessDecisionManager::class)
->disableOriginalConstructor()
->onlyMethods(['addVoterVote'])
->getMock();
$traceableAccessDecision | n\Voter\VoterInterface;
use Symfony\Component\Security\Core\Event\VoteEvent;
class VoteListenerTest extends TestCase
{
public function testOnVoterVote()
{
$voter = $this->createStub(VoterInterface::class);
| {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/EventListener/VoteListenerTest.php",
"language": "php",
"file_size": 1369,
"cut_index": 524,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Debug;
use PHPUnit\Framework\Attributes\Group;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\SecurityBundle\Debug\TraceableFirewallListener;
use Symfony\Bundle\SecurityBundle\Security\FirewallMap;
use Symfony\Component\EventDispatcher... | oken\TokenInterface;
use Symfony\Component\Security\Http\Authentication\AuthenticatorManager;
use Symfony\Component\Security\Http\Authenticator\Debug\TraceableAuthenticator;
use Symfony\Component\Security\Http\Authenticator\Debug\TraceableAuthenticatorMana | rnel\HttpKernelInterface;
use Symfony\Component\Security\Core\Authentication\Token\AbstractToken;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage;
use Symfony\Component\Security\Core\Authentication\T | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Debug/TraceableFirewallListenerTest.php",
"language": "php",
"file_size": 6369,
"cut_index": 716,
"middle_length": 229
} |
file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\FirewallEntryPointBundle\Dependency... | lass FirewallEntryPointExtension extends Extension
{
public function load(array $configs, ContainerBuilder $container): void
{
$loader = new YamlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$loader->load( | ponent\DependencyInjection\Loader\YamlFileLoader;
c | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FirewallEntryPointBundle/DependencyInjection/FirewallEntryPointExtension.php",
"language": "php",
"file_size": 862,
"cut_index": 529,
"middle_length": 52
} |
hp
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\FormLoginBundle;
use... | parent::build($container);
$container
->register(LoginController::class)
->setPublic(true)
->addTag('container.service_subscriber');
$container
->register(LocalizedController::class)
| nController;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class FormLoginBundle extends Bundle
{
public function build(ContainerBuilder $container): void
{
| {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/FormLoginBundle.php",
"language": "php",
"file_size": 1092,
"cut_index": 515,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\FormLoginBundle\Controller;
use Psr\Container\ContainerInterface;
us... |
private ContainerInterface $container;
public function __construct(ContainerInterface $container)
{
$this->container = $container;
}
public function loginAction(Request $request, ?UserInterface $user = null)
{
// | ore\User\UserInterface;
use Symfony\Component\Security\Http\SecurityRequestAttributes;
use Symfony\Contracts\Service\ServiceSubscriberInterface;
use Twig\Environment;
class LoginController implements ServiceSubscriberInterface
{ | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Controller/LoginController.php",
"language": "php",
"file_size": 2295,
"cut_index": 563,
"middle_length": 229
} |
ony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
class MissingUserProviderTest exten... | ption::class);
$this->expectExceptionMessage('"default" firewall requires a user provider but none was defined');
$client->request('GET', '/', [], [], [
'PHP_AUTH_USER' => 'username',
'PHP_AUTH_PW' => 'pa$$word',
| $this->expectException(InvalidConfigurationExce | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/MissingUserProviderTest.php",
"language": "php",
"file_size": 932,
"cut_index": 606,
"middle_length": 52
} |
buted with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
use PHPUnit\Framework\Attributes\DataProvider;
class SecurityRoutingIntegrationTest extends AbstractWebTestCase
{
#[DataProvider('provideConfigs')]
public function testRoutingErrorIsNotExposedForProtectedResourceWhenAn... | ted_resource');
$this->assertEquals(404, $client->getResponse()->getStatusCode(), (string) $client->getResponse());
}
#[DataProvider('provideConfigs')]
public function testRoutingErrorIsNotExposedForProtectedResourceWhenLoggedInWithIn | login');
}
#[DataProvider('provideConfigs')]
public function testRoutingErrorIsExposedWhenNotProtected(array $options)
{
$client = $this->createClient($options);
$client->request('GET', '/unprotec | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityRoutingIntegrationTest.php",
"language": "php",
"file_size": 6411,
"cut_index": 716,
"middle_length": 229
} |
urityBundle\Security;
use Symfony\Bundle\SecurityBundle\Security\FirewallConfig;
use Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\AuthenticatorBundle\ApiAuthenticator;
use Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\SecuredPageBundle\Security\Core\User\ArrayUserProvider;
use Symfony\Component\EventDi... | fony\Component\Security\Core\User\PasswordAuthenticatedUserInterface;
use Symfony\Component\Security\Core\User\UserInterface;
class SecurityTest extends AbstractWebTestCase
{
public function testServiceIsFunctional()
{
$kernel = self::crea | omponent\HttpKernel\Event\RequestEvent;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken;
use Symfony\Component\Security\Core\User\InMemoryUser;
use Sym | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/SecurityTest.php",
"language": "php",
"file_size": 12134,
"cut_index": 921,
"middle_length": 229
} |
ony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\SecurityBundle\SecurityBundle;
use Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\CsrfFormLoginBun... | the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
new FrameworkBundle(),
new SecurityBundle(),
new TwigBundle(),
new CsrfFormLoginBundle(),
new TestBund | (c) Fabien Potencier <fabien@symfony.com>
*
* For | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/CsrfFormLogin/bundles.php",
"language": "php",
"file_size": 923,
"cut_index": 606,
"middle_length": 52
} |
ackage.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\SecurityBundle\SecurityBundle;
use Symfony\Bundle\Security... | com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
new FrameworkBundle(),
new SecurityBundle(),
new FirewallEntryPointBundle(),
new TestBundle | package.
*
* (c) Fabien Potencier <fabien@symfony. | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/FirewallEntryPoint/bundles.php",
"language": "php",
"file_size": 874,
"cut_index": 559,
"middle_length": 52
} |
file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\SecurityBundle\SecurityBundl... | <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
new SecurityBundle(),
new FrameworkBundle(),
new AccessTokenBundle(),
new T | of the Symfony package.
*
* (c) Fabien Potencier | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/AccessToken/bundles.php",
"language": "php",
"file_size": 853,
"cut_index": 529,
"middle_length": 52
} |
is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\SecurityBundle\SecurityBundle;
use... | mfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
new SecurityBundle(),
new FrameworkBundle(),
new JsonLoginBundle(),
new TestBundle(), | mfony package.
*
* (c) Fabien Potencier <fabien@sy | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/JsonLogin/bundles.php",
"language": "php",
"file_size": 847,
"cut_index": 535,
"middle_length": 52
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\SecuredPageBundle\Security\Core\User;
use Symfony\Bundle\SecurityBun... | function addUser(UserInterface $user)
{
$this->users[$user->getUserIdentifier()] = $user;
}
public function setUser($username, UserInterface $user)
{
$this->users[$username] = $user;
}
public function getUser($use | urity\Core\User\UserInterface;
use Symfony\Component\Security\Core\User\UserProviderInterface;
class ArrayUserProvider implements UserProviderInterface
{
/** @var UserInterface[] */
private array $users = [];
public | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/SecuredPageBundle/Security/Core/User/ArrayUserProvider.php",
"language": "php",
"file_size": 2071,
"cut_index": 563,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\AuthenticatorBundle;
use Symfony\Component\HttpFoundation\JsonRespon... | ractAuthenticator;
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge;
use Symfony\Component\Security\Http\Authenticator\Passport\Passport;
use Symfony\Component\Security\Http\Authenticator\Passport\SelfValidatingPassport;
class Ap | Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Core\Exception\BadCredentialsException;
use Symfony\Component\Security\Core\User\InMemoryUser;
use Symfony\Component\Security\Http\Authenticator\Abst | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/AuthenticatorBundle/ApiAuthenticator.php",
"language": "php",
"file_size": 2312,
"cut_index": 563,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\AuthenticatorBundle;
use Symfony\Bundle\Se... | ContainerBuilder $container, string $firewallName, array $config, string $userProviderId): string
{
$authenticatorId = 'security.authenticator.dummy_form_login.'.$firewallName;
$options = array_intersect_key($config, $this->options);
| ymfony\Component\DependencyInjection\Reference;
class DummyFormLoginFactory extends FormLoginFactory
{
public function getKey(): string
{
return 'dummy_form_login';
}
public function createAuthenticator( | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/AuthenticatorBundle/DummyFormLoginFactory.php",
"language": "php",
"file_size": 1716,
"cut_index": 537,
"middle_length": 229
} |
ony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\JsonLoginBundle\Security\Http;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFou... | cationFailureHandler implements AuthenticationFailureHandlerInterface
{
public function onAuthenticationFailure(Request $request, AuthenticationException $exception): Response
{
return new JsonResponse(['message' => 'Something went wrong'], | ticationFailureHandlerInterface;
class JsonAuthenti | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/JsonLoginBundle/Security/Http/JsonAuthenticationFailureHandler.php",
"language": "php",
"file_size": 929,
"cut_index": 606,
"middle_length": 52
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\EventBundle\EventSubscriber;
... | hods = [];
public static function getSubscribedEvents(): array
{
return [
AuthenticationSuccessEvent::class => 'onAuthenticationSuccess',
AuthenticationFailureEvent::class => 'onAuthenticationFailure',
I | ccessEvent;
use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
use Symfony\Component\Security\Http\Event\SwitchUserEvent;
final class TestSubscriber implements EventSubscriberInterface
{
public array $calledMet | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/EventBundle/EventSubscriber/TestSubscriber.php",
"language": "php",
"file_size": 1285,
"cut_index": 524,
"middle_length": 229
} |
is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\EventBundle\DependencyInjection;
use Sym... | n extends Extension
{
public function load(array $configs, ContainerBuilder $container): void
{
$container->register('test_subscriber', TestSubscriber::class)
->setPublic(true)
->addTag('kernel.event_subscriber');
| tion\Extension\Extension;
final class EventExtensio | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/EventBundle/DependencyInjection/EventExtension.php",
"language": "php",
"file_size": 849,
"cut_index": 535,
"middle_length": 52
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\FormLoginBundle\Controller;
use Psr\Container\ContainerInterface;
us... | $this->container = $container;
}
public function loginAction(Request $request)
{
// get the login error if there is one
if ($request->attributes->has(SecurityRequestAttributes::AUTHENTICATION_ERROR)) {
$error = $re | ubscriberInterface;
use Twig\Environment;
class LocalizedController implements ServiceSubscriberInterface
{
private ContainerInterface $container;
public function __construct(ContainerInterface $container)
{
| {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Controller/LocalizedController.php",
"language": "php",
"file_size": 2336,
"cut_index": 563,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
use PHPUnit\Framework\Attributes\Da... | equest('POST', '/login', [
'_username' => 'test',
'_password' => 'test',
], [], [
'HTTPS' => (int) $https,
]);
$cookies = $client->getResponse()->headers->getCookies(ResponseHeaderBag::COOKIES_AR | ap')]
public function testSessionRememberMeSecureCookieFlagAuto($https, $expectedSecureFlag)
{
$client = $this->createClient(['test_case' => 'RememberMeCookie', 'root_config' => 'config.yml']);
$client->r | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/RememberMeCookieTest.php",
"language": "php",
"file_size": 1289,
"cut_index": 524,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
use PHPUnit\Framework\Attributes\DataProvider;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\Secur... | s->assertEquals($expectedStatus, $client->getResponse()->getStatusCode());
$this->assertEquals($expectedUser, $client->getProfile()->getCollector('security')->getUser());
}
public function testSwitchedUserCanSwitchToOther()
{
$ | , $expectedUser, $expectedStatus)
{
$client = $this->createAuthenticatedClient($originalUser, ['root_config' => 'switchuser.yml']);
$client->request('GET', '/profile?_switch_user='.$targetUser);
$thi | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/SwitchUserTest.php",
"language": "php",
"file_size": 3791,
"cut_index": 614,
"middle_length": 229
} |
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
use Symfony\Bundle\FrameworkBundle\FrameworkBundle;
use Symfony\Bundle\SecurityBundle\Securi... | Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\TestBundle;
use Symfony\Bundle\TwigBundle\TwigBundle;
return [
new FrameworkBundle(),
new SecurityBundle(),
new TwigBundle(),
new FormLoginBundle(),
new RequestTrackerBundle(),
| erBundle;
use | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/StandardFormLogin/bundles.php",
"language": "php",
"file_size": 813,
"cut_index": 522,
"middle_length": 14
} |
n Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle;
use Symfony\Component\DependencyInjection\Compiler\CheckTypeDeclarationsPass;
use Symf... | ntainer): void
{
$container->setParameter('container.build_hash', 'test_bundle');
$container->setParameter('container.build_time', time());
$container->setParameter('container.build_id', 'test_bundle');
$container->addC | dle
{
public function build(ContainerBuilder $co | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/TestBundle.php",
"language": "php",
"file_size": 987,
"cut_index": 582,
"middle_length": 52
} |
n Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\AuthenticatorBundle;
use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExte... | ild($container);
$this->configureSecurityExtension($container);
}
private function configureSecurityExtension(ContainerBuilder $container): void
{
/** @var SecurityExtension $extension */
$extension = $container->getEx | erBuilder $container): void
{
parent::bu | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/AuthenticatorBundle/AuthenticatorBundle.php",
"language": "php",
"file_size": 994,
"cut_index": 582,
"middle_length": 52
} |
n Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\JsonLoginBundle\Security\Http;
use Symfony\Component\HttpFoundation\JsonResponse;
use S... | rface;
class JsonAuthenticationSuccessHandler implements AuthenticationSuccessHandlerInterface
{
public function onAuthenticationSuccess(Request $request, TokenInterface $token): ?Response
{
return new JsonResponse(['message' => \sprintf(' | Http\Authentication\AuthenticationSuccessHandlerInte | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/JsonLoginBundle/Security/Http/JsonAuthenticationSuccessHandler.php",
"language": "php",
"file_size": 947,
"cut_index": 582,
"middle_length": 52
} |
he Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\FirewallEntryPointBundle\Security;
use Symfony\Compo... | ntStub implements AuthenticationEntryPointInterface
{
public const RESPONSE_TEXT = '2be8e651259189d841a19eecdf37e771e2431741';
public function start(Request $request, ?AuthenticationException $authException = null): Response
{
return n | t\AuthenticationEntryPointInterface;
class EntryPoi | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FirewallEntryPointBundle/Security/EntryPointStub.php",
"language": "php",
"file_size": 897,
"cut_index": 547,
"middle_length": 52
} |
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\FormLoginBundle\Security... |
class LocalizedFormFailureHandler implements AuthenticationFailureHandlerInterface
{
private RouterInterface $router;
public function __construct(RouterInterface $router)
{
$this->router = $router;
}
public function onAuthen | rlGeneratorInterface;
use Symfony\Component\Routing\RouterInterface;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface; | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/FormLoginBundle/Security/LocalizedFormFailureHandler.php",
"language": "php",
"file_size": 1224,
"cut_index": 518,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\CsrfFormLoginBundle\Form;
use Symfony\Component\Form\AbstractType;
u... | esolver\OptionsResolver;
use Symfony\Component\Security\Http\SecurityRequestAttributes;
/**
* Form type for use with the Security component's form-based authentication
* listener.
*
* @author Henrik Bjornskov <henrik@bjrnskov.dk>
* @author Jeremy Mik | onent\Form\FormBuilderInterface;
use Symfony\Component\Form\FormError;
use Symfony\Component\Form\FormEvent;
use Symfony\Component\Form\FormEvents;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\OptionsR | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Form/UserLoginType.php",
"language": "php",
"file_size": 2986,
"cut_index": 563,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\CsrfFormLoginBundle\Controller;
use Psr\Co... | rInterface
{
private ContainerInterface $container;
public function __construct(ContainerInterface $container)
{
$this->container = $container;
}
public function loginAction()
{
$form = $this->container->get('form. | nent\HttpFoundation\Response;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use Symfony\Contracts\Service\ServiceSubscriberInterface;
use Twig\Environment;
class LoginController implements ServiceSubscribe | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/CsrfFormLoginBundle/Controller/LoginController.php",
"language": "php",
"file_size": 1851,
"cut_index": 537,
"middle_length": 229
} |
ony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\LoginLink;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use... | ler implements AuthenticationSuccessHandlerInterface
{
public function onAuthenticationSuccess(Request $request, TokenInterface $token): ?Response
{
return new JsonResponse(['message' => \sprintf('Welcome %s!', $token->getUserIdentifier())] | dlerInterface;
class TestCustomLoginLinkSuccessHand | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/LoginLink/TestCustomLoginLinkSuccessHandler.php",
"language": "php",
"file_size": 925,
"cut_index": 606,
"middle_length": 52
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Functional\app;
use Symfony\Component\Config\Loader\LoaderInterface;
use Symfony\Compo... | /'.$testCase)) {
throw new \InvalidArgumentException(\sprintf('The test case "%s" does not exist.', $testCase));
}
$this->varDir = $varDir;
$this->testCase = $testCase;
$fs = new Filesystem();
foreach (( | extends Kernel
{
private string $varDir;
private string $testCase;
private array $rootConfig;
public function __construct($varDir, $testCase, $rootConfig, $environment, $debug)
{
if (!is_dir(__DIR__.' | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/app/AppKernel.php",
"language": "php",
"file_size": 2966,
"cut_index": 563,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Functional;
use PHPUnit\Framework\Attributes\DataProvider;
use Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\RememberMeBundle\Sec... |
$client->request('POST', '/login', [
'_username' => 'johannes',
'_password' => 'test',
]);
$this->assertSame(302, $client->getResponse()->getStatusCode());
$client->request('GET', '/profile');
|
#[DataProvider('provideConfigs')]
public function testRememberMe(array $options)
{
$client = $this->createClient(array_merge_recursive(['root_config' => 'config.yml', 'test_case' => 'RememberMe'], $options)); | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/RememberMeTest.php",
"language": "php",
"file_size": 3714,
"cut_index": 614,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Functional\Bundle\AuthenticatorBundle;
use Symfony\Component\HttpFoundation\RedirectRe... | rity\Http\Authenticator\Passport\Credentials\PasswordCredentials;
use Symfony\Component\Security\Http\Authenticator\Passport\Passport;
use Symfony\Component\Security\Http\SecurityRequestAttributes;
use Symfony\Component\Security\Http\Util\TargetPathTrait;
| ty\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Http\Authenticator\AbstractLoginFormAuthenticator;
use Symfony\Component\Security\Http\Authenticator\Passport\Badge\UserBadge;
use Symfony\Component\Secu | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Functional/Bundle/AuthenticatorBundle/LoginFormAuthenticator.php",
"language": "php",
"file_size": 2221,
"cut_index": 563,
"middle_length": 229
} |
'memory' => null,
],
],
'firewalls' => [
'firewall1' => [
'provider' => 'default',
'access_token' => [
'token_handler' => [
'oidc' => [
'algorithms' => ['RS256'],
'issuers' =>... | => true,
'keyset' => '{"keys":[{"kty":"RSA","n":"abc","e":"AQAB","d":"def"}]}',
'algorithms' => ['RSA-OAEP'],
],
],
],
],
| cryption' => [
'enabled' | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/access_token_oidc_encryption.php",
"language": "php",
"file_size": 932,
"cut_index": 606,
"middle_length": 52
} |
, [
'providers' => [
'default' => [
'memory' => null,
],
],
'firewalls' => [
'firewall1' => [
'provider' => 'default',
'access_token' => [
'token_handler' => [
'oidc_user_info' => [
'base_... | 'discovery' => [
'cache' => [
'id' => 'oidc_cache',
],
],
],
],
],
],
| nnect/userinfo',
],
| {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/access_token_oidc_user_info_multiple_discovery.php",
"language": "php",
"file_size": 876,
"cut_index": 559,
"middle_length": 52
} |
namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection\Fixtures\UserProviderFactory;
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\UserProvider\UserProviderFactoryInterface;
use Symfony\Bundle\SecurityBundle\Tests\DependencyInjection\Fixtures\UserProvider\DummyProvider;
use Symfony\Compone... | $definition->setArgument('$foo', $config['foo']);
}
public function getKey(): string
{
return 'custom';
}
public function addConfiguration(NodeDefinition $builder): void
{
$builder
->children()
| ements UserProviderFactoryInterface
{
public function create(ContainerBuilder $container, string $id, array $config): void
{
$definition = $container->setDefinition($id, new Definition(DummyProvider::class));
| {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/UserProviderFactory/CustomProviderFactory.php",
"language": "php",
"file_size": 1139,
"cut_index": 518,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Security;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\SecurityBundle\Security\Firew... | irewallMapTest extends TestCase
{
private const ATTRIBUTE_FIREWALL_CONTEXT = '_firewall_context';
public function testGetListenersWithEmptyMap()
{
$request = new Request();
$map = [];
$container = $this->createMock(Con | Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\RequestMatcherInterface;
use Symfony\Component\Security\Http\Firewall\ExceptionListener;
use Symfony\Component\Security\Http\Firewall\LogoutListener;
class F | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Security/FirewallMapTest.php",
"language": "php",
"file_size": 3826,
"cut_index": 614,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Security;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle... | estPostRequestWithOnlyLazyAuthenticatorsIsHandledLazily()
{
$lazyListener = $this->createMock(FirewallListenerInterface::class);
$lazyListener->expects($this->once())->method('supports')->willReturn(null);
// authenticate() must | rface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage;
use Symfony\Component\Security\Http\Firewall\FirewallListenerInterface;
class LazyFirewallContextTest extends TestCase
{
public function t | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Security/LazyFirewallContextTest.php",
"language": "php",
"file_size": 1713,
"cut_index": 537,
"middle_length": 229
} |
ework\Attributes\IgnoreDeprecations;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\SecurityBundle\DependencyInjection\MainConfiguration;
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AuthenticatorFactoryInterface;
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationExcept... | ],
],
'firewalls' => [
'stub' => [],
],
];
public function testNoConfigForProvider()
{
$config = [
'providers' => [
'stub' => [],
],
];
$pr | he minimal, required config needed to not have any required validation
* issues.
*/
protected static array $minimalConfig = [
'providers' => [
'stub' => [
'id' => 'foo',
| {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/MainConfigurationTest.php",
"language": "php",
"file_size": 12612,
"cut_index": 921,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Security;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\SecurityBundle\Security\F... | y_point',
'access_denied_url' => 'foo_access_denied_url',
'access_denied_handler' => 'foo_access_denied_handler',
'user_checker' => 'foo_user_checker',
'switch_user' => ['provider' => null, 'parameter' => '_s | equest_matcher' => 'foo_request_matcher',
'security' => false,
'stateless' => false,
'provider' => 'foo_provider',
'context' => 'foo_context',
'entry_point' => 'foo_entr | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Security/FirewallConfigTest.php",
"language": "php",
"file_size": 2545,
"cut_index": 563,
"middle_length": 229
} |
php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection;
use Symfony\Comp... | nfigurationTestCase
{
protected function getLoader(ContainerBuilder $container)
{
return new YamlFileLoader($container, new FileLocator(__DIR__.'/Fixtures/yml'));
}
protected function getFileExtension()
{
return 'yml';
| nds CompleteCo | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/YamlCompleteConfigurationTest.php",
"language": "php",
"file_size": 792,
"cut_index": 514,
"middle_length": 14
} |
Entity\User1' => 'plaintext',
'JMS\FooBundle\Entity\User2' => [
'algorithm' => 'sha1',
'encode_as_base64' => false,
'iterations' => 5,
],
'JMS\FooBundle\Entity\User3' => [
'algorithm' => 'md5',
],
'JMS\FooBundle\Entity\User4' => [
... | => 100,
'cost' => 15,
],
'JMS\FooBundle\Entity\User7' => [
'algorithm' => 'auto',
],
],
'providers' => [
'default' => [
'memory' => [
'users' => [
| as_base64' => false,
'iterations' => 5,
'key_length' => 30,
],
'JMS\FooBundle\Entity\User6' => [
'algorithm' => 'native',
'time_cost' => 8,
'memory_cost' | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/php/container1.php",
"language": "php",
"file_size": 3617,
"cut_index": 614,
"middle_length": 229
} |
ny\Component\DependencyInjection\Reference;
use Symfony\Component\HttpFoundation\RequestMatcher\AttributesRequestMatcher;
use Symfony\Component\HttpFoundation\RequestMatcher\HostRequestMatcher;
use Symfony\Component\HttpFoundation\RequestMatcher\MethodRequestMatcher;
use Symfony\Component\HttpFoundation\RequestMatcher\... | onManager;
use Symfony\Component\Security\Core\Authorization\Strategy\AffirmativeStrategy;
use Symfony\Component\Security\Core\User\UserCheckerInterface;
use Symfony\Component\Security\Http\Authentication\AuthenticatorManager;
use Symfony\Component\Securit | er\Hasher\Pbkdf2PasswordHasher;
use Symfony\Component\PasswordHasher\Hasher\PlaintextPasswordHasher;
use Symfony\Component\PasswordHasher\Hasher\SodiumPasswordHasher;
use Symfony\Component\Security\Core\Authorization\AccessDecisi | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/CompleteConfigurationTestCase.php",
"language": "php",
"file_size": 32963,
"cut_index": 1331,
"middle_length": 229
} |
php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection;
use Symfony\Comp... | igurationTestCase
{
protected function getLoader(ContainerBuilder $container)
{
return new PhpFileLoader($container, new FileLocator(__DIR__.'/Fixtures/php'));
}
protected function getFileExtension()
{
return 'php';
| s CompleteConf | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/PhpCompleteConfigurationTest.php",
"language": "php",
"file_size": 789,
"cut_index": 514,
"middle_length": 14
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Security;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle... | $this->getExceptionListenerMock();
$logoutListener = $this->getLogoutListenerMock();
$listeners = [static function () {}];
$context = new FirewallContext($listeners, $exceptionListener, $logoutListener, $config);
$this->a | ity\Http\Firewall\LogoutListener;
class FirewallContextTest extends TestCase
{
public function testGetters()
{
$config = new FirewallConfig('main', 'user_checker', 'request_matcher');
$exceptionListener = | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Security/FirewallContextTest.php",
"language": "php",
"file_size": 1538,
"cut_index": 537,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\Security;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle... | pBasicAuthenticator;
class UserAuthenticatorTest extends TestCase
{
public function testThrowsLogicExceptionIfCurrentRequestIsNull()
{
$container = new Container();
$firewallMap = new FirewallMap($container, []);
$requestSt | quest;
use Symfony\Component\HttpFoundation\RequestStack;
use Symfony\Component\Security\Core\User\InMemoryUser;
use Symfony\Component\Security\Core\User\InMemoryUserProvider;
use Symfony\Component\Security\Http\Authenticator\Htt | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/Security/UserAuthenticatorTest.php",
"language": "php",
"file_size": 1800,
"cut_index": 537,
"middle_length": 229
} |
questMatcher\PathRequestMatcher;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\PasswordHasher\PasswordHasherInterface;
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Cor... | sport;
class SecurityExtensionTest extends TestCase
{
public function testInvalidCheckPath()
{
$container = $this->getRawContainer();
$container->loadFromExtension('security', [
'providers' => [
'defaul | ProviderInterface;
use Symfony\Component\Security\Http\Authenticator\AuthenticatorInterface;
use Symfony\Component\Security\Http\Authenticator\HttpBasicAuthenticator;
use Symfony\Component\Security\Http\Authenticator\Passport\Pas | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/SecurityExtensionTest.php",
"language": "php",
"file_size": 40220,
"cut_index": 2151,
"middle_length": 229
} |
Tests\DependencyInjection\Fixtures\UserProviderFactory;
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\UserProvider\UserProviderFactoryInterface;
use Symfony\Bundle\SecurityBundle\Tests\DependencyInjection\Fixtures\UserProvider\DummyProvider;
use Symfony\Component\Config\Definition\Builder\NodeDefiniti... | $id, $config): void
{
$container->setDefinition($id, new Definition(DummyProvider::class));
}
public function getKey(): string
{
return 'foo';
}
public function addConfiguration(NodeDefinition $node): void
{
| public function create(ContainerBuilder $container, | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/UserProviderFactory/DummyProviderFactory.php",
"language": "php",
"file_size": 873,
"cut_index": 559,
"middle_length": 52
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler;
use Monolog\Processor\ProcessorInterface;
use Symfony\Componen... | ed_token_storage" to ProcessorInterface instances.
*
* @author Nicolas Grekas <p@tchwork.com>
*
* @internal
*/
class RegisterTokenUsageTrackingPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container): void
{ | Component\DependencyInjection\Reference;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
/**
* Injects the session tracker enabler in "security.context_listener" + binds "security.untrack | {
"filepath": "src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/RegisterTokenUsageTrackingPass.php",
"language": "php",
"file_size": 2275,
"cut_index": 563,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler;
use Symfony\Bundle\SecurityBundle\RememberMe\DecoratedRemember... | ty.remember_me_handler';
public function process(ContainerBuilder $container): void
{
$handledFirewalls = [];
foreach ($container->findTaggedServiceIds(self::HANDLER_TAG) as $definitionId => $rememberMeHandlerTags) {
$d | services with the real definition.
*
* @author Wouter de Jong <wouter@wouterj.nl>
*
* @internal
*/
final class ReplaceDecoratedRememberMeHandlerPass implements CompilerPassInterface
{
private const HANDLER_TAG = 'securi | {
"filepath": "src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/ReplaceDecoratedRememberMeHandlerPass.php",
"language": "php",
"file_size": 2138,
"cut_index": 563,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Argument\IteratorArg... | listeners based on the execution order provided by FirewallListenerInterface::getPriority().
*
* @author Christian Scheb <me@christianscheb.de>
*/
class SortFirewallListenersPass implements CompilerPassInterface
{
public function process(ContainerBu | n;
use Symfony\Component\DependencyInjection\Exception\InvalidArgumentException;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\Security\Http\Firewall\FirewallListenerInterface;
/**
* Sorts firewall | {
"filepath": "src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/SortFirewallListenersPass.php",
"language": "php",
"file_size": 3043,
"cut_index": 563,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\UserProvider;
use Symfony\Component\Config\Definition\Builder\A... | */
class InMemoryFactory implements UserProviderFactoryInterface
{
public function create(ContainerBuilder $container, string $id, array $config): void
{
$definition = $container->setDefinition($id, new ChildDefinition('security.user.provid | erBuilder;
use Symfony\Component\DependencyInjection\Parameter;
/**
* InMemoryFactory creates services for the memory provider.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Christophe Coevoet <stof@notk.org>
| {
"filepath": "src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/UserProvider/InMemoryFactory.php",
"language": "php",
"file_size": 2353,
"cut_index": 563,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\UserProvider;
use Symfony\Component\Config\Definition\Builder\A... | lass LdapFactory implements UserProviderFactoryInterface
{
public function create(ContainerBuilder $container, string $id, array $config): void
{
$container
->setDefinition($id, new ChildDefinition('security.user.provider.ldap') | erBuilder;
use Symfony\Component\DependencyInjection\Reference;
/**
* LdapFactory creates services for Ldap user provider.
*
* @author Grégoire Pineau <lyrixx@lyrixx.info>
* @author Charles Sarrazin <charles@sarraz.in>
*/
c | {
"filepath": "src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/UserProvider/LdapFactory.php",
"language": "php",
"file_size": 2986,
"cut_index": 563,
"middle_length": 229
} |
ackage.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\UserProvider;
use Symfony\Component\Config\Definition\Build... | oet <stof@notk.org>
*/
interface UserProviderFactoryInterface
{
public function create(ContainerBuilder $container, string $id, array $config): void;
public function getKey(): string;
public function addConfiguration(NodeDefinition $builder) | cier <fabien@symfony.com>
* @author Christophe Coev | {
"filepath": "src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/UserProvider/UserProviderFactoryInterface.php",
"language": "php",
"file_size": 877,
"cut_index": 559,
"middle_length": 52
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory;
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
use Symfony\Component\DependencyInjection... | 'login_path' => '/login',
];
protected array $defaultSuccessHandlerOptions = [
'always_use_default_target_path' => false,
'default_target_path' => '/',
'login_path' => '/login',
'target_path_parameter' => '_ | or Johannes M. Schmitt <schmittjoh@gmail.com>
*/
abstract class AbstractFactory implements AuthenticatorFactoryInterface
{
protected array $options = [
'check_path' => '/login_check',
'use_forward' => false,
| {
"filepath": "src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/AbstractFactory.php",
"language": "php",
"file_size": 4472,
"cut_index": 614,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory;
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\AccessToken\TokenHandlerFactoryInterface;
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
use Symfony\Component\Config\Definitio... | ractFactory implements StatelessAuthenticatorFactoryInterface
{
private const PRIORITY = -40;
/**
* @param array<TokenHandlerFactoryInterface> $tokenHandlerFactories
*/
public function __construct(private readonly array $tokenHandler | cyInjection\Reference;
/**
* AccessTokenFactory creates services for Access Token authentication.
*
* @author Florent Morselli <florent.morselli@spomky-labs.com>
*
* @internal
*/
final class AccessTokenFactory extends Abst | {
"filepath": "src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/AccessTokenFactory.php",
"language": "php",
"file_size": 6020,
"cut_index": 716,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory;
use Symfony\Com... | rewall configuration.
*/
public function getKey(): string;
public function addConfiguration(NodeDefinition $builder): void;
/**
* Creates the authenticator service(s) for the provided configuration.
*
* @param array<string | ryInterface
{
/**
* Defines the priority at which the authenticator is called.
*/
public function getPriority(): int;
/**
* Defines the configuration key used to reference the provider
* in the fi | {
"filepath": "src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/AuthenticatorFactoryInterface.php",
"language": "php",
"file_size": 1278,
"cut_index": 524,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory;
use Symfony\Component\Config... | {
return 'custom_authenticators';
}
/**
* @param ArrayNodeDefinition $builder
*/
public function addConfiguration(NodeDefinition $builder): void
{
// get the parent array node builder ("firewalls") from inside t | ong <wouter@wouterj.nl>
*
* @internal
*/
class CustomAuthenticatorFactory implements AuthenticatorFactoryInterface
{
public function getPriority(): int
{
return 0;
}
public function getKey(): string
| {
"filepath": "src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/CustomAuthenticatorFactory.php",
"language": "php",
"file_size": 1852,
"cut_index": 537,
"middle_length": 229
} |
he Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory;
use Symfony\Component\DependencyInject... | listener services for the provided configuration.
*
* @param array<string, mixed> $config
*
* @return string[] The listener service IDs to be used by the firewall
*/
public function createListeners(ContainerBuilder $container, | toryInterface
{
/**
* Creates the firewall | {
"filepath": "src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/FirewallListenerFactoryInterface.php",
"language": "php",
"file_size": 902,
"cut_index": 547,
"middle_length": 52
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory;
use Symfony\Component\DependencyInjection\ChildDefinit... | _construct()
{
$this->addOption('username_parameter', '_username');
$this->addOption('password_parameter', '_password');
$this->addOption('csrf_parameter', '_csrf_token');
$this->addOption('csrf_token_id', 'authenticate' | *
* @author Fabien Potencier <fabien@symfony.com>
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*
* @internal
*/
class FormLoginFactory extends AbstractFactory
{
public const PRIORITY = -30;
public function _ | {
"filepath": "src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/FormLoginFactory.php",
"language": "php",
"file_size": 2343,
"cut_index": 563,
"middle_length": 229
} |
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory;
use Symfo... | t::addConfiguration($node);
$node
->children()
->scalarNode('service')->defaultValue('ldap')->end()
->scalarNode('dn_string')->defaultValue('{user_identifier}')->end()
->scalarNode('query | author Charles Sarrazin <charles@sarraz.in>
*
* @internal
*/
class FormLoginLdapFactory extends FormLoginFactory
{
use LdapFactoryTrait;
public function addConfiguration(NodeDefinition $node): void
{
paren | {
"filepath": "src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/FormLoginLdapFactory.php",
"language": "php",
"file_size": 1199,
"cut_index": 518,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory;
use Symfony\Component\Config... | public const PRIORITY = -50;
public function createAuthenticator(ContainerBuilder $container, string $firewallName, array $config, string $userProviderId): string
{
$authenticatorId = 'security.authenticator.http_basic.'.$firewallName;
| tion\Reference;
/**
* HttpBasicFactory creates services for HTTP basic authentication.
*
* @author Fabien Potencier <fabien@symfony.com>
*
* @internal
*/
class HttpBasicFactory implements AuthenticatorFactoryInterface
{
| {
"filepath": "src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/HttpBasicFactory.php",
"language": "php",
"file_size": 1735,
"cut_index": 537,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory;
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
use Symfony\Component\DependencyInjection... | internal
*/
class HttpBasicLdapFactory extends HttpBasicFactory
{
use LdapFactoryTrait;
public function create(ContainerBuilder $container, string $id, array $config, string $userProvider, ?string $defaultEntryPoint): array
{
$provide |
/**
* HttpBasicFactory creates services for HTTP basic authentication.
*
* @author Fabien Potencier <fabien@symfony.com>
* @author Grégoire Pineau <lyrixx@lyrixx.info>
* @author Charles Sarrazin <charles@sarraz.in>
*
* @ | {
"filepath": "src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/HttpBasicLdapFactory.php",
"language": "php",
"file_size": 3415,
"cut_index": 614,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory;
use Symfony\Component\DependencyInjection\ChildDefinit... | ', 'username');
$this->addOption('password_path', 'password');
$this->defaultFailureHandlerOptions = [];
$this->defaultSuccessHandlerOptions = [];
}
public function getPriority(): int
{
return self::PRIORITY;
| *
* @author Kévin Dunglas <dunglas@gmail.com>
*
* @internal
*/
class JsonLoginFactory extends AbstractFactory
{
public const PRIORITY = -40;
public function __construct()
{
$this->addOption('username_path | {
"filepath": "src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/JsonLoginFactory.php",
"language": "php",
"file_size": 2035,
"cut_index": 563,
"middle_length": 229
} |
hp
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory;
use Sy... | ('service')->defaultValue('ldap')->end()
->scalarNode('dn_string')->defaultValue('{user_identifier}')->end()
->scalarNode('query_string')->end()
->scalarNode('search_dn')->defaultValue('')->end()
| ds JsonLoginFactory
{
use LdapFactoryTrait;
public function addConfiguration(NodeDefinition $node): void
{
parent::addConfiguration($node);
$node
->children()
->scalarNode | {
"filepath": "src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/JsonLoginLdapFactory.php",
"language": "php",
"file_size": 1099,
"cut_index": 515,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Security;
use Psr\Container\ContainerInterface;
use Symfony\Component\HttpFoundation\Request... | }
public function getListeners(Request $request): array
{
$context = $this->getFirewallContext($request);
if (null === $context) {
return [[], null, null];
}
return [$context->getListeners(), $context- | author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class FirewallMap implements FirewallMapInterface
{
public function __construct(
private ContainerInterface $container,
private iterable $map,
) {
| {
"filepath": "src/Symfony/Bundle/SecurityBundle/Security/FirewallMap.php",
"language": "php",
"file_size": 2114,
"cut_index": 563,
"middle_length": 229
} |
oseSecurityLevel;
use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface;
use Symfony\Component\Security\Http\Session\SessionAuthenticationStrategy;
/**
* SecurityExtension configuration structure.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class MainConfiguration implement... | struct(
private array $factories,
private array $userProviderFactories,
) {
}
/**
* Generates the configuration tree builder.
*/
public function getConfigTreeBuilder(): TreeBuilder
{
$tb = new TreeBuil | */
public const STRATEGY_UNANIMOUS = 'unanimous';
/** @internal */
public const STRATEGY_PRIORITY = 'priority';
/**
* @param array<AuthenticatorFactoryInterface> $factories
*/
public function __con | {
"filepath": "src/Symfony/Bundle/SecurityBundle/DependencyInjection/MainConfiguration.php",
"language": "php",
"file_size": 20602,
"cut_index": 1331,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler;
use Symfony\Component\D... | if ($container->has('security.expression_language')) {
$definition = $container->findDefinition('security.expression_language');
foreach ($container->findTaggedServiceIds('security.expression_language_provider', true) as $id => | sion language providers.
*
* @author Fabien Potencier <fabien@symfony.com>
*/
class AddExpressionLanguageProvidersPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container): void
{
| {
"filepath": "src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/AddExpressionLanguageProvidersPass.php",
"language": "php",
"file_size": 1393,
"cut_index": 524,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInje... | ns') || !$container->has('security.http_utils')) {
return;
}
$sessionOptions = $container->getParameter('session.storage.options');
$domainRegexp = empty($sessionOptions['cookie_domain']) ? '%%s' : \sprintf('(?:%%%%s|(? | Grekas <p@tchwork.com>
*/
class AddSessionDomainConstraintPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container): void
{
if (!$container->hasParameter('session.storage.optio | {
"filepath": "src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/AddSessionDomainConstraintPass.php",
"language": "php",
"file_size": 1651,
"cut_index": 537,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPas... | function process(ContainerBuilder $container): void
{
if (!$container->has('event_dispatcher') || !$container->hasParameter('security.firewalls')) {
return;
}
if (!$container->getParameter('kernel.debug') || !$conta | ymfony\Component\EventDispatcher\Debug\TraceableEventDispatcher;
/**
* @author Mathieu Lechat <mathieu.lechat@les-tilleuls.coop>
*/
class MakeFirewallsEventDispatcherTraceablePass implements CompilerPassInterface
{
public | {
"filepath": "src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/MakeFirewallsEventDispatcherTraceablePass.php",
"language": "php",
"file_size": 2804,
"cut_index": 563,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjecti... | er\IsCsrfTokenValidAttributeListener;
/**
* @author Christian Flothmann <christian.flothmann@sensiolabs.de>
* @author Wouter de Jong <wouter@wouterj.nl>
*
* @internal
*/
class RegisterCsrfFeaturesPass implements CompilerPassInterface
{
public fun | leTokenStorageInterface;
use Symfony\Component\Security\Http\EventListener\CsrfProtectionListener;
use Symfony\Component\Security\Http\EventListener\CsrfTokenClearingLogoutListener;
use Symfony\Component\Security\Http\EventListen | {
"filepath": "src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/RegisterCsrfFeaturesPass.php",
"language": "php",
"file_size": 3107,
"cut_index": 614,
"middle_length": 229
} |
This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler;
use Symfony\Component\D... |
class RegisterLdapLocatorPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container): void
{
$definition = $container->setDefinition('security.ldap_locator', new Definition(ServiceLocator::class));
| mfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\DependencyInjection\ServiceLocator;
/**
* @author Wouter de Jong <wouter@wouterj.nl>
*
* @internal
*/ | {
"filepath": "src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/RegisterLdapLocatorPass.php",
"language": "php",
"file_size": 1361,
"cut_index": 524,
"middle_length": 229
} |
amespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection\Fixtures\Authenticator;
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AuthenticatorFactoryInterface;
use Symfony\Component\Config\Definition\Builder\NodeDefinition;
use Symfony\Component\DependencyInjection\ContainerBuilder;
cla... | ator.custom.'.$firewallName;
}
public function getKey(): string
{
return 'custom';
}
public function addConfiguration(NodeDefinition $builder): void
{
}
public function getPriority(): int
{
return 0;
| Id): string
{
return 'security.authentic | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Fixtures/Authenticator/CustomAuthenticator.php",
"language": "php",
"file_size": 835,
"cut_index": 520,
"middle_length": 52
} |
\AddSecurityVotersPass;
use Symfony\Component\DependencyInjection\Attribute\AsTaggedItem;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Definition;
use Symfony\Component\DependencyInjection\Exception\LogicException;
use Symfony\Component\DependencyInjection\Refere... | estNoVoters()
{
$container = new ContainerBuilder();
$container
->register('security.access.decision_manager', AccessDecisionManager::class)
->addArgument([])
;
$compilerPass = new AddSecurityVot | rization\Voter\Vote;
use Symfony\Component\Security\Core\Authorization\Voter\Voter;
use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
class AddSecurityVotersPassTest extends TestCase
{
public function t | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/AddSecurityVotersPassTest.php",
"language": "php",
"file_size": 9460,
"cut_index": 921,
"middle_length": 229
} |
workBundle\DependencyInjection\FrameworkExtension;
use Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler\AddSessionDomainConstraintPass;
use Symfony\Bundle\SecurityBundle\DependencyInjection\SecurityExtension;
use Symfony\Component\DependencyInjection\Alias;
use Symfony\Component\DependencyInjection\Container;... | _secure' => true, 'cookie_samesite' => 'lax']);
$utils = $container->get('security.http_utils');
$request = Request::create('/', 'get');
$this->assertTrue($utils->createRedirectResponse($request, 'https://symfony.com/blog')->isRed | Component\HttpFoundation\Request;
class AddSessionDomainConstraintPassTest extends TestCase
{
public function testSessionCookie()
{
$container = $this->createContainer(['cookie_domain' => '.symfony.com.', 'cookie | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/AddSessionDomainConstraintPassTest.php",
"language": "php",
"file_size": 9801,
"cut_index": 921,
"middle_length": 229
} |
dle\SecurityBundle\DependencyInjection\SecurityExtension;
use Symfony\Bundle\SecurityBundle\SecurityBundle;
use Symfony\Component\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\EventDispatcher\DependencyInjection\RegisterListenersPass;
use Symf... | eractiveLoginEvent;
use Symfony\Component\Security\Http\Event\LoginFailureEvent;
use Symfony\Component\Security\Http\Event\LoginSuccessEvent;
use Symfony\Component\Security\Http\Event\LogoutEvent;
use Symfony\Component\Security\Http\SecurityEvents;
class | ecurity\Core\Event\AuthenticationSuccessEvent;
use Symfony\Component\Security\Http\Event\AuthenticationTokenCreatedEvent;
use Symfony\Component\Security\Http\Event\CheckPassportEvent;
use Symfony\Component\Security\Http\Event\Int | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/RegisterGlobalSecurityEventListenersPassTest.php",
"language": "php",
"file_size": 9837,
"cut_index": 921,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection\Compiler;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler\SortFirewall... | rface;
class SortFirewallListenersPassTest extends TestCase
{
public function testSortFirewallListeners()
{
$container = new ContainerBuilder();
$container->setParameter('security.firewalls', ['main']);
$container->registe | nerBuilder;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Event\RequestEvent;
use Symfony\Component\Security\Http\Firewall\FirewallListenerInte | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/SortFirewallListenersPassTest.php",
"language": "php",
"file_size": 3342,
"cut_index": 614,
"middle_length": 229
} |
buted with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection\Security\Factory;
use PHPUnit\Framework\Attributes\DataProvider;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AbstractFactory;
use Symfony\Component\DependencyIn... | s = [
'remember_me' => true,
'login_path' => '/bar',
];
if ($serviceId) {
$options['failure_handler'] = $serviceId;
$this->container->register($serviceId, \stdClass::class);
}
| ion setUp(): void
{
$this->container = new ContainerBuilder();
}
#[DataProvider('getFailureHandlers')]
public function testDefaultFailureHandler($serviceId, $defaultHandlerInjection)
{
$option | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Security/Factory/AbstractFactoryTest.php",
"language": "php",
"file_size": 5322,
"cut_index": 716,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Debug;
use Symfony\Bundle\SecurityBundle\EventListener\FirewallListener;
use Symfony\Bundle\SecurityBundle\Security\FirewallContext;
use Symfon... | ds FirewallListener implements ResetInterface
{
private array $wrappedListeners = [];
private ?TraceableAuthenticatorManagerListener $authenticatorManagerListener = null;
public function getWrappedListeners(): array
{
return array_ | Listener;
use Symfony\Contracts\Service\ResetInterface;
/**
* Firewall collecting called security listeners and authenticators.
*
* @author Robin Chalas <robin.chalas@gmail.com>
*/
final class TraceableFirewallListener exten | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Debug/TraceableFirewallListener.php",
"language": "php",
"file_size": 3428,
"cut_index": 614,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Security;
use Psr\Container\ContainerInterface;
use Symfony\Compon... | eIdentifier = str_replace('FirewallAware', '', static::class);
if (null === $request = $this->requestStack->getCurrentRequest()) {
throw new \LogicException('Cannot determine the correct '.$serviceIdentifier.' to use: there is no active | @internal
*/
trait FirewallAwareTrait
{
private ContainerInterface $locator;
private RequestStack $requestStack;
private FirewallMap $firewallMap;
private function getForFirewall(): object
{
$servic | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Security/FirewallAwareTrait.php",
"language": "php",
"file_size": 1884,
"cut_index": 537,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\Security\Http\Firewall\ExceptionLi... | , FirewallListenerInterface> $listeners
*/
public function __construct(
private iterable $listeners,
private ?ExceptionListener $exceptionListener = null,
private ?LogoutListener $logoutListener = null,
private ?Fir | l configuration which allows us
* to lazy load the context for one specific firewall only when we need it.
*
* @author Johannes M. Schmitt <schmittjoh@gmail.com>
*/
class FirewallContext
{
/**
* @param iterable<mixed | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Security/FirewallContext.php",
"language": "php",
"file_size": 1548,
"cut_index": 537,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Security;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Eve... | d by the access listener.
*
* @author Nicolas Grekas <p@tchwork.com>
*/
class LazyFirewallContext extends FirewallContext implements FirewallListenerInterface
{
public function __construct(
iterable $listeners,
?ExceptionListener $ex | \Firewall\ExceptionListener;
use Symfony\Component\Security\Http\Firewall\FirewallListenerInterface;
use Symfony\Component\Security\Http\Firewall\LogoutListener;
/**
* Lazily calls authentication listeners when actually require | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Security/LazyFirewallContext.php",
"language": "php",
"file_size": 2464,
"cut_index": 563,
"middle_length": 229
} |
\DependencyInjection\Extension\PrependExtensionInterface;
use Symfony\Component\DependencyInjection\Loader\PhpFileLoader;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\EventDispatcher\EventDispatcher;
use Symfony\Component\ExpressionLanguage\Expression;
use Symfony\Component\ExpressionLangu... | estMatcher\MethodRequestMatcher;
use Symfony\Component\HttpFoundation\RequestMatcher\PathRequestMatcher;
use Symfony\Component\HttpFoundation\RequestMatcher\PortRequestMatcher;
use Symfony\Component\HttpKernel\KernelEvents;
use Symfony\Component\PasswordHa | ion\RequestMatcher\AttributesRequestMatcher;
use Symfony\Component\HttpFoundation\RequestMatcher\HostRequestMatcher;
use Symfony\Component\HttpFoundation\RequestMatcher\IpsRequestMatcher;
use Symfony\Component\HttpFoundation\Requ | {
"filepath": "src/Symfony/Bundle/SecurityBundle/DependencyInjection/SecurityExtension.php",
"language": "php",
"file_size": 52029,
"cut_index": 2151,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler;
use Symfony\Component\Config\Definition\Exception\InvalidConfigurationException;
use Symfony\Component\Dependency... | blic function process(ContainerBuilder $container): void
{
if (!$container->hasParameter('security.firewalls')) {
return;
}
$firewalls = $container->getParameter('security.firewalls');
foreach ($firewalls as | yInjection\Reference;
use Symfony\Component\Security\Http\EntryPoint\AuthenticationEntryPointInterface;
/**
* @author Wouter de Jong <wouter@wouterj.nl>
*/
class RegisterEntryPointPass implements CompilerPassInterface
{
pu | {
"filepath": "src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/RegisterEntryPointPass.php",
"language": "php",
"file_size": 3980,
"cut_index": 614,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection\Compiler;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\Secur... | ->addCompilerPass(new AddExpressionLanguageProvidersPass());
$definition = new Definition(\stdClass::class);
$definition->addTag('security.expression_language_provider');
$container->setDefinition('some_security_provider', $definit | Symfony\Component\DependencyInjection\Reference;
class AddExpressionLanguageProvidersPassTest extends TestCase
{
public function testProcessForSecurity()
{
$container = new ContainerBuilder();
$container | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/AddExpressionLanguageProvidersPassTest.php",
"language": "php",
"file_size": 2413,
"cut_index": 563,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection\Compiler;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler\RegisterEntr... | ent\Security\Core\Authentication\Token\TokenInterface;
use Symfony\Component\Security\Core\Exception\AuthenticationException;
use Symfony\Component\Security\Core\Exception\BadCredentialsException;
use Symfony\Component\Security\Http\Authentication\Authenti | ition;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Compon | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/RegisterEntryPointsPassTest.php",
"language": "php",
"file_size": 3855,
"cut_index": 614,
"middle_length": 229
} |
\OidcUserInfoTokenHandlerFactory;
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\AccessToken\ServiceTokenHandlerFactory;
use Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory\AccessTokenFactory;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
use Symfony\Component\C... | dc\OidcTokenHandler;
use Symfony\Contracts\Cache\CacheInterface;
use Symfony\Contracts\HttpClient\HttpClientInterface;
class AccessTokenFactoryTest extends TestCase
{
public function testBasicServiceConfiguration()
{
$container = new Conta | ponent\DependencyInjection\Exception\LogicException;
use Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\Security\Http\AccessToken\Oidc\OidcTokenGenerator;
use Symfony\Component\Security\Http\AccessToken\Oi | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Security/Factory/AccessTokenFactoryTest.php",
"language": "php",
"file_size": 30519,
"cut_index": 1331,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection\Security\Factory;
use PHPUnit\Framework\... | te' => 'app_check_login_link',
'lifetime' => 500,
'signature_properties' => ['email', 'password'],
'success_handler' => 'success_handler_service_id',
'failure_handler' => 'failure_handler_service_id',
| pendencyInjection\ContainerBuilder;
class LoginLinkFactoryTest extends TestCase
{
public function testBasicServiceConfiguration()
{
$container = new ContainerBuilder();
$config = [
'check_rou | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Security/Factory/LoginLinkFactoryTest.php",
"language": "php",
"file_size": 1805,
"cut_index": 537,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Security;
/**
* @author Robin Chalas <robin.chalas@gmail.com>
*/
final class FirewallConfi... | tryPoint = null,
private readonly ?string $accessDeniedHandler = null,
private readonly ?string $accessDeniedUrl = null,
private readonly array $authenticators = [],
private readonly ?array $switchUser = null,
privat | te readonly bool $securityEnabled = true,
private readonly bool $stateless = false,
private readonly ?string $provider = null,
private readonly ?string $context = null,
private readonly ?string $en | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Security/FirewallConfig.php",
"language": "php",
"file_size": 2586,
"cut_index": 563,
"middle_length": 229
} |
file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler;
use Symfony\Component\Depend... | emberMeVerifierPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container): void
{
if (!$container->hasDefinition('cache.system')) {
$container->removeDefinition('cache.security_token_verifier'); | rdi Boggiano <j.boggiano@seld.be>
*/
class CleanRem | {
"filepath": "src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/CleanRememberMeVerifierPass.php",
"language": "php",
"file_size": 856,
"cut_index": 529,
"middle_length": 52
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface;
use Symfony\Component\DependencyInjecti... | ny\Component\Security\Http\Event\LoginSuccessEvent;
use Symfony\Component\Security\Http\Event\LogoutEvent;
use Symfony\Component\Security\Http\Event\TokenDeauthenticatedEvent;
use Symfony\Component\Security\Http\SecurityEvents;
/**
* Makes sure all event | uthenticationTokenCreatedEvent;
use Symfony\Component\Security\Http\Event\CheckPassportEvent;
use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
use Symfony\Component\Security\Http\Event\LoginFailureEvent;
use Symfo | {
"filepath": "src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/RegisterGlobalSecurityEventListenersPass.php",
"language": "php",
"file_size": 3136,
"cut_index": 614,
"middle_length": 229
} |
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection\Compiler;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler\RegisterToke... | uthentication\Token\Storage\UsageTrackingTokenStorage;
use Symfony\Component\Security\Http\Firewall\ContextListener;
class RegisterTokenUsageTrackingPassTest extends TestCase
{
public function testTokenStorageIsUntrackedIfSessionIsMissing()
{
| se Symfony\Component\DependencyInjection\Reference;
use Symfony\Component\HttpFoundation\Session\SessionFactory;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorage;
use Symfony\Component\Security\Core\A | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/RegisterTokenUsageTrackingPassTest.php",
"language": "php",
"file_size": 4091,
"cut_index": 614,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Debug;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Re... | ps a lazy security listener.
*
* @author Robin Chalas <robin.chalas@gmail.com>
*
* @internal
*/
final class WrappedLazyListener extends AbstractListener
{
private ?Response $response = null;
private FirewallListenerInterface $listener;
pri | bleAuthenticatorManagerListener;
use Symfony\Component\Security\Http\Firewall\AbstractListener;
use Symfony\Component\Security\Http\Firewall\FirewallListenerInterface;
use Symfony\Component\VarDumper\Caster\ClassStub;
/**
* Wra | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Debug/WrappedLazyListener.php",
"language": "php",
"file_size": 2346,
"cut_index": 563,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Tests\DependencyInjection\Compiler;
use PHPUnit\Framework\TestCase;
use Symfony\Bundle\Secur... | se Symfony\Component\Stopwatch\Stopwatch;
class MakeFirewallsEventDispatcherTraceablePassTest extends TestCase
{
private ContainerBuilder $container;
protected function setUp(): void
{
$this->container = new ContainerBuilder();
| t\DependencyInjection\Compiler\PassConfig;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\EventDispatcher\Debug\TraceableEventDispatcher;
use Symfony\Component\EventDispatcher\EventDispatcher;
u | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Tests/DependencyInjection/Compiler/MakeFirewallsEventDispatcherTraceablePassTest.php",
"language": "php",
"file_size": 2764,
"cut_index": 563,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Compiler;
use Symfony\Component\DependencyInjection\Argument\IteratorArg... | ymfony\Component\Security\Core\Authorization\Voter\TraceableVoter;
use Symfony\Component\Security\Core\Authorization\Voter\VoterInterface;
/**
* Adds all configured security voters to the access decision manager.
*
* @author Johannes M. Schmitt <schmit | ction\Compiler\PriorityTaggedServiceTrait;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Exception\LogicException;
use Symfony\Component\DependencyInjection\Reference;
use S | {
"filepath": "src/Symfony/Bundle/SecurityBundle/DependencyInjection/Compiler/AddSecurityVotersPass.php",
"language": "php",
"file_size": 2757,
"cut_index": 563,
"middle_length": 229
} |
part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\Security;
use Psr\Container\ContainerInterface;
use Symfony\Compon... | the current firewall.
*
* @author Wouter de Jong <wouter@wouterj.nl>
*
* @final
*/
class UserAuthenticator implements UserAuthenticatorInterface
{
use FirewallAwareTrait;
public function __construct(FirewallMap $firewallMap, ContainerInterfa | y\Component\Security\Http\Authentication\UserAuthenticatorInterface;
use Symfony\Component\Security\Http\Authenticator\AuthenticatorInterface;
/**
* A decorator that delegates all method calls to the authenticator
* manager of | {
"filepath": "src/Symfony/Bundle/SecurityBundle/Security/UserAuthenticator.php",
"language": "php",
"file_size": 1518,
"cut_index": 537,
"middle_length": 229
} |
<?php
/*
* This file is part of the Symfony package.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\SecurityBundle\DependencyInjection\Security\Factory;
use... | g <wouter@wouterj.nl>
*/
interface StatelessAuthenticatorFactoryInterface extends AuthenticatorFactoryInterface
{
public function createAuthenticator(ContainerBuilder $container, string $firewallName, array $config, ?string $userProviderId): string|ar | less firewalls, as statefull firewalls
* need the user provider to refresh the user in each subsequent request. A
* stateless authenticator can be used on both stateless and statefull authenticators.
*
* @author Wouter de Jon | {
"filepath": "src/Symfony/Bundle/SecurityBundle/DependencyInjection/Security/Factory/StatelessAuthenticatorFactoryInterface.php",
"language": "php",
"file_size": 1004,
"cut_index": 512,
"middle_length": 229
} |
ge.
*
* (c) Fabien Potencier <fabien@symfony.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Symfony\Bundle\TwigBundle\Tests\Functional;
use Symfony\Bundle\TwigBundle\Tests\TestCase;
use Symfony\Bundle\TwigBundle\Tw... | $kernel->boot();
$this->assertTrue($kernel->getContainer()->hasParameter('twig.default_path'));
$this->assertNotEmpty($kernel->getContainer()->getParameter('twig.default_path'));
}
protected function setUp(): void
{
$t | se Symfony\Component\Filesystem\Filesystem;
use Symfony\Component\HttpKernel\Kernel;
class EmptyAppTest extends TestCase
{
public function testBootEmptyApp()
{
$kernel = new EmptyAppKernel('test', true);
| {
"filepath": "src/Symfony/Bundle/TwigBundle/Tests/Functional/EmptyAppTest.php",
"language": "php",
"file_size": 2162,
"cut_index": 563,
"middle_length": 229
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.