From 08882233edb56f3d4d31cee26491d20ec547de3d Mon Sep 17 00:00:00 2001 From: "Ronald A. Richardson" Date: Fri, 18 Oct 2024 13:49:33 +0800 Subject: [PATCH] patch send webhook and connection config --- composer.json | 2 +- config/webhook-server.php | 2 +- src/Listeners/SendResourceLifecycleWebhook.php | 8 ++++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/composer.json b/composer.json index aa28a1a..67af499 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,6 @@ { "name": "fleetbase/core-api", - "version": "1.5.17", + "version": "1.5.18", "description": "Core Framework and Resources for Fleetbase API", "keywords": [ "fleetbase", diff --git a/config/webhook-server.php b/config/webhook-server.php index 7815919..97af37f 100644 --- a/config/webhook-server.php +++ b/config/webhook-server.php @@ -4,7 +4,7 @@ /* * The default queue that should be used to send webhook requests. */ - 'queue' => 'default', + 'queue' => env('WEBHOOK_SERVER_QUEUE'), /* * The default http verb to use. diff --git a/src/Listeners/SendResourceLifecycleWebhook.php b/src/Listeners/SendResourceLifecycleWebhook.php index fc3dfd0..d9d9b9c 100644 --- a/src/Listeners/SendResourceLifecycleWebhook.php +++ b/src/Listeners/SendResourceLifecycleWebhook.php @@ -134,13 +134,13 @@ public function handle($event) ]; // Validate api credential, if not uuid then it could be internal - if (session('api_credential') && Str::isUuid(session('api_credential')) && ApiCredential::where('uuid', session('api_credential'))->exists()) { - $webhookRequestLogData['api_credential_uuid'] = session('api_credential'); + if (isset($eventData['api_credential_uuid'])) { + $webhookRequestLogData['api_credential_uuid'] = $eventData['api_credential_uuid']; } // Check if it was a personal access token which made the request - if (session('api_credential') && PersonalAccessToken::where('id', session('api_credential'))->exists()) { - $webhookRequestLogData['access_token_id'] = session('api_credential'); + if (isset($eventData['access_token_id'])) { + $webhookRequestLogData['access_token_id'] = $eventData['access_token_id']; } // log webhook error in logs