PHP 인터페이스 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)
저자: johnj
파일 보기 프로젝트 열기: trianglman/sqrl

공개 메소드들

메소드 설명
__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

메소드 상세

__construct() 공개 메소드

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
리턴 Trianglman\Sqrl\SqrlRequestHandlerInterface

getResponseCode() 공개 메소드

Currently the spec only uses the 200 code with the TIF containing a protocol status code
public getResponseCode ( ) : integer
리턴 integer

getResponseMessage() 공개 메소드

Gets the text message to be returned to the SQRL client
public getResponseMessage ( ) : string
리턴 string

parseRequest() 공개 메소드

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)
리턴 void

sendResponse() 공개 메소드

A helper function to send the response message and code to the SQRL client
public sendResponse ( ) : void
리턴 void