From 324f2c856ffd50e1bf8eadba02e808d10180abf2 Mon Sep 17 00:00:00 2001 From: Jeppe B <2jepp9350@gmail.com> Date: Mon, 1 Jun 2026 22:50:00 +0200 Subject: [PATCH] Fix Limble auth and secure request handling --- .../app/modules/limble/classes/limble_request.php | 12 ++++-------- services/nginx/app/routes/moduleLimbleRoute.php | 7 +++---- 2 files changed, 7 insertions(+), 12 deletions(-) diff --git a/services/nginx/app/modules/limble/classes/limble_request.php b/services/nginx/app/modules/limble/classes/limble_request.php index 43596a2a..9feb1e9f 100644 --- a/services/nginx/app/modules/limble/classes/limble_request.php +++ b/services/nginx/app/modules/limble/classes/limble_request.php @@ -29,8 +29,8 @@ class limble_request implements limble_request_i curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); // Set options to return the response and handle SSL curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); + curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, true); + curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, 2); // Execute the request $response = curl_exec($ch); // Check for errors @@ -44,11 +44,7 @@ class limble_request implements limble_request_i // Check if the response is successful if ($httpCode < 200 || $httpCode >= 300) { $slack = new \classes\slack(); - echo 'Attempting credentials: ' . $url . ' with method: ' . $method . ' and data: ' . json_encode($data) . "\n"; - echo 'Response: ' . $response . "\n"; - echo 'HTTP Code: ' . $httpCode . "\n"; - echo 'Headers: ' . json_encode($headers) . "\n"; - $slack->send_message('Limble Request Failed: ' . $response, 'Limble Request Error'); + $slack->send_message('Limble Request Failed with status code: ' . $httpCode, 'Limble Request Error'); throw new \Exception('Request failed with status code ' . $httpCode); } // Check if the response is valid JSON @@ -68,4 +64,4 @@ class limble_request implements limble_request_i // Generate the Basic Auth header using the client ID and secret return 'Authorization: Basic ' . base64_encode($client_id . ':' . $client_secret); } -} \ No newline at end of file +} diff --git a/services/nginx/app/routes/moduleLimbleRoute.php b/services/nginx/app/routes/moduleLimbleRoute.php index f5cbcb76..c3a222ce 100644 --- a/services/nginx/app/routes/moduleLimbleRoute.php +++ b/services/nginx/app/routes/moduleLimbleRoute.php @@ -22,8 +22,7 @@ class moduleLimbleRoute $this->post('/modules/limble/webhook/task', function () { global $response; $slack = new slack(); - //TODO: Add authentication of some sort here - //self::requirePermission('modules_limble_webhooks_task'); + self::requirePermission('modules_limble_webhooks_task'); // Check if the module is enabled $limble = new limble(); $limble->requireModuleEnabled(); @@ -45,7 +44,7 @@ class moduleLimbleRoute global $response; $slack = new slack(); $slack->send_message('Limble Tasks Endpoint Triggered', 'Limble Tasks'); - //self::requirePermission('modules_limble_tasks'); + self::requirePermission('modules_limble_tasks'); // Check if the module is enabled $limble = new limble(); $limble->requireModuleEnabled(); @@ -61,4 +60,4 @@ class moduleLimbleRoute ] ); } -} \ No newline at end of file +}