Skip to content

Commit

Permalink
fix: upgrade to keycloak 22.0.x version
Browse files Browse the repository at this point in the history
  • Loading branch information
dajay committed Aug 2, 2023
1 parent 235c6f8 commit 229550b
Show file tree
Hide file tree
Showing 8 changed files with 115 additions and 89 deletions.
33 changes: 0 additions & 33 deletions .github/workflows/ci.yml

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ jobs:
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 8
uses: actions/setup-java@v1
with:
java-version: 8
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17

- id: get_version
run: echo ::set-output name=VERSION::$(echo $GITHUB_REF | cut -d / -f 3)
Expand Down
43 changes: 43 additions & 0 deletions .github/workflows/create-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
name: CreateTag

on:
workflow_dispatch:

jobs:
build:
name: Build
runs-on: ubuntu-latest
outputs:
version: ${{ steps.get_version.outputs.VERSION }}
steps:
- uses: actions/checkout@v2

- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17

- name: Build with Maven
run: mvn -B clean verify

- name: Set Release version
run: |
mvn versions:set -DremoveSnapshot -DgenerateBackupPoms=false
- name: Get pom version
id: get_version
run: |
echo ::set-output name=VERSION::$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)
- uses: rickstaa/action-create-tag@v1
id: "tag_create"
with:
tag: ${{ steps.get_version.outputs.VERSION }}
33 changes: 33 additions & 0 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: Keycloak Verify email by code Red Froggy CI

on:
push:
branches:
- "master"
- "main"
tags-ignore:
- "**"
pull_request:

jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2

- name: Cache local Maven repository
uses: actions/cache@v2
with:
path: ~/.m2/repository
key: ${{ runner.os }}-maven-${{ hashFiles('**/pom.xml') }}
restore-keys: |
${{ runner.os }}-maven-
- name: Set up JDK 17
uses: actions/setup-java@v1
with:
java-version: 17

- name: Build with Maven
run: mvn -B clean test
5 changes: 3 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,18 +1,19 @@
version: '3.8'
services:
keycloak:
image: quay.io/keycloak/keycloak:21.0
image: quay.io/keycloak/keycloak:22.0
command: [ 'start-dev --import-realm',
'--debug',
'--spi-required-action-VERIFY_EMAIL_CODE-code-length=5' ]
volumes:
- ./realm-config/local:/opt/keycloak/data/import
- ./target/keycloak-verify-email-by-code-21.0.0-SNAPSHOT.jar:/opt/keycloak/providers/keycloak-verify-email-by-code.jar
- ./target/keycloak-verify-email-by-code-22.0.0-SNAPSHOT.jar:/opt/keycloak/providers/keycloak-verify-email-by-code.jar
environment:
- KC_DB=dev-file
- KEYCLOAK_ADMIN=admin
- KEYCLOAK_ADMIN_PASSWORD=admin
- DEBUG=true
- KC_LOG_LEVEL=debug
- KC_FEATURES=scripts
- KC_HTTP_PORT=9080
- KC_HTTPS_PORT=9443
Expand Down
69 changes: 26 additions & 43 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

<groupId>fr.redfroggy.keycloak</groupId>
<artifactId>keycloak-verify-email-by-code</artifactId>
<version>21.0.1-SNAPSHOT</version>
<version>22.0.0-SNAPSHOT</version>

<name>${project.groupId}:${project.artifactId}</name>
<description>Action to verify email by code for Keycloak</description>
Expand Down Expand Up @@ -41,55 +41,52 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>

<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.compiler.source>17</maven.compiler.source>
<maven.compiler.target>17</maven.compiler.target>

