Parametrized datasource in Keycloak SPI#11500
Merged
Merged
Conversation
… multiple datasources support
This comment has been minimized.
This comment has been minimized.
|
📦 Pushed preview images as 🚢 See on GHCR. Use by referencing with full name as printed above, mind the registry name. |
GPortas
marked this pull request as ready for review
May 20, 2025 08:14
qqmyers
approved these changes
Jun 20, 2025
qqmyers
left a comment
Member
There was a problem hiding this comment.
I'm not sure any of us can do justice in a review. From what I know of Keycloak, this makes sense and, as noted, it is already working to support beta and qa. I noticed the build failed so I've restarted a run. I think if that passes and QA can briefly test it (create built in users on beta and QA via jsf/api and then verify that the user can login via the SPA (showing that keycloak is checking the two databases on the two different machines), it's good to go.
Contributor
|
looks good, thanks! Going to merge. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What this PR does / why we need it:
Adds an input parameter to the built-in Users SPI that allows specifying the datasource to be used. Currently, the supported options are:
user-store
user-store-qa
In the quarkus.properties file, it's not required to define both datasources—only the ones in use (e.g., if user-store-qa isn't needed, it can be omitted). However, both must be declared in the persistence.xml file to properly configure the JPA persistence units.
This change enables support for multiple databases from a single Keycloak server. In our setup, beta-keycloak.dataverse.org connects to both the QA and Beta databases.
When configuring the SPI within a Keycloak realm, the appropriate target datasource must be specified.
Which issue(s) this PR closes:
Special notes for your reviewer:
This is already installed and tested on beta-keycloak.dataverse.org
Suggestions on how to test this:
You can verify that beta-keycloak supports both the beta.dataverse.org and qa.dataverse.org environments equally.
Does this PR introduce a user interface change? If mockups are available, please link/include them here:
N/A
Is there a release notes update needed for this change?:
N/A
Additional documentation:
None