Open
Conversation
Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
…ontainerRegistrar for improved configuration Signed-off-by: Jimisola Laursen <jimisola@jimisola.com>
…import and custom providers
|
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.


Description
NOTE: This PR brought me into somewhat uncharted territory with regards to the lifecycle (or rather startup sequence) of Spring Boot. So, the implementation seem to work but it is the right way? And if so, there is a little more to be done in terms of testing, injection properties etc.
Introduce the first implementation of Keycloak dev-services: a registrar-based startup that registers a
KeycloakContainerbean definition early, starts the container during bean-factory post-processing, publishes derived properties into theEnvironment, registers the running instance as a singleton with proper shutdown handling, and integrates with Spring Boot ServiceConnection.Key details
KeycloakContainerRegistrarto register theKeycloakContainerbean definition and to create/start the container duringpostProcessBeanFactory(...).KeycloakDevServicesAutoConfigurationto expose the registrar and a delegating@ServiceConnection("keycloak")bean so ServiceConnection andConnectionDetailsinfra can find the running container.Why
BeanFactoryand binding APIs are available.Left:
a) implementation works with application.yml files
b) @Serviceconnection works (it's circumvented with
context.getBeanFactory().getBeanNamesForType(KeycloakContainer.class))c) property injection works properly
See: Common Application Properties
a) Currently only,
spring.security.oauth2.resourceserver.jwt.issuer-uriis injected, but there are numerous Security Properties that can be set, especially uris for things such as logout, revocation, OAuth 2 etc.b) Spring Security client refers to a
providerbut we don't know the name of it. I think that we should allow for a default such as:spring.security.oauth2.client.provider.keycloak.issuer-uribut also allow the user to add additional clients that needs to have issuer-uri injected (so, that it's plug-n-play with the users current configuration).
Fixes #47
Checklist
./gradlew build).