Added maps for social config and smtp server to realm
This commit is contained in:
1 parent
36662fb5ca
commit
a88dcace3d
7 files changed
+117
-5
No files matched your search
@@ -2,6 +2,7 @@ package org.keycloak.models;
|
||||
|
||||
import java.security.PrivateKey;
|
||||
import java.security.PublicKey;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Set;
|
||||
@@ -136,4 +137,12 @@ public interface RealmModel extends RoleContainerModel, RoleMapperModel, ScopeMa
|
||||
OAuthClientModel getOAuthClient(String name);
|
||||
|
||||
List<OAuthClientModel> getOAuthClients();
|
||||
|
||||
HashMap<String, String> getSmtpConfig();
|
||||
|
||||
void setSmtpConfig(HashMap<String, String> smtpConfig);
|
||||
|
||||
HashMap<String, String> getSocialConfig();
|
||||
|
||||
void setSocialConfig(HashMap<String, String> socialConfig);
|
||||
}
|
||||
@@ -3,6 +3,7 @@ package org.keycloak.models.jpa.entities;
|
||||
|
||||
import javax.persistence.*;
|
||||
import java.util.Collection;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
||||
@@ -24,6 +25,10 @@ public class RealmEntity {
|
||||
@Column(length = 2048)
|
||||
protected String privateKeyPem;
|
||||
protected String[] defaultRoles;
|
||||
@Lob
|
||||
protected HashMap<String, String> smtpConfig;
|
||||
@Lob
|
||||
protected HashMap<String, String> socialConfig;
|
||||
|
||||
@OneToMany(cascade ={CascadeType.REMOVE}, orphanRemoval = true)
|
||||
Collection<RequiredCredentailEntity> requiredCredentials;
|
||||
|
||||
@@ -679,7 +679,7 @@ public class RealmAdapter implements RealmModel {
|
||||
@Override
|
||||
public void addScopeMapping(UserModel agent, RoleModel role) {
|
||||
ScopeRelationship scope = new ScopeRelationship();
|
||||
scope.setClient(((UserAdapter)agent).getUser());
|
||||
scope.setClient(((UserAdapter) agent).getUser());
|
||||
scope.setScope(((RoleAdapter)role).getRole());
|
||||
getRelationshipManager().add(scope);
|
||||
}
|
||||
@@ -873,4 +873,26 @@ public class RealmAdapter implements RealmModel {
|
||||
}
|
||||
return userModels;
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getSmtpConfig() {
|
||||
return realm.getSmtpConfig();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSmtpConfig(HashMap<String, String> smtpConfig) {
|
||||
realm.setSmtpConfig(smtpConfig);
|
||||
updateRealm();
|
||||
}
|
||||
|
||||
@Override
|
||||
public HashMap<String, String> getSocialConfig() {
|
||||
return realm.getSocialConfig();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setSocialConfig(HashMap<String, String> socialConfig) {
|
||||
realm.setSocialConfig(socialConfig);
|
||||
updateRealm();
|
||||
}
|
||||
}
|
||||
@@ -3,6 +3,9 @@ package org.keycloak.models.picketlink.mappings;
|
||||
import org.picketlink.idm.model.AbstractPartition;
|
||||
import org.picketlink.idm.model.annotation.AttributeProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
||||
* @version $Revision: 1 $
|
||||
@@ -23,6 +26,8 @@ public class RealmData extends AbstractPartition {
|
||||
private String publicKeyPem;
|
||||
private String privateKeyPem;
|
||||
private String[] defaultRoles;
|
||||
private HashMap<String, String> smtpConfig;
|
||||
private HashMap<String, String> socialConfig;
|
||||
|
||||
public RealmData() {
|
||||
super(null);
|
||||
@@ -163,4 +168,22 @@ public class RealmData extends AbstractPartition {
|
||||
public void setDefaultRoles(String[] defaultRoles) {
|
||||
this.defaultRoles = defaultRoles;
|
||||
}
|
||||
|
||||
@AttributeProperty
|
||||
public HashMap<String, String> getSmtpConfig() {
|
||||
return smtpConfig;
|
||||
}
|
||||
|
||||
public void setSmtpConfig(HashMap<String, String> smtpConfig) {
|
||||
this.smtpConfig = smtpConfig;
|
||||
}
|
||||
|
||||
@AttributeProperty
|
||||
public HashMap<String, String> getSocialConfig() {
|
||||
return socialConfig;
|
||||
}
|
||||
|
||||
public void setSocialConfig(HashMap<String, String> socialConfig) {
|
||||
this.socialConfig = socialConfig;
|
||||
}
|
||||
}
|
||||
+24
-4
@@ -5,11 +5,9 @@ import org.picketlink.idm.jpa.annotations.OwnerReference;
|
||||
import org.picketlink.idm.jpa.annotations.entity.IdentityManaged;
|
||||
import org.picketlink.idm.jpa.model.sample.simple.PartitionTypeEntity;
|
||||
|
||||
import javax.persistence.Column;
|
||||
import javax.persistence.Entity;
|
||||
import javax.persistence.Id;
|
||||
import javax.persistence.OneToOne;
|
||||
import javax.persistence.*;
|
||||
import java.io.Serializable;
|
||||
import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* @author <a href="mailto:bill@burkecentral.com">Bill Burke</a>
|
||||
@@ -56,6 +54,12 @@ public class RealmEntity implements Serializable {
|
||||
private String privateKeyPem;
|
||||
@AttributeValue
|
||||
private String[] defaultRoles;
|
||||
@AttributeValue
|
||||
@Lob
|
||||
private HashMap<String, String> smtpConfig;
|
||||
@AttributeValue
|
||||
@Lob
|
||||
private HashMap<String, String> socialConfig;
|
||||
|
||||
|
||||
public PartitionTypeEntity getPartitionTypeEntity() {
|
||||
@@ -177,4 +181,20 @@ public class RealmEntity implements Serializable {
|
||||
public void setPrivateKeyPem(String privateKeyPem) {
|
||||
this.privateKeyPem = privateKeyPem;
|
||||
}
|
||||
|
||||
public HashMap<String, String> getSmtpConfig() {
|
||||
return smtpConfig;
|
||||
}
|
||||
|
||||
public void setSmtpConfig(HashMap<String, String> smtpConfig) {
|
||||
this.smtpConfig = smtpConfig;
|
||||
}
|
||||
|
||||
public HashMap<String, String> getSocialConfig() {
|
||||
return socialConfig;
|
||||
}
|
||||
|
||||
public void setSocialConfig(HashMap<String, String> socialConfig) {
|
||||
this.socialConfig = socialConfig;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user