symfony/vonage-notifier
Symfony Notifier bridge for Vonage. Send SMS notifications via Vonage using a simple DSN (vonage://KEY:SECRET@default?from=FROM). Configure your key, secret, and sender ID, then use Symfony’s notification system to deliver messages.
hash_equals() update for webhook signatures (v8.1.0-BETA2) mitigates timing attacks in signature validation, critical for webhook endpoints handling Vonage callbacks (e.g., delivery receipts). This is a non-negotiable update for production systems using webhooks.vonage/laravel-notification-channel (if email is the primary channel) or the standalone Vonage SDK (for custom logic). For non-Symfony PHP, the SDK is a fallback, but lacks Symfony’s integration benefits.Symfony\Component\Notifier\NotifierInterface or Messenger.vonage://KEY:SECRET@default?from=FROM) simplifies credential management.hash_equals() for signature validation in all webhook endpoints (see Technical Evaluation for code example).VonageChannel for Laravel Notifications, but webhook validation must be manually implemented if using Vonage callbacks.vonage/client directly for low-level control, but lose Symfony’s abstraction benefits.vonage/client with manual HTTP clients (e.g., Guzzle), but webhook security must be self-implemented.| Risk Area | Severity | Mitigation Strategy | Update Due to v8.1.0-BETA2 |
|---|---|---|---|
| Symfony Version Lock | Medium | Test with Symfony 6.4+; verify BC breaks (e.g., PHP 8.4+ requirement in v8.0.0-BETA1). | PHP 8.4+ required for v8.0.0+. |
| Laravel Non-Native Use | High | Abstract Vonage logic into a service layer to decouple from Symfony dependencies. | Unchanged |
| Webhook Security | Critical | All webhook endpoints must adopt hash_equals() for signature validation. Failure exposes systems to spoofing. |
NEW |
| Rate Limiting | Medium | Implement exponential backoff in retry logic (Symfony Messenger or Laravel Queues). | Unchanged |
| Cost Overruns | Medium | Monitor usage via Vonage dashboard or log all notifications for auditing. | Unchanged |
| Deprecation Risk | Low | MIT license; monitor Vonage API deprecations. | Unchanged |
| Multi-Channel Complexity | Medium | Validate Vonage’s API limits for concurrent SMS/voice/email sends. | Unchanged |
hash_equals() for signature validation. This is non-negotiable for security.| Component | Fit Level | Notes | Update Due to v8.1.0-BETA2 |
|---|---|---|---|
| Symfony Apps | Native | Designed for Symfony Notifier/Messenger; minimal boilerplate. Webhook validation is mandatory for security. | Critical: Webhook update required. |
| Laravel Apps | Medium | Requires a custom notification channel or service wrapper. Webhook validation must be manually implemented if using Vonage callbacks. | Critical: Webhook update required. |
| PHP Standalone | High | Vonage’s SDK is included; works anywhere PHP runs. Webhook security must be self-implemented if using callbacks. | Critical: Webhook update required. |
| Queues | High | Symfony Messenger or Laravel Queues for async processing. | Unchanged |
| APIs | High | RESTful; no additional infrastructure needed. | Unchanged |
| Databases | Low | No schema changes; optional for logging failed notifications. | Unchanged |
| Webhooks | Critical | All webhook endpoints must use hash_equals() for signature validation. This applies to Symfony, Laravel, and standalone PHP apps using Vonage callbacks. |
NEW |
composer require symfony/vonage-notifier:^8.1
hash_equals():
use Symfony\Component\Notifier\Bridge\Vonage\Webhook\VonageWebhookValidator;
$validator = new VonageWebhookValidator($secret);
if ($validator->isValidSignature($request->getContent(), $request->headers->get('X-Vonage-Signature'))) {
// Process webhook
}
use Symfony\Component\Notifier\Message\SmsMessage;
use Symfony\Component\Notifier\NotifierInterface;
$notifier = new NotifierInterface([new VonageTransport($dsn)]);
$notifier->send(new SmsMessage('Hello', '1234567890'));
VonageChannel and implement hash_equals() for webhooks:
use Vonage\Client\Sms\Message;
use Vonage\Client\Webhook\Validator;
class VonageChannel extends Channel
{
public function send($notifiable, Notification $notification)
{
// Send SMS/voice via Vonage SDK
}
public function validateWebhook(Request $request)
{
$validator = new Validator($secret);
return $validator->isValidSignature($request->getContent(), $request->header('X-Vonage-Signature'));
}
}
vonage/client directly and implement webhook validation manually.vonage/client and implement webhook validation:
use Vonage\Client\Webhook\Validator;
$validator
How can I help you explore Laravel packages today?