feat(whatsapp): validar firma de Meta en el webhook y restaurar el menú del módulo

- POST /webhooks exige X-Hub-Signature-256 (HMAC-SHA256 del cuerpo crudo);
  falla cerrado si app_secret no está configurado
- nueva clave app_secret en whatsapp_system_config, editable desde Configuración Bot
- menú lateral de WhatsApp visible de nuevo (Correo/IMAP sigue en Chat/Bot)

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
Lizandro Guarnizo
2026-08-26 23:02:39 -05:00
co-authored by Claude Opus 5
parent 5e0c0367d9
commit e3ad0a423a
6 changed files with 133 additions and 3 deletions
@@ -0,0 +1,25 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;
return new class extends Migration
{
public function up(): void
{
DB::table('whatsapp_system_config')->updateOrInsert(
['config_key' => 'app_secret'],
[
'config_value' => '',
'description' => 'App Secret de Meta, firma los webhooks entrantes (X-Hub-Signature-256)',
'created_at' => now(),
'updated_at' => now(),
]
);
}
public function down(): void
{
DB::table('whatsapp_system_config')->where('config_key', 'app_secret')->delete();
}
};