From 7467d09874b96b662a8cbd915e8da85bb1fc3837 Mon Sep 17 00:00:00 2001 From: Kai Volland Date: Mon, 12 Aug 2024 17:22:40 +0200 Subject: [PATCH] fix: ignore events for realms other then SHOGun --- .../terrestris/shogun/lib/controller/WebhookController.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/shogun-lib/src/main/java/de/terrestris/shogun/lib/controller/WebhookController.java b/shogun-lib/src/main/java/de/terrestris/shogun/lib/controller/WebhookController.java index 9cda1a3c..b0111ff2 100644 --- a/shogun-lib/src/main/java/de/terrestris/shogun/lib/controller/WebhookController.java +++ b/shogun-lib/src/main/java/de/terrestris/shogun/lib/controller/WebhookController.java @@ -40,6 +40,11 @@ public class WebhookController { public void handleKeyCloakEvent(@RequestBody KeycloakEventDto event) { log.debug("Keycloak webhook called with event: {}", event); + if (!event.getRealmId().equalsIgnoreCase("shogun")){ + log.debug("Ignoring event for realm: {}", event.getRealmId()); + return; + } + String resourceType = event.getResourceType(); String eventType = event.getType();