← All changes
|
app/Http/Controllers/ChatMessageParserController.php
+6
-14
2.2.0
→
2.4.5
View file →
| @@ -7,18 +7,16 @@ | ||
| 7 | 7 | use FluentSupport\App\Services\ThirdParty\HandleSlackEvent; |
| 8 | 8 | use FluentSupport\App\Services\ThirdParty\HandleTelegramEvent; |
| 9 | 9 | |
| 10 | 10 | /** |
| 11 | - * ChatMessageParserController class is responsible for getting information from integrated 3rd party request and response | |
| 12 | - * @package FluentSupport\App\Http\Controllers | |
| 13 | - * | |
| 14 | - * @version 1.0.0 | |
| 11 | + * Incoming webhooks from chat integrations (Telegram, Slack). | |
| 15 | 12 | */ |
| 16 | 13 | |
| 17 | 14 | class ChatMessageParserController extends Controller |
| 18 | 15 | { |
| 19 | 16 | /** |
| 20 | - * handleTelegramWebhook will get the content from telegram, check the data validity and create response in a ticket | |
| 17 | + * Records a Telegram reply as a ticket response. | |
| 18 | + * | |
| 21 | 19 | * @param Request $request |
| 22 | 20 | * @param HandleTelegramEvent $handler |
| 23 | 21 | * @param string $token |
| 24 | 22 | * @throws Exception |
| @@ -47,12 +45,11 @@ | ||
| 47 | 45 | } |
| 48 | 46 | } |
| 49 | 47 | |
| 50 | 48 | /** |
| 51 | - * handleSlackEvent responsible for getting information from integrated slack request and response | |
| 52 | 49 | * @param Request $request |
| 53 | 50 | * @param HandleSlackEvent $handler |
| 54 | - * @param $token | |
| 51 | + * @param string $token | |
| 55 | 52 | * @return array |
| 56 | 53 | */ |
| 57 | 54 | public function handleSlackEvent(Request $request, HandleSlackEvent $handler, $token) |
| 58 | 55 | { |
| @@ -82,15 +79,10 @@ | ||
| 82 | 79 | } |
| 83 | 80 | } |
| 84 | 81 | |
| 85 | 82 | /** |
| 86 | - * Verify webhook signature using platform-specific logic. | |
| 87 | - * | |
| 88 | - * Pro plugin or third-party code may hook into the filter | |
| 89 | - * 'fluent_support/verify_webhook_signature_{platform}' to enable | |
| 90 | - * cryptographic signature verification. When no verifier is | |
| 91 | - * registered, fall back to the existing token-based validation | |
| 92 | - * handled by the downstream webhook handlers. | |
| 83 | + * Signature checks are opt-in via fluent_support/verify_webhook_signature_{platform}. | |
| 84 | + * With no verifier hooked, the handlers' token check is the only guard. | |
| 93 | 85 | * |
| 94 | 86 | * @param string $platform 'telegram' or 'slack' |
| 95 | 87 | * @param Request $request |
| 96 | 88 | * @return bool |