PHP Класс eZ\Bundle\EzPublishRestBundle\EventListener\CsrfListener

Наследование: implements Symfony\Component\EventDispatcher\EventSubscriberInterface
Показать файл Открыть проект

Открытые методы

Метод Описание
__construct ( Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher, boolean $csrfEnabled, string $csrfTokenIntention, Symfony\Component\Security\Csrf\CsrfTokenManagerInterface $csrfTokenManager = null ) Note that CSRF provider needs to be optional as it will not be available when CSRF protection is disabled.
getSubscribedEvents ( ) : array
onKernelRequest ( GetResponseEvent $event ) This method validates CSRF token if CSRF protection is enabled.

Защищенные методы

Метод Описание
checkCsrfToken ( Request $request ) : boolean Checks the validity of the request's csrf token header.
isLoginRequest ( string $route ) : boolean
isMethodSafe ( string $method ) : boolean
isSessionRoute ( string $route ) : boolean Tests if a given $route is a session management one.

Описание методов

__construct() публичный метод

Note that CSRF provider needs to be optional as it will not be available when CSRF protection is disabled.
public __construct ( Symfony\Component\EventDispatcher\EventDispatcherInterface $eventDispatcher, boolean $csrfEnabled, string $csrfTokenIntention, Symfony\Component\Security\Csrf\CsrfTokenManagerInterface $csrfTokenManager = null )
$eventDispatcher Symfony\Component\EventDispatcher\EventDispatcherInterface
$csrfEnabled boolean
$csrfTokenIntention string
$csrfTokenManager Symfony\Component\Security\Csrf\CsrfTokenManagerInterface

checkCsrfToken() защищенный метод

Checks the validity of the request's csrf token header.
protected checkCsrfToken ( Request $request ) : boolean
$request Symfony\Component\HttpFoundation\Request
Результат boolean true/false if the token is valid/invalid, false if none was found in the request's headers.

getSubscribedEvents() публичный статический метод

public static getSubscribedEvents ( ) : array
Результат array

isLoginRequest() защищенный метод

Устаревший: Deprecated since 6.5. Use isSessionRoute() instead.
protected isLoginRequest ( string $route ) : boolean
$route string
Результат boolean

isMethodSafe() защищенный метод

protected isMethodSafe ( string $method ) : boolean
$method string
Результат boolean

isSessionRoute() защищенный метод

Tests if a given $route is a session management one.
protected isSessionRoute ( string $route ) : boolean
$route string
Результат boolean

onKernelRequest() публичный метод

This method validates CSRF token if CSRF protection is enabled.
public onKernelRequest ( GetResponseEvent $event )
$event Symfony\Component\HttpKernel\Event\GetResponseEvent