Skip to content

Commit

Permalink
Add Keycloak 24
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasvoelcker committed Mar 8, 2024
1 parent 054f5f3 commit b6ea99a
Show file tree
Hide file tree
Showing 12 changed files with 907 additions and 4,818 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
# Used in docker-compose
# shellcheck disable=SC2034
KEYCLOAK_VERSION=23.0.4
KEYCLOAK_VERSION=24.0.1
4 changes: 2 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ jobs:
env:
# we keep 18.0.2 for backwards compatibility with RH-SSO 7.6
- KEYCLOAK_VERSION: 18.0.2
- KEYCLOAK_VERSION: 20.0.5
- KEYCLOAK_VERSION: 21.1.1
- KEYCLOAK_VERSION: 22.0.4
- KEYCLOAK_VERSION: 23.0.4
- KEYCLOAK_VERSION: 23.0.7
- KEYCLOAK_VERSION: 24.0.1
steps:
- uses: actions/checkout@v4
with:
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
- Updated CI to use Keycloak 23.0.4
- Updated CI to use Keycloak 24.0.1
- Updated CI to use Keycloak 23.0.7
- Changed briefRepresentation from false to true (mistakenly considered full: [#25096](https://github.com/keycloak/keycloak/issues/25096))
- Removes compatibility of Versions 23.0.0, 23.0.1, 23.0.2 and 23.0.3
- Using getGroupByPath again after being fixed ([#25111](https://github.com/keycloak/keycloak/issues/25111))

## [5.10.0] - 2023-12-12
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ FROM ${BUILDER_IMAGE} AS BUILDER

WORKDIR /app/

ARG KEYCLOAK_VERSION=23.0.4
ARG KEYCLOAK_VERSION=24.0.1
ARG MAVEN_CLI_OPTS="-ntp -B"

COPY .mvn .mvn
Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>

<keycloak.version>23.0.4</keycloak.version>
<keycloak.version>24.0.1</keycloak.version>

<checkstyle-plugin.version>3.2.0</checkstyle-plugin.version>
<checkstyle.version>10.0</checkstyle.version>
Expand All @@ -74,7 +74,7 @@
<junit5-system-exit.version>1.1.2</junit5-system-exit.version>
<keepachangelog.version>2.1.1</keepachangelog.version>
<license-plugin.version>2.0.0</license-plugin.version>
<logstash-logback-encoder.version>7.4</logstash-logback-encoder.version>
<logstash-logback-encoder.version>7.3</logstash-logback-encoder.version>
<maven-failsafe-plugin.version>3.0.0-M5</maven-failsafe-plugin.version>
<maven-release-plugin.version>3.0.1</maven-release-plugin.version>
<maven-replacer.version>1.5.3</maven-replacer.version>
Expand Down
10 changes: 9 additions & 1 deletion src/test/java/de/adorsys/keycloak/config/AbstractImportIT.java
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,15 @@ abstract public class AbstractImportIT extends AbstractImportTest {
KEYCLOAK_CONTAINER.setCommand("start-dev");
command.add("start-dev");
command.add("--features");
command.add("admin-fine-grained-authz,declarative-user-profile,client-policies,client-secret-rotation");

StringBuilder featuresBuilder =
new StringBuilder("admin-fine-grained-authz,client-policies,client-secret-rotation");

if (VersionUtil.lt(KEYCLOAK_VERSION, "24")) {
featuresBuilder.append(",declarative-user-profile");
}

command.add(featuresBuilder.toString());
}

if (System.getProperties().getOrDefault("skipContainerStart", "false").equals("false")) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1752,23 +1752,23 @@ private List<GroupRepresentation> getSubGroups(GroupRepresentation groupRepresen
}

private void assertThatGroupAttributesAreEmpty(Map<String, List<String>> attributes) {
if (VersionUtil.lt(KEYCLOAK_VERSION, "23")) {
if (VersionUtil.lt(KEYCLOAK_VERSION, "23") || VersionUtil.ge(KEYCLOAK_VERSION, "23.0.5")) {
assertThat("attributes is null", attributes, aMapWithSize(0));
} else {
assertThat("attributes is null", attributes, is(nullValue()));
}
}

private void assertThatGroupRealmRolesAreEmpty(List<String> realmRoles) {
if (VersionUtil.lt(KEYCLOAK_VERSION, "23")) {
if (VersionUtil.lt(KEYCLOAK_VERSION, "23") || VersionUtil.ge(KEYCLOAK_VERSION, "23.0.5")) {
assertThat("realm roles is null", realmRoles, hasSize(0));
} else {
assertThat("realm roles is null", realmRoles, is(nullValue()));
}
}

private void assertThatGroupClientRolesAreEmpty(Map<String, List<String>> clientRoles) {
if (VersionUtil.lt(KEYCLOAK_VERSION, "23")) {
if (VersionUtil.lt(KEYCLOAK_VERSION, "23") || VersionUtil.ge(KEYCLOAK_VERSION, "23.0.5")) {
assertThat("client roles not null", clientRoles, aMapWithSize(0));
} else {
assertThat("client roles not null", clientRoles, is(nullValue()));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import de.adorsys.keycloak.config.exception.ImportProcessingException;
import de.adorsys.keycloak.config.exception.InvalidImportException;
import de.adorsys.keycloak.config.exception.KeycloakRepositoryException;
import de.adorsys.keycloak.config.util.VersionUtil;
import org.junit.jupiter.api.Order;
import org.junit.jupiter.api.Test;
import org.keycloak.representations.idm.RealmRepresentation;
Expand Down Expand Up @@ -169,7 +170,12 @@ void shouldUpdateWebAuthnSettings() throws IOException {

assertThat(realm.getRealm(), is("simple"));
assertThat(realm.isEnabled(), is(true));
assertThat(realm.getWebAuthnPolicyPasswordlessUserVerificationRequirement(), is("required"));

// TODO: "webAuthnPolicyPasswordlessUserVerificationRequirement" is not set with Keycloak 24
// https://github.com/keycloak/keycloak/issues/27700
if (VersionUtil.lt(KEYCLOAK_VERSION,"24")) {
assertThat(realm.getWebAuthnPolicyPasswordlessUserVerificationRequirement(), is("required"));
}
}

@Test
Expand Down
Loading

0 comments on commit b6ea99a

Please sign in to comment.