Skip to content

Commit

Permalink
check for removed user in webhoook createdBy field (#58)
Browse files Browse the repository at this point in the history
  • Loading branch information
xgp authored Apr 22, 2024
1 parent a18a332 commit f2ab6f6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<main.java.package>io.phasetwo.keycloak.events</main.java.package>
<junit.version>5.8.2</junit.version>
<keycloak.version>24.0.0</keycloak.version>
<lombok.version>1.18.30</lombok.version>
<keycloak.version>24.0.3</keycloak.version>
<lombok.version>1.18.32</lombok.version>
<auto-service.version>1.1.1</auto-service.version>
<ossrh.url>https://s01.oss.sonatype.org</ossrh.url>
</properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import java.util.stream.Stream;
import lombok.extern.jbosslog.JBossLog;
import org.keycloak.models.KeycloakSession;
import org.keycloak.models.UserModel;
import org.keycloak.services.resources.admin.AdminRoot;

@JBossLog
Expand All @@ -43,7 +44,10 @@ private WebhookRepresentation toRepresentation(WebhookModel w) {
webhook.setId(w.getId());
webhook.setEnabled(w.isEnabled());
webhook.setUrl(w.getUrl());
webhook.setCreatedBy(w.getCreatedBy().getId());
UserModel u = w.getCreatedBy();
if (u != null) {
webhook.setCreatedBy(u.getId());
}
webhook.setCreatedAt(w.getCreatedAt());
webhook.setRealm(w.getRealm().getName());
webhook.setEventTypes(w.getEventTypes());
Expand Down

0 comments on commit f2ab6f6

Please sign in to comment.