Skip to content

Commit

Permalink
Always exclude topicName from webhook POST/PUT body (#174)
Browse files Browse the repository at this point in the history
  • Loading branch information
nie7321 authored Mar 19, 2024
1 parent 9f910e5 commit 5917a94
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
## [v11.0.1] - 2024-03-19
### Fixes
- Fixed a bug when configuring EventHub webhooks using `php artisan eventhub:webhook:configure`.

## [v11.0.0] - 2024-03-18
### Changed
- Dropped support for PHP 8.1.
Expand All @@ -25,6 +29,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- A number of issues with incorrect types have been corrected.
- The `eventhub:queue:status` artisan command was broken on current versions of Laravel. This has been corrected.

## [v9.1.1] - 2024-02-19
This is a backport release to support apps still using PHP 8.1.

### Fixes
- Fixed a bug when configuring EventHub webhooks using `php artisan eventhub:webhook:configure`.

## [v9.1.0] - 2023-10-12

### Added
Expand Down
6 changes: 3 additions & 3 deletions src/Console/Commands/EventHub/WebhookConfiguration.php
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ protected function createOrUpdate($hook, $registered_hooks)
{
$topicName = $hook['topicName'];

// Not allowed in the POST/PUT body
unset($hook['topicName']);

try {
// If the hook exists on EventHub already, we don't need to touch the 'active' status.
// But, new ones will require it.
if (in_array($hook['topicName'], $registered_hooks) === false) {
// Not permitted in creates since Jan 2022 (but fine for updates)
unset($hook['topicName']);

$hook['active'] = true;

$this->webhook_api->create($topicName, $hook);
Expand Down

0 comments on commit 5917a94

Please sign in to comment.