PHP Class Psr7Middlewares\Middleware\Csrf

Inheritance: use trait Psr7Middlewares\Utils\FormTrait
Exibir arquivo Open project: oscarotero/psr7-middlewares

Public Methods

Method Description
__invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface Execute the middleware.
getGenerator ( Psr\Http\Message\ServerRequestInterface $request ) : callable | null Returns a callable to generate the inputs.

Private Methods

Method Description
encode ( string $value ) : string Encode string with base64, but strip padding.
generateTokens ( Psr\Http\Message\ServerRequestInterface $request, string $lockTo, array &$tokens ) : string Generate and retrieve the tokens.
validateRequest ( Psr\Http\Message\ServerRequestInterface $request, array &$tokens ) : boolean Validate the request.

Method Details

__invoke() public method

Execute the middleware.
public __invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $next ) : Psr\Http\Message\ResponseInterface
$request Psr\Http\Message\ServerRequestInterface
$response Psr\Http\Message\ResponseInterface
$next callable
return Psr\Http\Message\ResponseInterface

getGenerator() public static method

Returns a callable to generate the inputs.
public static getGenerator ( Psr\Http\Message\ServerRequestInterface $request ) : callable | null
$request Psr\Http\Message\ServerRequestInterface
return callable | null