Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Adds support for Keycloak 26.1 #1256

Merged
merged 1 commit into from
Jan 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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=26.0.5
KEYCLOAK_VERSION=26.1.0
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,8 @@ jobs:
KEYCLOAK_CLIENT_VERSION: 25.0.1
- KEYCLOAK_VERSION: 26.0.5
KEYCLOAK_CLIENT_VERSION: 26.0.2
- KEYCLOAK_VERSION: 26.1.0
KEYCLOAK_CLIENT_VERSION: 26.0.4
steps:
- uses: actions/[email protected]
with:
Expand Down
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

### Added
- Publish charts with github pages [#941](https://github.com/adorsys/keycloak-config-cli/issues/941)
- Support for Keycloak 26.1

### Fixed
- Fix Initial Credentials Causes Update [819](https://github.com/adorsys/keycloak-config-cli/issues/819)
Expand Down
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
ARG BUILDER_IMAGE=eclipse-temurin:21-jdk
ARG RUNTIME_IMAGE=eclipse-temurin:21-jre

FROM ${BUILDER_IMAGE} AS BUILDER

Check warning on line 5 in Dockerfile

View workflow job for this annotation

GitHub Actions / build (18.0.2, 18.0.2)

Stage names should be lowercase

StageNameCasing: Stage name 'BUILDER' should be lowercase More info: https://docs.docker.com/go/dockerfile/rule/stage-name-casing/

Check warning on line 5 in Dockerfile

View workflow job for this annotation

GitHub Actions / build (22.0.4, 22.0.4)

Stage names should be lowercase

StageNameCasing: Stage name 'BUILDER' should be lowercase More info: https://docs.docker.com/go/dockerfile/rule/stage-name-casing/

Check warning on line 5 in Dockerfile

View workflow job for this annotation

GitHub Actions / build (25.0.1, 25.0.1)

Stage names should be lowercase

StageNameCasing: Stage name 'BUILDER' should be lowercase More info: https://docs.docker.com/go/dockerfile/rule/stage-name-casing/

Check warning on line 5 in Dockerfile

View workflow job for this annotation

GitHub Actions / build (23.0.7, 23.0.7)

Stage names should be lowercase

StageNameCasing: Stage name 'BUILDER' should be lowercase More info: https://docs.docker.com/go/dockerfile/rule/stage-name-casing/

Check warning on line 5 in Dockerfile

View workflow job for this annotation

GitHub Actions / build (24.0.5, 24.0.5)

Stage names should be lowercase

StageNameCasing: Stage name 'BUILDER' should be lowercase More info: https://docs.docker.com/go/dockerfile/rule/stage-name-casing/

Check warning on line 5 in Dockerfile

View workflow job for this annotation

GitHub Actions / build (26.1.0, 26.0.4)

Stage names should be lowercase

StageNameCasing: Stage name 'BUILDER' should be lowercase More info: https://docs.docker.com/go/dockerfile/rule/stage-name-casing/

Check warning on line 5 in Dockerfile

View workflow job for this annotation

GitHub Actions / build (21.1.2, 21.1.2)

Stage names should be lowercase

StageNameCasing: Stage name 'BUILDER' should be lowercase More info: https://docs.docker.com/go/dockerfile/rule/stage-name-casing/

Check warning on line 5 in Dockerfile

View workflow job for this annotation

GitHub Actions / build (26.0.5, 26.0.2)

Stage names should be lowercase

StageNameCasing: Stage name 'BUILDER' should be lowercase More info: https://docs.docker.com/go/dockerfile/rule/stage-name-casing/

WORKDIR /app/

ARG KEYCLOAK_VERSION=26.0.5
ARG KEYCLOAK_CLIENT_VERSION=26.0.2
ARG KEYCLOAK_VERSION=26.1.0
ARG KEYCLOAK_CLIENT_VERSION=26.0.4
ARG MAVEN_CLI_OPTS="-ntp -B"

COPY .mvn .mvn
Expand All @@ -29,7 +29,7 @@
ENV JAVA_OPTS="" KEYCLOAK_SSL_VERIFY=true IMPORT_FILES_LOCATIONS=file:/config/*

# $0 represents the first CLI arg which is not inside $@
ENTRYPOINT exec java $JAVA_OPTS -jar /app/keycloak-config-cli.jar $0 $@

Check warning on line 32 in Dockerfile

View workflow job for this annotation

GitHub Actions / build (18.0.2, 18.0.2)

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for ENTRYPOINT to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/

Check warning on line 32 in Dockerfile

View workflow job for this annotation

GitHub Actions / build (22.0.4, 22.0.4)

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for ENTRYPOINT to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/

Check warning on line 32 in Dockerfile

View workflow job for this annotation

GitHub Actions / build (25.0.1, 25.0.1)

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for ENTRYPOINT to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/

Check warning on line 32 in Dockerfile

View workflow job for this annotation

GitHub Actions / build (23.0.7, 23.0.7)

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for ENTRYPOINT to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/

Check warning on line 32 in Dockerfile

View workflow job for this annotation

GitHub Actions / build (24.0.5, 24.0.5)

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for ENTRYPOINT to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/

Check warning on line 32 in Dockerfile

View workflow job for this annotation

GitHub Actions / build (26.1.0, 26.0.4)

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for ENTRYPOINT to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/

Check warning on line 32 in Dockerfile

View workflow job for this annotation

GitHub Actions / build (21.1.2, 21.1.2)

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for ENTRYPOINT to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/

Check warning on line 32 in Dockerfile

View workflow job for this annotation

GitHub Actions / build (26.0.5, 26.0.2)

JSON arguments recommended for ENTRYPOINT/CMD to prevent unintended behavior related to OS signals

JSONArgsRecommended: JSON arguments recommended for ENTRYPOINT to prevent unintended behavior related to OS signals More info: https://docs.docker.com/go/dockerfile/rule/json-args-recommended/

COPY --from=BUILDER /app/target/keycloak-config-cli.jar /app/keycloak-config-cli.jar

Expand Down
4 changes: 2 additions & 2 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1043,8 +1043,8 @@ import org.keycloak.representations.userprofile.config.UPConfig;</token>
</property>
</activation>
<properties>
<keycloak.version>26.0.5</keycloak.version>
<keycloak.client.version>26.0.2</keycloak.client.version>
<keycloak.version>26.1.0</keycloak.version>
<keycloak.client.version>26.0.4</keycloak.client.version>
</properties>
</profile>
<!-- Configure the JBoss GA Maven repository -->
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -761,11 +761,15 @@ void shouldUpdateMultipleExecutionsWithSameAuthenticator() throws IOException {

List<AuthenticatorConfigRepresentation> authConfig;
authConfig = getAuthenticatorConfig(realm, "id1");
assertThat(authConfig, hasSize(2));
int expectedAuthConfigSize = VersionUtil.lt(KEYCLOAK_VERSION, "26.1")? 2 : 1;

assertThat(authConfig, hasSize(expectedAuthConfigSize));
assertThat(authConfig.get(0).getAlias(), is("id1"));
assertThat(authConfig.get(0).getConfig(), hasEntry(is("defaultProvider"), is("id1")));
assertThat(authConfig.get(1).getAlias(), is("id1"));
assertThat(authConfig.get(1).getConfig(), hasEntry(is("defaultProvider"), is("id1")));
if (VersionUtil.lt(KEYCLOAK_VERSION, "26.1")) {
assertThat(authConfig.get(1).getAlias(), is("id1"));
assertThat(authConfig.get(1).getConfig(), hasEntry(is("defaultProvider"), is("id1")));
}

authConfig = getAuthenticatorConfig(realm, "id2");
assertThat(authConfig, hasSize(1));
Expand All @@ -792,11 +796,15 @@ void shouldUpdateMultipleExecutionsWithSameAuthenticatorWithConfig() throws IOEx

List<AuthenticatorConfigRepresentation> authConfig;
authConfig = getAuthenticatorConfig(realm, "id1");
assertThat(authConfig, hasSize(2));
int expectedAuthConfigSize = VersionUtil.lt(KEYCLOAK_VERSION, "26.1")? 2 : 1;

assertThat(authConfig, hasSize(expectedAuthConfigSize));
assertThat(authConfig.get(0).getAlias(), is("id1"));
assertThat(authConfig.get(0).getConfig(), hasEntry(is("defaultProvider"), is("id2")));
assertThat(authConfig.get(1).getAlias(), is("id1"));
assertThat(authConfig.get(1).getConfig(), hasEntry(is("defaultProvider"), is("id2")));
if (VersionUtil.lt(KEYCLOAK_VERSION, "26.1")) {
assertThat(authConfig.get(1).getAlias(), is("id1"));
assertThat(authConfig.get(1).getConfig(), hasEntry(is("defaultProvider"), is("id2")));
}

authConfig = getAuthenticatorConfig(realm, "id2");
assertThat(authConfig, hasSize(1));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2003,9 +2003,13 @@ void shouldRemoveAuthzPoliciesForRealmManagement() throws IOException {
assertThat(client.getAuthenticationFlowBindingOverrides(), anEmptyMap());
assertThat(client.isFullScopeAllowed(), is(false));
assertThat(client.getNodeReRegistrationTimeout(), is(0));
assertThat(client.getDefaultClientScopes(), containsInAnyOrder("web-origins", "profile", "roles", "email"));
assertThat(client.getOptionalClientScopes(), containsInAnyOrder("address", "phone", "offline_access", "microprofile-jwt"));

if (VersionUtil.lt(KEYCLOAK_VERSION, "26.1")) {
assertThat(client.getDefaultClientScopes(), containsInAnyOrder("web-origins", "profile", "roles", "email"));
} else {
assertThat(client.getDefaultClientScopes(), containsInAnyOrder("web-origins", "profile", "roles", "email", "service_account"));
}
if (VersionUtil.lt(KEYCLOAK_VERSION, "26")) {
assertThat(client.getAttributes(), hasKey("client.secret.creation.time"));
} else {
Expand Down
Loading
Loading