From 16aa9ccf357614724fe7eaa9e3645eb9adc6a822 Mon Sep 17 00:00:00 2001 From: Stephane SEGNING LAMBOU Date: Tue, 1 Aug 2023 13:03:59 +0200 Subject: [PATCH] Added support for Keycloak v22 --- .github/workflows/releases.yml | 2 +- CHANGELOG.md | 5 ++--- Dev.Dockerfile | 4 ++-- Dockerfile | 4 ++-- build.gradle.kts | 19 +++++++++++++------ docker-compose.yaml | 4 ++-- openapi/webhook.open-api.yml | 2 +- .../WebhookEventListenerProviderFactory.kt | 2 +- 8 files changed, 24 insertions(+), 18 deletions(-) diff --git a/.github/workflows/releases.yml b/.github/workflows/releases.yml index a07aca6..bd2c34d 100644 --- a/.github/workflows/releases.yml +++ b/.github/workflows/releases.yml @@ -55,4 +55,4 @@ jobs: prerelease: false allowUpdates: true bodyFile: CHANGELOG.md - tag: v0.2.0 \ No newline at end of file + tag: v0.3.0 \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 5ccd5b1..9e837ef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,5 @@ # Changelog -## v0.2.0 +## v0.3.0 -- Added RabbitMQ client -- Use Gson as Serialization lib for http +- Upgraded to Keycloak 22.0.1 diff --git a/Dev.Dockerfile b/Dev.Dockerfile index 4360cc0..66a2d9b 100644 --- a/Dev.Dockerfile +++ b/Dev.Dockerfile @@ -1,8 +1,8 @@ -ARG TAG=21.0.2 +ARG TAG=22.0.1 FROM quay.io/keycloak/keycloak:${TAG} -ENV WEBHOOK_PLUGIN_VERSION 0.2.0 +ENV WEBHOOK_PLUGIN_VERSION 0.3.0 ENV KEYCLOAK_DIR /opt/keycloak ENV KC_PROXY edge diff --git a/Dockerfile b/Dockerfile index d7a8d5b..c9a443b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -ARG TAG=21.0.2 -ARG PLUGIN_VERSION=0.2.0 +ARG TAG=22.0.1 +ARG PLUGIN_VERSION=0.3.0 FROM curlimages/curl AS DOWNLOADER diff --git a/build.gradle.kts b/build.gradle.kts index 39f060e..ba719f9 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -1,18 +1,20 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar + plugins { - kotlin("jvm") version "1.8.0" + kotlin("jvm") version "1.9.0" id("org.openapi.generator") version "6.5.0" id("com.github.johnrengelman.shadow") version "8.1.1" id("groovy") } group = "com.vymalo.keycloak.webhook" -version = "0.2.0" +version = "0.3.0" val gsonVersion = "2.10.1" val amqpVersion = "5.17.0" val okhttp3Version = "4.10.0" +val okioVersion = "3.0.0" repositories { mavenCentral() @@ -23,9 +25,11 @@ dependencies { api("org.apache.commons", "commons-lang3", "3.12.0") - implementation("org.keycloak", "keycloak-services", "21.0.2") - implementation("org.keycloak", "keycloak-server-spi", "21.0.2") - implementation("org.keycloak", "keycloak-server-spi-private", "21.0.2") + implementation(kotlin("stdlib")) + + implementation("org.keycloak", "keycloak-services", "22.0.1") + implementation("org.keycloak", "keycloak-server-spi", "22.0.1") + implementation("org.keycloak", "keycloak-server-spi-private", "22.0.1") api("com.squareup.okhttp3", "okhttp", okhttp3Version) api("com.rabbitmq", "amqp-client", amqpVersion) @@ -84,9 +88,12 @@ tasks { val shadowJar by existing(ShadowJar::class) { dependencies { include(dependency("com.squareup.okhttp3:okhttp:$okhttp3Version")) - include(dependency("org.jetbrains.kotlin:kotlin-reflect:1.8.0")) + include(dependency("com.squareup.okio:okio-jvm:$okioVersion")) + include(dependency("org.jetbrains.kotlin:kotlin-stdlib:1.9.0")) + include(dependency("org.jetbrains.kotlin:kotlin-reflect:1.9.0")) include(dependency("com.rabbitmq:amqp-client:$amqpVersion")) include(dependency("com.google.code.gson:gson:$gsonVersion")) } + dependsOn(build) } } diff --git a/docker-compose.yaml b/docker-compose.yaml index 1c13704..0a6ac0f 100644 --- a/docker-compose.yaml +++ b/docker-compose.yaml @@ -6,7 +6,7 @@ services: context: . dockerfile: Dev.Dockerfile ports: - - '9200:9200' + - '9100:9100' environment: # WEBHOOK_EVENTS_TAKEN: "LOGIN,REGISTER,LOGOUT" @@ -46,7 +46,7 @@ services: - RABBITMQ_PASSWORD=password watcher: - image: ssegning/api-watcher + image: ssegning/api-watcher:latest ports: - "3000:3000" volumes: diff --git a/openapi/webhook.open-api.yml b/openapi/webhook.open-api.yml index cfc8fd0..06fc51f 100644 --- a/openapi/webhook.open-api.yml +++ b/openapi/webhook.open-api.yml @@ -9,7 +9,7 @@ info: email: dev@ssegning.com license: name: MIT - version: 0.2.0 + version: 0.3.0 externalDocs: description: Find out more about calling setting up an external service to verify phone number url: https://blog.ssegning.com diff --git a/src/main/kotlin/com/vymalo/keycloak/webhook/WebhookEventListenerProviderFactory.kt b/src/main/kotlin/com/vymalo/keycloak/webhook/WebhookEventListenerProviderFactory.kt index 4d66de7..6bb113e 100644 --- a/src/main/kotlin/com/vymalo/keycloak/webhook/WebhookEventListenerProviderFactory.kt +++ b/src/main/kotlin/com/vymalo/keycloak/webhook/WebhookEventListenerProviderFactory.kt @@ -103,6 +103,6 @@ class WebhookEventListenerProviderFactory : EventListenerProviderFactory, Server override fun getId(): String = PROVIDER_ID - override fun getOperationalInfo() = mapOf("version" to "0.2.0") + override fun getOperationalInfo() = mapOf("version" to "0.3.0") } \ No newline at end of file