Skip to content

Commit

Permalink
Add config to InvalidWebhookSignatureEvent
Browse files Browse the repository at this point in the history
  • Loading branch information
jansgescheit committed May 21, 2024
1 parent 81fde4e commit 7d8ecbf
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
2 changes: 2 additions & 0 deletions UPGRADING.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,5 @@ class AddColumnsToWebhookCalls extends Migration
- the `Spatie\WebhookClient\Events\InvalidSignature` event has been renamed to `Spatie\WebhookClient\Events\InvalidWebhookSignatureEvent`

- the `Spatie\WebhookClient\ProcessWebhookJob` job has been moved to `Spatie\WebhookClient\Jobs\ProcessWebhookJob`

- the `Spatie\WebhookClient\Events\InvalidWebhookSignatureEvent` event get the `Spatie\WebhookClient\WebhookConfig` as parameter
4 changes: 3 additions & 1 deletion src/Events/InvalidWebhookSignatureEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,13 @@
namespace Spatie\WebhookClient\Events;

use Illuminate\Http\Request;
use Spatie\WebhookClient\WebhookConfig;

class InvalidWebhookSignatureEvent
{
public function __construct(
public Request $request
public Request $request,
public WebhookConfig $config
) {
}
}
2 changes: 1 addition & 1 deletion src/WebhookProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function process(): Response
protected function ensureValidSignature(): self
{
if (! $this->config->signatureValidator->isValid($this->request, $this->config)) {
event(new InvalidWebhookSignatureEvent($this->request));
event(new InvalidWebhookSignatureEvent($this->request, $this->config));

throw InvalidWebhookSignature::make();
}
Expand Down

0 comments on commit 7d8ecbf

Please sign in to comment.