Upgrade keycloak to version 18.0.0 #498
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Motivation: https://github.com/quarkusio/quarkus/wiki/Migration-Guide-2.10
Keycloak 18.0.0 changes (that impact Quarkus test framework):
KEYCLOAK_IMPORT
is not supported anymoreKEYCLOAK_USER
andKEYCLOAK_PASSWORD
was replaced byKEYCLOAK_ADMIN
andKEYCLOAK_ADMIN_PASSWORD
This PR is trying to integrate all of these required changes into QuarkusTestFramework.
PR Design decision
@Container
where the developers could set any keycloak version image. The proposal is to use a new annotation calledKeycloakContainer
where the default values are already setKeycloakContainer default values:
- image:
quay.io/keycloak/keycloak:18.0.0
- port:
8080
- expected started log:
started
-
io.quarkus.test.bootstrap.KeycloakService
has new constructors:Keycloak 18.0 requires that the imported realms are located into one specific folder:
/opt/keycloak/data/import
The new KeycloakService has two constructors:
public KeycloakService(String realmFile, String realm)
// by default realmDestPath is set to/opt/keycloak/data/import
public KeycloakService(String realm)
// could be useful if you want to setup a keycloak without realmNowadays if you want to attach some file to your container you should add a property with the following value:
The value "prefix",
resource::
will trigger a background command in order to create a configMap or to push the above file into the container. However, this "prefix" assume that the file destination path was the same as the original location. Unfortunately on Keycloak this is not valid, therealm.json
must be under the folder/opt/keycloak/data/import
in order to be imported at the start time. To accomplish this task, we have developed a new "prefix" action:resource_with_destination::<DEST_PATH> | <ORIGIN_PATH>
For example:
withProperty("KEYCLOAK_IMPORT", "resource_with_destination::/opt/keycloak/data/import | /keycloak-realm.json")
${ARGS}
) to defaultopenshift-deployment-template.yml
(required in order to launch keycloak 18.0.0)How to use it
Keycloak 18
Note: Previous versions of keycloak as Keycloak 16 or 14 could still use the old way
Please check the relevant options
Checklist: