-
Notifications
You must be signed in to change notification settings - Fork 45
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: edge case where webhooks are not filtered correctly
- Loading branch information
1 parent
9964a3f
commit 39c39f5
Showing
8 changed files
with
147 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { KafkaEvent } from '../services/data/kafka/kafka.interface' | ||
import { Webhook } from './webhooks.interface' | ||
|
||
export function shouldProcessEvent(event: KafkaEvent, webhook: Webhook): boolean { | ||
const typeMatches = webhook.eventTypes.includes('*') || webhook.eventTypes.includes(event.type) | ||
if (!typeMatches) { | ||
return false | ||
} | ||
|
||
const nameMatches = webhook.eventNames.includes('*') || webhook.eventNames.includes(event.event) | ||
if (!nameMatches) { | ||
return false | ||
} | ||
|
||
return true | ||
} |
Oops, something went wrong.