PHP Class Trianglman\Sqrl\SqrlRequestHandler
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)
ファイルを表示
Open project: trianglman/sqrl
Class Usage Examples
Protected Properties
Public Methods
Method |
Description |
|
__construct ( SqrlConfiguration $config, Trianglman\Sqrl\SqrlValidateInterface $val, Trianglman\Sqrl\SqrlStoreInterface $store = null, Trianglman\Sqrl\SqrlGenerateInterface $gen = null ) |
|
|
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 |
|
Protected Methods
Private Methods
Method Details
__construct()
public method
public __construct ( SqrlConfiguration $config, Trianglman\Sqrl\SqrlValidateInterface $val, Trianglman\Sqrl\SqrlStoreInterface $store = null, Trianglman\Sqrl\SqrlGenerateInterface $gen = null ) |
$config |
SqrlConfiguration |
|
$val |
Trianglman\Sqrl\SqrlValidateInterface |
|
$store |
Trianglman\Sqrl\SqrlStoreInterface |
|
$gen |
Trianglman\Sqrl\SqrlGenerateInterface |
|
base64URLDecode()
protected method
Basically the same as base64 decoding, but replacing URL safe "-" with "+"
and "_" with "/". Automatically detects if the trailing "=" padding has
been removed.
base64UrlEncode()
protected method
Basically the same as base64 encoding, but replacing "+" with "-" and
"/" with "_" to make it safe to include in a URL
Optionally removes trailing "=" padding characters.
protected base64UrlEncode ( string $string, type $stripEquals = true ) : string |
$string |
string |
The string to encode |
$stripEquals |
type |
[Optional] Whether to strip the "=" off of the end |
return |
string |
|
getResponseCode()
public method
Currently the spec only uses the 200 code and any error message is in the
test message response
getResponseMessage()
public method
Gets the text message to be returned to the SQRL client
parseClient()
protected method
Takes a (base64Url decoded) client value string and breaks it into its individual values
parseRequest()
public method
This will determine what type of request is being performed and set values
up for use in validation and creating the response.
parseServer()
protected method
sendResponse()
public method
A helper function to send the response message and code to the SQRL client
Property Details
$actions protected_oe property
$authenticationKey protected_oe property
protected $authenticationKey |
$clientOptions protected_oe property
$clientSUK protected_oe property
$clientVUK protected_oe property
$config protected_oe property
protected SqrlConfiguration,Trianglman\Sqrl $config |
return |
SqrlConfiguration |
|
$ipMatch protected_oe property
$previousIdKey protected_oe property
$requestNut protected_oe property
$responseCode protected_oe property
$sqrlGenerator protected_oe property
protected SqrlGenerateInterface,Trianglman\Sqrl $sqrlGenerator |
return |
Trianglman\Sqrl\SqrlGenerateInterface |
|
$store protected_oe property
protected SqrlStoreInterface,Trianglman\Sqrl $store |
return |
Trianglman\Sqrl\SqrlStoreInterface |
|
$tif protected_oe property
$validator protected_oe property
protected SqrlValidateInterface,Trianglman\Sqrl $validator |
return |
Trianglman\Sqrl\SqrlValidateInterface |
|