Skip to content

Commit

Permalink
Use UPConfig for user-profile representation
Browse files Browse the repository at this point in the history
Signed-off-by: Thomas Darimont <thomas.darimont@googlemail.com>
  • Loading branch information
thomasdarimont committed Jun 21, 2024
1 parent 391f091 commit 46ca616
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
import com.fasterxml.jackson.annotation.JsonSetter;
import org.keycloak.representations.idm.AuthenticationFlowRepresentation;
import org.keycloak.representations.idm.RealmRepresentation;
import org.keycloak.representations.userprofile.config.UPConfig;
import org.springframework.stereotype.Component;

import java.util.ArrayList;
Expand All @@ -34,7 +35,7 @@
public class RealmImport extends RealmRepresentation {
private List<AuthenticationFlowImport> authenticationFlowImports;

private Map<String, List<Map<String, Object>>> userProfile;
private UPConfig userProfile;

private Map<String, Map<String, String>> messageBundles;

Expand All @@ -56,7 +57,7 @@ public void setAuthenticationFlowImports(List<AuthenticationFlowImport> authenti

@SuppressWarnings("unused")
@JsonSetter("userProfile")
public void setUserProfile(Map<String, List<Map<String, Object>>> userProfile) {
public void setUserProfile(UPConfig userProfile) {
this.userProfile = userProfile;
}

Expand All @@ -70,7 +71,7 @@ public void setMessageBundles(Map<String, Map<String, String>> messageBundles) {
this.messageBundles = messageBundles;
}

public Map<String, List<Map<String, Object>>> getUserProfile() {
public UPConfig getUserProfile() {
return userProfile;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public void doImport(RealmImport realmImport) {

private String buildUserProfileConfigurationString(RealmImport realmImport) {
var userProfile = realmImport.getUserProfile();
if (userProfile == null || userProfile.isEmpty()) {
if (userProfile == null) {
return null;
}
return JsonUtil.toJson(userProfile);
Expand Down

0 comments on commit 46ca616

Please sign in to comment.