Skip to content
This repository has been archived by the owner on Dec 12, 2019. It is now read-only.

Commit

Permalink
add verify hash to provisioning requests
Browse files Browse the repository at this point in the history
  • Loading branch information
bajb committed Mar 9, 2018
1 parent 804fc34 commit 59373d0
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/ProvisioningRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ class ProvisioningRequest extends ProvisioningBaseData
*/
public $updateUrl;

/**
* @var string Hash to verify your request
*/
public $verifyHash;

public function hydrate($from)
{
parent::hydrate($from);
Expand All @@ -49,4 +54,14 @@ public function hydrate($from)
return $this;
}

/**
* @param $provisioningKey - Configured
*
* @return bool
*/
public function isVerified($provisioningKey)
{
return $this->verifyHash == md5($this->transportKey . $provisioningKey);
}

}

0 comments on commit 59373d0

Please sign in to comment.