-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Migrate Keycloak Admin Client from config classes to the @ConfigMapping
#39342
Migrate Keycloak Admin Client from config classes to the @ConfigMapping
#39342
Conversation
Status for workflow
|
This might be worth a note in the 3.9 migration guide: |
+1 but someone with write rights must do that
quick check - it's inside application, not an extension, right? I didn't think user applications has many reason to inject this. can you please give me a hint why it was useful? thank you |
E.g.: /**
* Access to keycloak user rest api client. Marked with {@link RestClientWrapper} to support interception.
*/
@ApplicationScoped
@RestClientWrapper
@RequiredArgsConstructor(access = AccessLevel.PROTECTED)
public class KeycloakUserApiClient {
private final KeycloakAdminClientConfig adminclientConfig;
private final Keycloak adminClient;
// ...
/**
* Create new user.
*
* @param userRepresentation user data
*/
public void create(final UserRepresentation userRepresentation) {
api().users().create(userRepresentation);
}
private RealmResource api() {
return adminClient.realm(adminclientConfig.realm());
}
} PS: |
Sure, I think that makes sense if you write API that is reused by applications that can set different realms. Thank you My opinion is that we should keep the change as it's for a good and migration is super easy (parentheses), but add it to migration guide. |
@sberyozkin please add a note to migration guide |
part of the #39185
Both extensions are not used by any Quarkiverse extension, I don't believe users have many reasons to actually inject the config directly and if so, you can see that migration is straightforward from the changes in this PR.
https://mvnrepository.com/artifact/io.quarkus/quarkus-keycloak-admin-client/usages
https://mvnrepository.com/artifact/io.quarkus/quarkus-keycloak-admin-client-reactive/usages