PHP Class PSR7Sessions\Storageless\Http\SessionMiddleware

Inheritance: implements Zend\Stratigility\MiddlewareInterface
Show file Open project: Ocramius/PSR7Session

Public Methods

Method Description
__construct ( Lcobucci\JWT\Signer $signer, string $signatureKey, string $verificationKey, Dflydev\FigCookies\SetCookie $defaultCookie, Parser $tokenParser, integer $expirationTime, PSR7Sessions\Storageless\Time\CurrentTimeProviderInterface $currentTimeProvider, integer $refreshTime = self::DEFAULT_REFRESH_TIME )
__invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $out = null ) : Psr\Http\Message\ResponseInterface
extractSessionContainer ( Token $token = null ) : PSR7Sessions\Storageless\Session\SessionInterface
fromAsymmetricKeyDefaults ( string $privateRsaKey, string $publicRsaKey, integer $expirationTime ) : SessionMiddleware This constructor simplifies instantiation when using HTTPS (REQUIRED!) and asymmetric key encription based on RSA keys
fromSymmetricKeyDefaults ( string $symmetricKey, integer $expirationTime ) : SessionMiddleware This constructor simplifies instantiation when using HTTPS (REQUIRED!) and symmetric key encription

Private Methods

Method Description
appendToken ( PSR7Sessions\Storageless\Session\SessionInterface $sessionContainer, Psr\Http\Message\ResponseInterface $response, Token $token = null ) : Psr\Http\Message\ResponseInterface
getExpirationCookie ( ) : Dflydev\FigCookies\SetCookie
getTokenCookie ( PSR7Sessions\Storageless\Session\SessionInterface $sessionContainer ) : Dflydev\FigCookies\SetCookie
parseToken ( Psr\Http\Message\ServerRequestInterface $request ) : Token | null Extract the token from the given request object
shouldTokenBeRefreshed ( Token $token ) : boolean {@inheritDoc}
timestamp ( ) : integer

Method Details

__construct() public method

public __construct ( Lcobucci\JWT\Signer $signer, string $signatureKey, string $verificationKey, Dflydev\FigCookies\SetCookie $defaultCookie, Parser $tokenParser, integer $expirationTime, PSR7Sessions\Storageless\Time\CurrentTimeProviderInterface $currentTimeProvider, integer $refreshTime = self::DEFAULT_REFRESH_TIME )
$signer Lcobucci\JWT\Signer
$signatureKey string
$verificationKey string
$defaultCookie Dflydev\FigCookies\SetCookie
$tokenParser Lcobucci\JWT\Parser
$expirationTime integer
$currentTimeProvider PSR7Sessions\Storageless\Time\CurrentTimeProviderInterface
$refreshTime integer

__invoke() public method

public __invoke ( Psr\Http\Message\ServerRequestInterface $request, Psr\Http\Message\ResponseInterface $response, callable $out = null ) : Psr\Http\Message\ResponseInterface
$request Psr\Http\Message\ServerRequestInterface
$response Psr\Http\Message\ResponseInterface
$out callable
return Psr\Http\Message\ResponseInterface

extractSessionContainer() public method

public extractSessionContainer ( Token $token = null ) : PSR7Sessions\Storageless\Session\SessionInterface
$token Lcobucci\JWT\Token
return PSR7Sessions\Storageless\Session\SessionInterface

fromAsymmetricKeyDefaults() public static method

This constructor simplifies instantiation when using HTTPS (REQUIRED!) and asymmetric key encription based on RSA keys
public static fromAsymmetricKeyDefaults ( string $privateRsaKey, string $publicRsaKey, integer $expirationTime ) : SessionMiddleware
$privateRsaKey string
$publicRsaKey string
$expirationTime integer
return SessionMiddleware

fromSymmetricKeyDefaults() public static method

This constructor simplifies instantiation when using HTTPS (REQUIRED!) and symmetric key encription
public static fromSymmetricKeyDefaults ( string $symmetricKey, integer $expirationTime ) : SessionMiddleware
$symmetricKey string
$expirationTime integer
return SessionMiddleware