|
@@ 71-75 (lines=5) @@
|
| 68 |
|
$hmac = $request->input('signed'); |
| 69 |
|
$status = $request->input('installed'); |
| 70 |
|
|
| 71 |
|
if (base64_decode($hmac) !== hash_hmac('sha256', $server->uuid, $server->node->daemonSecret, true)) { |
| 72 |
|
return response()->json([ |
| 73 |
|
'error' => 'Signed HMAC was invalid.', |
| 74 |
|
], 403); |
| 75 |
|
} |
| 76 |
|
|
| 77 |
|
$server->installed = ($status === 'installed') ? 1 : 2; |
| 78 |
|
$server->save(); |
|
@@ 95-99 (lines=5) @@
|
| 92 |
|
} |
| 93 |
|
|
| 94 |
|
$hmac = $request->input('signed'); |
| 95 |
|
if (base64_decode($hmac) !== hash_hmac('sha256', $server->uuid, $server->node->daemonSecret, true)) { |
| 96 |
|
return response()->json([ |
| 97 |
|
'error' => 'Signed HMAC was invalid.', |
| 98 |
|
], 403); |
| 99 |
|
} |
| 100 |
|
|
| 101 |
|
// Passes Validation, Setup Notifications |
| 102 |
|
$notify = new NotificationService($server); |