PHP Interface Trianglman\Sqrl\SqrlRequestHandlerInterface

This class will process a request, send it to the validator, then depending on the type of request, send a success message, send an error message, or send a request for more information (e.g. initiate the second loop to create a new user)
Author: johnj
Afficher le fichier Open project: trianglman/sqrl

Méthodes publiques

Méthode Description
__construct ( SqrlConfiguration $config, Trianglman\Sqrl\SqrlValidateInterface $val, Trianglman\Sqrl\SqrlStoreInterface $store = null, Trianglman\Sqrl\SqrlGenerateInterface $gen = null ) : Trianglman\Sqrl\SqrlRequestHandlerInterface Initializes the Request Handler
getResponseCode ( ) : integer Gets the numeric HTTP code to return to the SQRL client
getResponseMessage ( ) : string Gets the text message to be returned to the SQRL client
parseRequest ( array $get, array $post, array $server ) : void Parses a user request
sendResponse ( ) : void A helper function to send the response message and code to the SQRL client

Method Details

__construct() public méthode

Initializes the Request Handler
public __construct ( SqrlConfiguration $config, Trianglman\Sqrl\SqrlValidateInterface $val, Trianglman\Sqrl\SqrlStoreInterface $store = null, Trianglman\Sqrl\SqrlGenerateInterface $gen = null ) : Trianglman\Sqrl\SqrlRequestHandlerInterface
$config SqrlConfiguration
$val Trianglman\Sqrl\SqrlValidateInterface Sets the validator that will check the response
$store Trianglman\Sqrl\SqrlStoreInterface [Optional] Sets storage for submitted authorization keys
$gen Trianglman\Sqrl\SqrlGenerateInterface [Optional] Sets the nonce generator for loop two
Résultat Trianglman\Sqrl\SqrlRequestHandlerInterface

getResponseCode() public méthode

Currently the spec only uses the 200 code with the TIF containing a protocol status code
public getResponseCode ( ) : integer
Résultat integer

getResponseMessage() public méthode

Gets the text message to be returned to the SQRL client
public getResponseMessage ( ) : string
Résultat string

parseRequest() public méthode

This will determine what type of request is being performed and set values up for use in validation and creating the response.
public parseRequest ( array $get, array $post, array $server ) : void
$get array The user's GET request
$post array The user's POST body
$server array Server level variables (the _SERVER array)
Résultat void

sendResponse() public méthode

A helper function to send the response message and code to the SQRL client
public sendResponse ( ) : void
Résultat void