<maven.clean.plugin.version>3.1.0</maven.clean.plugin.version>
<maven.compiler.plugin.version>3.8.1</maven.compiler.plugin.version>
<maven.resources.plugin.version>3.1.0</maven.resources.plugin.version>
<maven.clean.plugin.version>3.2.0</maven.clean.plugin.version>
<maven.compiler.plugin.version>3.11.0</maven.compiler.plugin.version>
<maven.resources.plugin.version>3.3.1</maven.resources.plugin.version>
<maven.surefire.plugin.version>3.0.0-M4</maven.surefire.plugin.version>
<maven.jar.plugin.version>3.2.0</maven.jar.plugin.version>
<maven.install.plugin.version>3.0.0-M1</maven.install.plugin.version>
<maven.source.plugin.version>3.2.1</maven.source.plugin.version>
<maven.javadoc.plugin.version>3.1.1</maven.javadoc.plugin.version>
<wildfly.maven.plugin.version>2.0.2.Final</wildfly.maven.plugin.version>
<maven.jar.plugin.version>3.3.0</maven.jar.plugin.version>
<maven.install.plugin.version>3.1.1</maven.install.plugin.version>
<maven.source.plugin.version>3.3.0</maven.source.plugin.version>
<maven.javadoc.plugin.version>3.5.0</maven.javadoc.plugin.version>

<keycloak.version>22.0.1</keycloak.version>
<jboss-logging.version>3.5.3.Final</jboss-logging.version>

<keycloak.version>21.0.1</keycloak.version>
<junit-jupiter.version>5.9.1</junit-jupiter.version>
<mockito.version>4.8.0</mockito.version>
<assertj.version>3.23.1</assertj.version>
</properties>

<build>
<pluginManagement>
<pluginManagement> <!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
<plugins>
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>${maven.clean.plugin.version}</version>
</plugin>
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-resources-plugin</artifactId>
<version>${maven.resources.plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven.compiler.plugin.version}</version>
</plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.surefire.plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>${maven.jar.plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-install-plugin</artifactId>
<version>${maven.install.plugin.version}</version>
</plugin>
Expand All @@ -99,29 +96,12 @@
<version>${maven.source.plugin.version}</version>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>${maven.javadoc.plugin.version}</version>
</plugin>

<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<version>${wildfly.maven.plugin.version}</version>
</plugin>

</plugins>
</pluginManagement>

<plugins>
<plugin>
<groupId>org.wildfly.plugins</groupId>
<artifactId>wildfly-maven-plugin</artifactId>
<configuration>
<skip>false</skip>
</configuration>
</plugin>

<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
Expand Down Expand Up @@ -156,27 +136,30 @@
<version>${keycloak.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-services</artifactId>
<version>${keycloak.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-server-spi</artifactId>
<version>${keycloak.version}</version>
<scope>provided</scope>
</dependency>

<dependency>
<groupId>org.keycloak</groupId>
<artifactId>keycloak-server-spi-private</artifactId>
<version>${keycloak.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.jboss.logging</groupId>
<artifactId>jboss-logging</artifactId>
<version>${jboss-logging.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-engine</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@

package fr.redfroggy.keycloak.requiredactions;

import jakarta.ws.rs.core.MultivaluedMap;
import jakarta.ws.rs.core.Response;
import jakarta.ws.rs.core.UriBuilderException;
import org.jboss.logging.Logger;
import org.jboss.resteasy.spi.HttpRequest;
import org.keycloak.Config;
Expand All @@ -43,9 +46,6 @@
import org.keycloak.services.validation.Validation;
import org.keycloak.sessions.AuthenticationSessionModel;

import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;
import javax.ws.rs.core.UriBuilderException;
import java.util.HashMap;
import java.util.LinkedHashMap;
import java.util.Map;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package fr.redfroggy.keycloak.requiredactions;

import jakarta.ws.rs.core.MultivaluedHashMap;
import jakarta.ws.rs.core.MultivaluedMap;
import jakarta.ws.rs.core.Response;
import org.jboss.resteasy.spi.HttpRequest;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;
Expand All @@ -23,10 +26,6 @@
import org.mockito.Mock;
import org.mockito.junit.jupiter.MockitoExtension;

import javax.ws.rs.core.MultivaluedHashMap;
import javax.ws.rs.core.MultivaluedMap;
import javax.ws.rs.core.Response;

import static fr.redfroggy.keycloak.requiredactions.VerifyEmailByCode.*;
import static org.assertj.core.api.Assertions.assertThat;
import static org.mockito.Mockito.*;
Expand Down

0 comments on commit 229550b

Please sign in to comment.