PHP Class QueryAuth\Request\RequestValidator

Afficher le fichier Open project: jeremykendall/query-auth Class Usage Examples

Méthodes publiques

Méthode Description
__construct ( QueryAuth\SignatureInterface $signature ) Public constructor
getDrift ( ) : integer Get drift
getSignature ( ) : Signature Get Signature
isValid ( QueryAuth\Request\RequestInterface $request, QueryAuth\Credentials\CredentialsInterface $credentials ) : boolean Is signature valid?
setDrift ( integer $drift ) Set drift
setSignature ( QueryAuth\SignatureInterface $signature ) Set Signature

Méthodes protégées

Méthode Description
isDriftExceeded ( array $params ) : boolean Is $timestamp greater than or less than $drift seconds?
isSignaturePresent ( array $params ) Throws exception if signature is not present in request
isTimestampPresent ( array $params ) Throws exception if timestamp is not present in request

Method Details

__construct() public méthode

Public constructor
public __construct ( QueryAuth\SignatureInterface $signature )
$signature QueryAuth\SignatureInterface Instance of the signature creation interface

getDrift() public méthode

Get drift
public getDrift ( ) : integer
Résultat integer $drift Permissible drift in seconds

getSignature() public méthode

Get Signature
public getSignature ( ) : Signature
Résultat Signature Instance of the signature creation class

isDriftExceeded() protected méthode

Is $timestamp greater than or less than $drift seconds?
protected isDriftExceeded ( array $params ) : boolean
$params array Request params
Résultat boolean

isSignaturePresent() protected méthode

Throws exception if signature is not present in request
protected isSignaturePresent ( array $params )
$params array Request params

isTimestampPresent() protected méthode

Throws exception if timestamp is not present in request
protected isTimestampPresent ( array $params )
$params array Request params

isValid() public méthode

Is signature valid?
public isValid ( QueryAuth\Request\RequestInterface $request, QueryAuth\Credentials\CredentialsInterface $credentials ) : boolean
$request QueryAuth\Request\RequestInterface Request
$credentials QueryAuth\Credentials\CredentialsInterface Credentials
Résultat boolean

setDrift() public méthode

Set drift
public setDrift ( integer $drift )
$drift integer Permissible drift in seconds

setSignature() public méthode

Set Signature
public setSignature ( QueryAuth\SignatureInterface $signature )
$signature QueryAuth\SignatureInterface Instance of the signature creation class