PHP Class Trianglman\Sqrl\SqrlValidate

If a database is configured, this will also check to see if the public key matches a previously encountered key. If it does it will load an identifier. If there is no match, it will store the public key and generate an identifier.
Author: johnj
Inheritance: implements Trianglman\Sqrl\SqrlValidateInterface
Mostrar archivo Open project: trianglman/sqrl

Protected Properties

Property Type Description
$configuration SqrlConfiguration
$store Trianglman\Sqrl\SqrlStoreInterface
$validator Trianglman\Sqrl\NonceValidatorInterface

Public Methods

Method Description
__construct ( SqrlConfiguration $config, Trianglman\Sqrl\NonceValidatorInterface $validator, Trianglman\Sqrl\SqrlStoreInterface $storage )
nutIPMatches ( string $nut, string $ip ) : boolean Verifies the original nut's IP matches the current IP
validateNut ( string $nut, string $signingKey = null ) : integer Validates a supplied nut
validateServer ( string $server, string $nut, string $secure ) : boolean Validates the returned server value
validateSignature ( string $orig, string $key, string $sig ) : boolean Validates a secondary request signature (Unlock Request or New Key)

Protected Methods

Method Description
generateQry ( $nut ) : string This should eventually become a trait and share the functionality with SqrlGenerate instead of being duplicate code
getUrl ( $nut ) : string This should eventually become a trait and share the functionality with SqrlGenerate instead of being duplicate code

Method Details

__construct() public method

public __construct ( SqrlConfiguration $config, Trianglman\Sqrl\NonceValidatorInterface $validator, Trianglman\Sqrl\SqrlStoreInterface $storage )
$config SqrlConfiguration
$validator Trianglman\Sqrl\NonceValidatorInterface
$storage Trianglman\Sqrl\SqrlStoreInterface

generateQry() protected method

This should eventually become a trait and share the functionality with SqrlGenerate instead of being duplicate code
protected generateQry ( $nut ) : string
return string

getUrl() protected method

This should eventually become a trait and share the functionality with SqrlGenerate instead of being duplicate code
protected getUrl ( $nut ) : string
return string

nutIPMatches() public method

Verifies the original nut's IP matches the current IP
public nutIPMatches ( string $nut, string $ip ) : boolean
$nut string
$ip string
return boolean

validateNut() public method

Validates a supplied nut
public validateNut ( string $nut, string $signingKey = null ) : integer
$nut string
$signingKey string The key used to sign the current request
return integer One of the nut class constants

validateServer() public method

Validates the returned server value
public validateServer ( string $server, string $nut, string $secure ) : boolean
$server string The returned server value
$nut string The nut from the request
$secure string Whether the request was secure
return boolean

validateSignature() public method

Validates a secondary request signature (Unlock Request or New Key)
public validateSignature ( string $orig, string $key, string $sig ) : boolean
$orig string
$key string
$sig string
return boolean

Property Details

$configuration protected_oe property

protected SqrlConfiguration,Trianglman\Sqrl $configuration
return SqrlConfiguration

$store protected_oe property

protected SqrlStoreInterface,Trianglman\Sqrl $store
return Trianglman\Sqrl\SqrlStoreInterface

$validator protected_oe property

protected NonceValidatorInterface,Trianglman\Sqrl $validator
return Trianglman\Sqrl\NonceValidatorInterface