Author: bdaw
Date: 2006-11-23 16:53:43 -0500 (Thu, 23 Nov 2006)
New Revision: 5718
Added:
trunk/identity/src/resources/test/
trunk/identity/src/resources/test/config/
trunk/identity/src/resources/test/config/minimal-db-identity-config.xml
trunk/identity/src/resources/test/config/minimal-ldap-identity-config.xml
trunk/identity/src/resources/test/config/standardidentity-config.xml
trunk/test/src/etc/identityconfig/standardidentity-config.xml
Removed:
trunk/identity/src/main/org/jboss/portal/test/identity/ConfigurationTestCase.java
trunk/test/src/etc/identityconfig/test-config.xml
Modified:
trunk/identity/build.xml
trunk/identity/src/main/org/jboss/portal/identity2/IdentityContext.java
trunk/identity/src/main/org/jboss/portal/identity2/IdentityContextImpl.java
trunk/identity/src/main/org/jboss/portal/identity2/IdentityServiceControllerImpl.java
trunk/identity/src/main/org/jboss/portal/identity2/config/metadata/ModulesMetaData.java
trunk/identity/src/main/org/jboss/portal/identity2/ldap/LDAPConnectionContext.java
trunk/identity/src/main/org/jboss/portal/identity2/service/IdentityConfigurationService.java
trunk/identity/src/main/org/jboss/portal/identity2/service/IdentityModuleService.java
trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleRoleModuleTestCase.java
trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleUserModuleTestCase.java
trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticGroupMembershipModuleTestCase.java
trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticRoleMembershipModuleTestCase.java
trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPTestCase.java
trunk/test/src/etc/identityconfig/opends-config.xml
trunk/test/src/etc/identityconfig/rhds-config.xml
Log:
- IdentityServiceController that loads all identity modules from
- identity testsuite run using new configuration
Modified: trunk/identity/build.xml
===================================================================
--- trunk/identity/build.xml 2006-11-22 23:48:17 UTC (rev 5717)
+++ trunk/identity/build.xml 2006-11-23 21:53:43 UTC (rev 5718)
@@ -385,7 +385,7 @@
<x-test>
- <!--<test todir="${test.reports}"
name="org.jboss.portal.test.identity.ConfigurationTestCase"/>-->
+ <!--<test todir="${test.reports}"
name="org.jboss.portal.test.identity.ConfigurationTestCasestCase"/>-->
<test todir="${test.reports}"
name="org.jboss.portal.test.identity.ldap.LDAPSimpleUserModuleTestCase"/>
<test todir="${test.reports}"
name="org.jboss.portal.test.identity.ldap.LDAPSimpleRoleModuleTestCase"/>
<test todir="${test.reports}"
name="org.jboss.portal.test.identity.ldap.LDAPStaticGroupMembershipModuleTestCase"/>
@@ -397,6 +397,7 @@
<pathelement
location="${build.lib}/portal-identity-lib.jar"/>
<pathelement
location="${build.lib}/portal-identity-test-lib.jar"/>
<pathelement location="${jboss.portal-test.root}/etc"/>
+ <pathelement
location="${jboss.portal-identity.root}/resources/test"/>
<pathelement location="${build.resources}/hibernate"/>
@@ -455,6 +456,7 @@
<pathelement
location="${build.lib}/portal-identity-lib.jar"/>
<pathelement
location="${build.lib}/portal-identity-test-lib.jar"/>
<pathelement location="${jboss.portal-test.root}/etc"/>
+ <pathelement
location="${jboss.portal-identity.root}/resources/test"/>
<pathelement location="${build.resources}/hibernate"/>
Modified: trunk/identity/src/main/org/jboss/portal/identity2/IdentityContext.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity2/IdentityContext.java 2006-11-22
23:48:17 UTC (rev 5717)
+++ trunk/identity/src/main/org/jboss/portal/identity2/IdentityContext.java 2006-11-23
21:53:43 UTC (rev 5718)
@@ -29,19 +29,21 @@
*/
public interface IdentityContext
{
- public static final String TYPE_USER_MODULE = "user_module";
- public static final String TYPE_ROLE_MODULE = "role_module";
+ //TODO: move to safe type enum
+ public static final String TYPE_USER_MODULE = "UserModule";
- public static final String TYPE_MEMBERSHIP_MODULE = "membership_module";
+ public static final String TYPE_ROLE_MODULE = "RoleModule";
- public static final String TYPE_USER_PROFILE_MODULE =
"user_profile_module";
+ public static final String TYPE_MEMBERSHIP_MODULE = "MembershipModule";
- public static final String TYPE_CONNECTION_CONTEXT = "connection_context";
+ public static final String TYPE_USER_PROFILE_MODULE = "UserProfileModule";
- public static final String TYPE_IDENTITY_CONFIGURATION = "configuration";
+ public static final String TYPE_CONNECTION_CONTEXT = "ConnectionContext";
+ public static final String TYPE_IDENTITY_CONFIGURATION =
"IdentityConfiguration";
+
public void register(Object object, String name) throws IdentityException;
public void unregister(String name);
Modified: trunk/identity/src/main/org/jboss/portal/identity2/IdentityContextImpl.java
===================================================================
--- trunk/identity/src/main/org/jboss/portal/identity2/IdentityContextImpl.java 2006-11-22
23:48:17 UTC (rev 5717)
+++ trunk/identity/src/main/org/jboss/portal/identity2/IdentityContextImpl.java 2006-11-23
21:53:43 UTC (rev 5718)
@@ -71,7 +71,7 @@
}
synchronized(this)
{
- if(!registry.containsKey(name))
+ if(registry.containsKey(name))
{
registry.remove(name);
}
Modified:
trunk/identity/src/main/org/jboss/portal/identity2/IdentityServiceControllerImpl.java
===================================================================
---
trunk/identity/src/main/org/jboss/portal/identity2/IdentityServiceControllerImpl.java 2006-11-22
23:48:17 UTC (rev 5717)
+++
trunk/identity/src/main/org/jboss/portal/identity2/IdentityServiceControllerImpl.java 2006-11-23
21:53:43 UTC (rev 5718)
@@ -24,12 +24,15 @@
import org.jboss.portal.jems.as.system.AbstractJBossService;
import org.jboss.portal.common.util.JNDI;
import org.jboss.portal.identity.IdentityException;
-import org.jboss.portal.identity2.config.SimpleIdentityConfigurationFactory;
import org.jboss.portal.identity2.config.IdentityConfigurationMetaDataFactory;
import org.jboss.portal.identity2.config.metadata.IdentityConfigurationMetaData;
import org.jboss.portal.identity2.config.metadata.ModuleMetaData;
import org.jboss.portal.identity2.config.metadata.ModuleConfigOptionMetaData;
+import org.jboss.portal.identity2.config.metadata.OptionsMetaData;
+import org.jboss.portal.identity2.config.metadata.OptionsGroupMetaData;
+import org.jboss.portal.identity2.config.metadata.OptionsGroupOptionMetaData;
import org.jboss.portal.identity2.service.IdentityModuleService;
+import org.jboss.portal.identity2.service.IdentityConfigurationService;
import org.jboss.xb.binding.Unmarshaller;
import org.jboss.xb.binding.UnmarshallerFactory;
import org.jboss.xb.binding.ObjectModelFactory;
@@ -40,6 +43,9 @@
import java.util.Map;
import java.util.Iterator;
import java.util.HashMap;
+import java.util.List;
+import java.util.HashSet;
+import java.util.Set;
/**
* @author <a href="mailto:boleslaw dot dawidowicz at jboss.org">Boleslaw
Dawidowicz</a>
@@ -71,6 +77,8 @@
ClassLoader tcl = Thread.currentThread().getContextClassLoader();
+ //TODO: make a dtd for config files.
+
//parse config files
IdentityConfigurationMetaData meta = parseConfiguration(configFile);
IdentityConfigurationMetaData defaultMeta = parseConfiguration(defaultConfigFile);
@@ -81,17 +89,103 @@
//TODO:update meta options using defaultMeta options
+ //create detault modules set
+
+ //Map[implementation] --> Map[Type] --> ModuleMetaData
+ Map defaultImplementations = new HashMap();
+
+
try
{
- Map modules = meta.getModules().getModules();
+ List defaultModules = defaultMeta.getModules().getModules();
+ for (Iterator iterator = defaultModules.iterator(); iterator.hasNext();)
+ {
+ ModuleMetaData module = (ModuleMetaData)iterator.next();
- for (Iterator iterator = modules.keySet().iterator(); iterator.hasNext();)
+ //check if defaults contains all information
+ if (module.getType() == null ||
+ module.getImplementation() == null ||
+ module.getJndiName() == null ||
+ module.getServiceName() == null ||
+ module.getConfig() == null)
+ {
+ throw new IdentityException("Default module configuration must be
complete");
+ }
+
+ //store them as maps for different implementations
+ String implType = module.getImplementation();
+ Map implementation;
+ if (defaultImplementations.containsKey(implType))
+ {
+ implementation = (Map)defaultImplementations.get(implType);
+ }
+ else
+ {
+ implementation = new HashMap();
+ }
+
+ implementation.put(module.getType(), module);
+ defaultImplementations.put(implType, implementation);
+ }
+ }
+ catch (Exception e)
+ {
+ throw new IdentityException("Error during processing default configuration
file", e);
+ }
+
+
+ //process the list of modules, instantiate them, configure them, tide them
+ try
+ {
+ List modules = meta.getModules().getModules();
+
+ //TODO: update configuration options from defaultMeta
+ //OptionsMetaData options = meta.getOptions();
+
+ //inject configuration service
+ IdentityConfigurationService configuration = new
IdentityConfigurationService(meta.getOptions());
+ configuration.setIdentityContext(identityContext);
+
+ //TODO:set proper jndiName and serviceName
+ configuration.start();
+
+ updateOptionsWithDefaults(configuration,defaultMeta.getOptions());
+
+
+ for (Iterator iterator = modules.iterator(); iterator.hasNext();)
{
- String key = (String)iterator.next();
- ModuleMetaData module = (ModuleMetaData)modules.get(key);
+ ModuleMetaData module = (ModuleMetaData)iterator.next();
+ log.debug("Processing module: " + module.getType() + "/"
+ module.getImplementation());
+ updateModuleWithDefaults(module, defaultImplementations);
+
//instantiate the module
- IdentityModuleService moduleService =
(IdentityModuleService)tcl.loadClass(module.getClassName()).newInstance();
+
+ IdentityModuleService moduleService = null;
+
+ if (module.getClassName() == null)
+ {
+ throw new IdentityException("Class name not found for module type:
" + module.getType() + " wrong configuration");
+ }
+
+ try
+ {
+ moduleService =
(IdentityModuleService)tcl.loadClass(module.getClassName()).newInstance();
+ }
+ catch (InstantiationException e)
+ {
+ throw new IdentityException("Unable to instantiate the class: "
+ module.getClassName() );
+ }
+ catch (IllegalAccessException e)
+ {
+ e.printStackTrace(); //To change body of catch statement use File |
Settings | File Templates.
+ }
+ catch (ClassNotFoundException e)
+ {
+ e.printStackTrace(); //To change body of catch statement use File |
Settings | File Templates.
+ }
+
+ //make a part of identityContext
moduleService.setIdentityContext(identityContext);
//generate initial options
@@ -107,6 +201,8 @@
//set options
moduleService.setInitOptions(optionMap);
+ moduleService.setJndiName(module.getJndiName());
+
//start
moduleService.start();
@@ -116,6 +212,8 @@
getServer().registerMBean(moduleService, new
ObjectName(module.getServiceName()));
}
}
+
+
}
catch (Exception e)
{
@@ -138,7 +236,7 @@
private IdentityConfigurationMetaData parseConfiguration(String configFile) throws
IdentityException
{
ClassLoader tcl = Thread.currentThread().getContextClassLoader();
- IdentityConfigurationMetaData meta = null;
+ IdentityConfigurationMetaData meta;
try
{
log.info("Processing portal identity configuration");
@@ -164,7 +262,109 @@
return meta;
}
+ /**
+ * updates module with proper defaults
+ * @param module
+ * @param defaultModules
+ */
+ private void updateModuleWithDefaults(ModuleMetaData module, Map defaultModules)
+ {
+ if (module.getImplementation() == null)
+ {
+ return;
+ }
+ if (!defaultModules.containsKey(module.getImplementation()))
+ {
+ return;
+ }
+ Map modules = (Map)defaultModules.get(module.getImplementation());
+ if (!modules.containsKey(module.getType()))
+ {
+ return;
+ }
+ ModuleMetaData def = (ModuleMetaData)modules.get(module.getType());
+ if (module.getClassName() == null)
+ {
+ module.setClassName(def.getClassName());
+ }
+ if (module.getJndiName() == null)
+ {
+ module.setJndiName(def.getJndiName());
+ }
+ if (module.getServiceName() == null)
+ {
+ module.setServiceName(def.getServiceName());
+ }
+
+ //now check if config options are overwritten
+ if (module.getConfig() == null)
+ {
+ module.setConfig(def.getConfig());
+ }
+ else
+ {
+ Map moduleOptions = module.getConfig().getOptions();
+ if (moduleOptions == null)
+ {
+ return;
+ }
+ Map defOptions = def.getConfig().getOptions();
+
+ for (Iterator iterator = defOptions.keySet().iterator(); iterator.hasNext();)
+ {
+ String key = (String)iterator.next();
+ if (!moduleOptions.containsKey(key))
+ {
+ ModuleConfigOptionMetaData o =
(ModuleConfigOptionMetaData)defOptions.get(key);
+ module.getConfig().addOption(o);
+ }
+ }
+ }
+ }
+
+ /**
+ * Check current options and update them with defaults if not exists;
+ * @param config
+ * @param defaults
+ */
+ public void updateOptionsWithDefaults(IdentityConfigurationService config,
OptionsMetaData defaults)
+ {
+ //Map newGroups = new HashMap();
+ Map groups = defaults.getGroups();
+ for (Iterator iterator = groups.keySet().iterator(); iterator.hasNext();)
+ {
+ String groupKey = (String)iterator.next();
+
+ OptionsGroupMetaData group = (OptionsGroupMetaData)groups.get(groupKey);
+
+ if (config.getOptions(groupKey) == null)
+ {
+ config.setOptions(groupKey, new HashMap());
+ }
+
+ //Map newOptions = new HashMap();
+ Map options = group.getOptions();
+ for (Iterator iterator1 = options.keySet().iterator(); iterator1.hasNext();)
+ {
+ String optionKey = (String)iterator1.next();
+
+ OptionsGroupOptionMetaData option =
(OptionsGroupOptionMetaData)options.get(optionKey);
+
+ if (config.getValues(groupKey, optionKey) == null)
+ {
+
+ //config.setValues(groupKey, optionKey, new HashSet());
+ config.setValues(groupKey,optionKey,option.getValues());
+ }
+
+
+ }
+ }
+
+ }
+
+
public IdentityContext getIdentityContext()
{
return identityContext;
Modified:
trunk/identity/src/main/org/jboss/portal/identity2/config/metadata/ModulesMetaData.java
===================================================================
---
trunk/identity/src/main/org/jboss/portal/identity2/config/metadata/ModulesMetaData.java 2006-11-22
23:48:17 UTC (rev 5717)
+++
trunk/identity/src/main/org/jboss/portal/identity2/config/metadata/ModulesMetaData.java 2006-11-23
21:53:43 UTC (rev 5718)
@@ -23,6 +23,8 @@
import java.util.Map;
import java.util.HashMap;
+import java.util.List;
+import java.util.LinkedList;
/**
* @author <a href="mailto:boleslaw dot dawidowicz at jboss.org">Boleslaw
Dawidowicz</a>
@@ -30,34 +32,34 @@
*/
public class ModulesMetaData
{
- private Map modules;
+ private List modules;
public ModulesMetaData()
{
- modules = new HashMap();
+ modules = new LinkedList();
}
- public Map getModules()
+ public List getModules()
{
return modules;
}
- public void setModules(Map modules)
+ public void setModules(List modules)
{
this.modules = modules;
}
public void addModule(ModuleMetaData module)
{
- modules.put(module.getType(), module);
+ modules.add(module);
}
- public ModuleMetaData getModule(String type)
+ /*public ModuleMetaData getModule(String type)
{
return (ModuleMetaData)modules.get(type);
- }
+ }*/
}
Modified:
trunk/identity/src/main/org/jboss/portal/identity2/ldap/LDAPConnectionContext.java
===================================================================
---
trunk/identity/src/main/org/jboss/portal/identity2/ldap/LDAPConnectionContext.java 2006-11-22
23:48:17 UTC (rev 5717)
+++
trunk/identity/src/main/org/jboss/portal/identity2/ldap/LDAPConnectionContext.java 2006-11-23
21:53:43 UTC (rev 5718)
@@ -97,12 +97,23 @@
}
catch (NamingException e)
{
- throw new IdentityException("Unable to create InitialLdapContext using:
" + this, e);
+ throw new IdentityException("Unable to create ConnectionContext: " +
this, e);
//return null;
}
+
}
+ protected void startService() throws Exception
+ {
+ /*if (getInitOptions() == null)
+ {
+ throw new IdentityException("Cannot initialize ConnectionContext - lack of
module init options");
+ }*/
+
+ super.startService(); //To change body of overridden methods use File | Settings
| File Templates.
+ }
+
public String toString()
{
StringBuffer str = new StringBuffer();
@@ -123,6 +134,7 @@
public String getName()
{
return getIdentityConfiguration().getValue(IdentityConfiguration.GROUP_CONNECTION,
IdentityConfiguration.CONNECTION_NAME);
+ //return (String)getInitOptions().get(IdentityConfiguration.CONNECTION_NAME);
}
/*public void setName(String name)
@@ -133,6 +145,7 @@
public String getHost()
{
return getIdentityConfiguration().getValue(IdentityConfiguration.GROUP_CONNECTION,
IdentityConfiguration.CONNECTION_HOST);
+ //return (String)getInitOptions().get(IdentityConfiguration.CONNECTION_HOST);
}
/*public void setProviderUrl(String providerUrl)
@@ -143,11 +156,13 @@
public String getPort()
{
return getIdentityConfiguration().getValue(IdentityConfiguration.GROUP_CONNECTION,
IdentityConfiguration.CONNECTION_PORT);
+ //return (String)getInitOptions().get(IdentityConfiguration.CONNECTION_PORT);
}
public String getContextFactory()
{
return getIdentityConfiguration().getValue(IdentityConfiguration.GROUP_CONNECTION,
IdentityConfiguration.CONNECTION_CONTEXT_FACTORY);
+ //return
(String)getInitOptions().get(IdentityConfiguration.CONNECTION_CONTEXT_FACTORY);
}
/*public void setContextFactory(String contextFactory)
@@ -158,6 +173,7 @@
public String getAdminDN()
{
return getIdentityConfiguration().getValue(IdentityConfiguration.GROUP_CONNECTION,
IdentityConfiguration.CONNECTION_ADMIN_DN);
+ //return (String)getInitOptions().get(IdentityConfiguration.CONNECTION_ADMIN_DN);
}
/*public void setAdminDN(String adminDN)
@@ -168,6 +184,7 @@
public String getAdminPassword()
{
return getIdentityConfiguration().getValue(IdentityConfiguration.GROUP_CONNECTION,
IdentityConfiguration.CONNECTION_ADMIN_PASSWORD);
+ //return
(String)getInitOptions().get(IdentityConfiguration.CONNECTION_ADMIN_PASSWORD);
}
/*public void setAdminPassword(String adminPassword)
@@ -188,6 +205,7 @@
public String getAuthentication()
{
String auth =
getIdentityConfiguration().getValue(IdentityConfiguration.GROUP_CONNECTION,
IdentityConfiguration.CONNECTION_AUTHENTICATION);
+ //String auth =
(String)getInitOptions().get(IdentityConfiguration.CONNECTION_AUTHENTICATION);
if (auth == null)
{
return "simple";
Modified:
trunk/identity/src/main/org/jboss/portal/identity2/service/IdentityConfigurationService.java
===================================================================
---
trunk/identity/src/main/org/jboss/portal/identity2/service/IdentityConfigurationService.java 2006-11-22
23:48:17 UTC (rev 5717)
+++
trunk/identity/src/main/org/jboss/portal/identity2/service/IdentityConfigurationService.java 2006-11-23
21:53:43 UTC (rev 5718)
@@ -62,6 +62,11 @@
public IdentityConfigurationService(OptionsMetaData meta) throws IdentityException
{
this();
+ if (meta == null || meta.getGroups() == null)
+ {
+ data = new HashMap();
+ return;
+ }
try
{
Map newGroups = new HashMap();
Modified:
trunk/identity/src/main/org/jboss/portal/identity2/service/IdentityModuleService.java
===================================================================
---
trunk/identity/src/main/org/jboss/portal/identity2/service/IdentityModuleService.java 2006-11-22
23:48:17 UTC (rev 5717)
+++
trunk/identity/src/main/org/jboss/portal/identity2/service/IdentityModuleService.java 2006-11-23
21:53:43 UTC (rev 5718)
@@ -66,6 +66,7 @@
//
if (jndiName != null)
{
+ log.debug("Binding identity module to JNDI with name: " + jndiName);
jndiBinding = new JNDI.Binding(jndiName, this);
jndiBinding.bind();
}
@@ -133,12 +134,12 @@
this.identityContext = identityContext;
}
- protected String getJndiName()
+ public String getJndiName()
{
return jndiName;
}
- protected void setJndiName(String jndiName)
+ public void setJndiName(String jndiName)
{
this.jndiName = jndiName;
}
Deleted:
trunk/identity/src/main/org/jboss/portal/test/identity/ConfigurationTestCase.java
===================================================================
---
trunk/identity/src/main/org/jboss/portal/test/identity/ConfigurationTestCase.java 2006-11-22
23:48:17 UTC (rev 5717)
+++
trunk/identity/src/main/org/jboss/portal/test/identity/ConfigurationTestCase.java 2006-11-23
21:53:43 UTC (rev 5718)
@@ -1,135 +0,0 @@
-/*
-* JBoss, a division of Red Hat
-* Copyright 2006, Red Hat Middleware, LLC, and individual contributors as indicated
-* by the @authors tag. See the copyright.txt in the distribution for a
-* full listing of individual contributors.
-*
-* This is free software; you can redistribute it and/or modify it
-* under the terms of the GNU Lesser General Public License as
-* published by the Free Software Foundation; either version 2.1 of
-* the License, or (at your option) any later version.
-*
-* This software is distributed in the hope that it will be useful,
-* but WITHOUT ANY WARRANTY; without even the implied warranty of
-* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-* Lesser General Public License for more details.
-*
-* You should have received a copy of the GNU Lesser General Public
-* License along with this software; if not, write to the Free
-* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-* 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
-*/
-package org.jboss.portal.test.identity;
-
-import org.apache.log4j.Appender;
-import org.apache.log4j.ConsoleAppender;
-import org.apache.log4j.SimpleLayout;
-import org.apache.log4j.Logger;
-import org.apache.log4j.Level;
-import org.jboss.portal.identity2.IdentityContextImpl;
-import org.jboss.portal.identity2.config.SimpleConfigurationImpl;
-
-
-import java.util.Set;
-import java.util.Iterator;
-
-
-/**
- * @author <a href="mailto:julien@jboss.org">Julien Viet</a>
- * @author <a href="mailto:boleslaw dot dawidowicz at jboss dot
com">Boleslaw Dawidowicz</a>
- * @version $Revision: 5247 $
- */
-public class ConfigurationTestCase extends junit.framework.TestCase
-{
-
- private static final org.jboss.logging.Logger log =
org.jboss.logging.Logger.getLogger(ConfigurationTestCase.class);
-
- static
- {
- Appender appender = new ConsoleAppender(new SimpleLayout());
- Logger.getRoot().addAppender(appender);
- Logger.getRoot().setLevel(Level.INFO);
- Logger.getLogger("org.jboss.portal.identity2").setLevel(Level.DEBUG);
- }
-
- /*public static TestSuite createTestSuite(Class clazz) throws Exception
- {
- URL configsURL =
Thread.currentThread().getContextClassLoader().getResource("directories.xml");
- Map parameterMap = new HashMap();
- parameterMap.put("DirectoryServerConfig",
DSConfig.fromXML2(configsURL));
- POJOJUnitTest abc = new POJOJUnitTest(clazz);
- JUnitAdapter adapter = new JUnitAdapter(abc);
- TestSuite suite = new TestSuite();
- suite.addTest(adapter);
- return suite;
- }*/
-
- public ConfigurationTestCase()
- {
-
- }
-
- /*public ConfigurationTestCase(DSConfig dsConfig)
- {
- this.directoryServerConfigParameter = dsConfig;
- }
-
- private DSConfig directoryServerConfigParameter;
-
- public String getName()
- {
- return super.getName();// + "," +
directoryServerConfigParameter.getName() + "," +
directoryServerConfigParameter.getDescription();
- }
-
- public DSConfig getDirectoryServerConfigParameter()
- {
- return directoryServerConfigParameter;
- }
-
- public void setDirectoryServerConfigParameter(DSConfig
directoryServerConfigParameter)
- {
- this.directoryServerConfigParameter = directoryServerConfigParameter;
- }*/
-
- IdentityContextImpl context;
-
-
- public void setUp() throws Exception
- {
- this.context = new IdentityContextImpl();
- context.start();
-
-
- }
-
- public void testFactory() throws Exception
- {
- SimpleConfigurationImpl configuration = new SimpleConfigurationImpl();
- configuration.setIdentityContext(context);
- configuration.setConfigFile("identityconfig/test-config.xml");
- configuration.start();
- Set keys = configuration.getOptionGroups().keySet();
- log.info("Option Groups:");
- for (Iterator iterator = keys.iterator(); iterator.hasNext();)
- {
- String group = (String)iterator.next();
- log.info("option-group: " + group);
-
- log.info("Options:");
- Set names = configuration.getOptions(group).keySet();
- for (Iterator iterator1 = names.iterator(); iterator1.hasNext();)
- {
- String optionName = (String)iterator1.next();
- log.info("Name: " + optionName);
-
- }
-
- }
-
-
-
assertEquals("uid",configuration.getValue("user.uidAttributeId"));
- }
-
-
-
-}
Modified:
trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleRoleModuleTestCase.java
===================================================================
---
trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleRoleModuleTestCase.java 2006-11-22
23:48:17 UTC (rev 5717)
+++
trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleRoleModuleTestCase.java 2006-11-23
21:53:43 UTC (rev 5718)
@@ -28,6 +28,9 @@
import org.jboss.portal.identity2.ldap.LDAPRoleModuleImpl;
import org.jboss.portal.identity2.ldap.LDAPConnectionContext;
import org.jboss.portal.identity2.IdentityContextImpl;
+import org.jboss.portal.identity2.IdentityServiceControllerImpl;
+import org.jboss.portal.identity2.UserModule;
+import org.jboss.portal.identity2.IdentityContext;
import org.jboss.portal.identity2.config.SimpleConfigurationImpl;
import org.jboss.portal.test.framework.TestRuntimeContext;
import org.jboss.portal.test.identity.ldap.LDAPTestCase;
@@ -58,8 +61,9 @@
{
runtimeContext = new
TestRuntimeContext("org/jboss/portal/test/identity/ldap-beans.xml");
runtimeContext.addBean("LDAPTestBean", this);
+ runtimeContext.start();
- IdentityContextImpl context = new IdentityContextImpl();
+ /*IdentityContextImpl context = new IdentityContextImpl();
context.start();
identityContext = context;
@@ -77,8 +81,16 @@
//roleModule.setContainerDN("ou=Roles,dc=jboss,dc=org");
//roleModule.setRidAttributeID("cn");
roleModule.start();
- this.roleModule = roleModule;
+ this.roleModule = roleModule;*/
+ IdentityServiceControllerImpl controller = new IdentityServiceControllerImpl();
+ controller.setConfigFile(getDirectoryServerConfigParameter().getConfigFile());
+
controller.setDefaultConfigFile("identityconfig/standardidentity-config.xml");
+ controller.setRegisterMBeans(false);
+ controller.start();
+ identityContext = controller.getIdentityContext();
+ this.roleModule =
(RoleModule)identityContext.getObject(IdentityContext.TYPE_ROLE_MODULE);
+
suffix = getDirectoryServerConfigParameter().getCleanUpDN();
super.setUp();
Modified:
trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleUserModuleTestCase.java
===================================================================
---
trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleUserModuleTestCase.java 2006-11-22
23:48:17 UTC (rev 5717)
+++
trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPSimpleUserModuleTestCase.java 2006-11-23
21:53:43 UTC (rev 5718)
@@ -28,6 +28,8 @@
import org.jboss.portal.identity2.ldap.LDAPUserModuleImpl;
import org.jboss.portal.identity2.ldap.LDAPConnectionContext;
import org.jboss.portal.identity2.IdentityContextImpl;
+import org.jboss.portal.identity2.IdentityServiceControllerImpl;
+import org.jboss.portal.identity2.IdentityContext;
import org.jboss.portal.identity2.config.SimpleConfigurationImpl;
import org.jboss.portal.test.framework.TestRuntimeContext;
import org.jboss.portal.test.identity.ldap.LDAPTestCase;
@@ -55,12 +57,13 @@
System.out.println("#########################");
runtimeContext = new
TestRuntimeContext("org/jboss/portal/test/identity/ldap-beans.xml");
runtimeContext.addBean("LDAPTestBean", this);
+ runtimeContext.start();
- IdentityContextImpl context = new IdentityContextImpl();
- context.start();
- identityContext = context;
+ //IdentityContextImpl context = new IdentityContextImpl();
+ //context.start();
+ //identityContext = context;
- SimpleConfigurationImpl configuration = new SimpleConfigurationImpl();
+ /*SimpleConfigurationImpl configuration = new SimpleConfigurationImpl();
configuration.setIdentityContext(identityContext);
configuration.setConfigFile(getDirectoryServerConfigParameter().getConfigFile());
configuration.start();
@@ -76,8 +79,17 @@
//userModule.setUidAttributeID("uid");
userModule.start();
- this.userModule = userModule;
+ this.userModule = userModule;*/
+ IdentityServiceControllerImpl controller = new IdentityServiceControllerImpl();
+ controller.setConfigFile(getDirectoryServerConfigParameter().getConfigFile());
+
controller.setDefaultConfigFile("identityconfig/standardidentity-config.xml");
+ controller.setRegisterMBeans(false);
+ controller.start();
+ identityContext = controller.getIdentityContext();
+ userModule =
(UserModule)identityContext.getObject(IdentityContext.TYPE_USER_MODULE);
+
+
suffix = getDirectoryServerConfigParameter().getCleanUpDN();
super.setUp();
Modified:
trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticGroupMembershipModuleTestCase.java
===================================================================
---
trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticGroupMembershipModuleTestCase.java 2006-11-22
23:48:17 UTC (rev 5717)
+++
trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticGroupMembershipModuleTestCase.java 2006-11-23
21:53:43 UTC (rev 5718)
@@ -38,6 +38,8 @@
import org.jboss.portal.identity2.RoleModule;
import org.jboss.portal.identity2.User;
import org.jboss.portal.identity2.Role;
+import org.jboss.portal.identity2.IdentityServiceControllerImpl;
+import org.jboss.portal.identity2.IdentityContext;
import org.jboss.portal.common.util.Tools;
@@ -73,8 +75,19 @@
{
runtimeContext = new
TestRuntimeContext("org/jboss/portal/test/identity/ldap-beans.xml");
runtimeContext.addBean("LDAPTestBean", this);
+ runtimeContext.start();
- IdentityContextImpl context = new IdentityContextImpl();
+ IdentityServiceControllerImpl controller = new IdentityServiceControllerImpl();
+ controller.setConfigFile(getDirectoryServerConfigParameter().getConfigFile());
+
controller.setDefaultConfigFile("identityconfig/standardidentity-config.xml");
+ controller.setRegisterMBeans(false);
+ controller.start();
+ identityContext = controller.getIdentityContext();
+ userModule =
(UserModule)identityContext.getObject(IdentityContext.TYPE_USER_MODULE);
+ roleModule =
(RoleModule)identityContext.getObject(IdentityContext.TYPE_ROLE_MODULE);
+ membershipModule =
(MembershipModule)identityContext.getObject(IdentityContext.TYPE_MEMBERSHIP_MODULE);
+
+ /*IdentityContextImpl context = new IdentityContextImpl();
context.start();
identityContext = context;
@@ -108,7 +121,7 @@
//membership.setUidAttributeID("member");
//membership.setUidAttributeIsDN(true);
membership.start();
- this.membershipModule = membership;
+ this.membershipModule = membership;*/
/*mstc = new MembershipStrategyTest();
mstc.setContext(this);
Modified:
trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticRoleMembershipModuleTestCase.java
===================================================================
---
trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticRoleMembershipModuleTestCase.java 2006-11-22
23:48:17 UTC (rev 5717)
+++
trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPStaticRoleMembershipModuleTestCase.java 2006-11-23
21:53:43 UTC (rev 5718)
@@ -27,6 +27,9 @@
import org.jboss.portal.identity2.MembershipModule;
import org.jboss.portal.identity2.IdentityContextImpl;
import org.jboss.portal.identity2.IdentityConfiguration;
+import org.jboss.portal.identity2.IdentityServiceControllerImpl;
+import org.jboss.portal.identity2.IdentityContext;
+import org.jboss.portal.identity2.service.MembershipModuleService;
import org.jboss.portal.identity2.ldap.LDAPConnectionContext;
import org.jboss.portal.identity2.ldap.LDAPUserModuleImpl;
import org.jboss.portal.identity2.ldap.LDAPRoleModuleImpl;
@@ -69,12 +72,43 @@
{
runtimeContext = new
TestRuntimeContext("org/jboss/portal/test/identity/ldap-beans.xml");
runtimeContext.addBean("LDAPTestBean", this);
+ runtimeContext.start();
- IdentityContextImpl context = new IdentityContextImpl();
+ IdentityServiceControllerImpl controller = new IdentityServiceControllerImpl();
+ controller.setConfigFile(getDirectoryServerConfigParameter().getConfigFile());
+
controller.setDefaultConfigFile("identityconfig/standardidentity-config.xml");
+ controller.setRegisterMBeans(false);
+ controller.start();
+ identityContext = controller.getIdentityContext();
+
+ //swap the module for the proper one for this test
+ //identityContext.unregister(IdentityContext.TYPE_MEMBERSHIP_MODULE);
+
((MembershipModuleService)identityContext.getObject(IdentityContext.TYPE_MEMBERSHIP_MODULE)).stop();
+ MembershipModuleService membership = new LDAPStaticRoleMembershipModuleImpl();
+ membership.setIdentityContext(identityContext);
+ membership.start();
+
+ userModule =
(UserModule)identityContext.getObject(IdentityContext.TYPE_USER_MODULE);
+ roleModule =
(RoleModule)identityContext.getObject(IdentityContext.TYPE_ROLE_MODULE);
+ membershipModule =
(MembershipModule)identityContext.getObject(IdentityContext.TYPE_MEMBERSHIP_MODULE);
+
+ IdentityConfiguration configuration =
(IdentityConfiguration)identityContext.getObject(IdentityContext.TYPE_IDENTITY_CONFIGURATION);
+ Set values = new HashSet();
+
values.add("ou=Roles,o=example2,dc=testsuite,dc=portal,dc=qa,dc=atl,dc=jboss,dc=com");
+
configuration.setValues(IdentityConfiguration.GROUP_COMMON,IdentityConfiguration.ROLE_CONTAINER_DN,
values);
+ values = new HashSet();
+
values.add("ou=People,o=example2,dc=testsuite,dc=portal,dc=qa,dc=atl,dc=jboss,dc=com");
+
configuration.setValues(IdentityConfiguration.GROUP_COMMON,IdentityConfiguration.USER_CONTAINER_DN,
values);
+ values = new HashSet();
+ values.add("memberOf");
+
configuration.setValues(IdentityConfiguration.GROUP_COMMON,IdentityConfiguration.MEMBERSHIP_ATTRIBUTE_ID,
values);
+
+ /*IdentityContextImpl context = new IdentityContextImpl();
context.start();
- identityContext = context;
+ identityContext = context;*/
- SimpleConfigurationImpl configuration = new SimpleConfigurationImpl();
+
+ /*SimpleConfigurationImpl configuration = new SimpleConfigurationImpl();
configuration.setIdentityContext(identityContext);
configuration.setConfigFile(getDirectoryServerConfigParameter().getConfigFile());
configuration.start();
@@ -115,7 +149,7 @@
//membership.setUidAttributeID("member");
//membership.setUidAttributeIsDN(true);
membership.start();
- this.membershipModule = membership;
+ this.membershipModule = membership;*/
/*mstc = new MembershipStrategyTest();
mstc.setContext(this);
Modified: trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPTestCase.java
===================================================================
---
trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPTestCase.java 2006-11-22
23:48:17 UTC (rev 5717)
+++
trunk/identity/src/main/org/jboss/portal/test/identity/ldap/LDAPTestCase.java 2006-11-23
21:53:43 UTC (rev 5718)
@@ -64,7 +64,7 @@
Appender appender = new ConsoleAppender(new SimpleLayout());
Logger.getRoot().addAppender(appender);
Logger.getRoot().setLevel(Level.INFO);
-
Logger.getLogger("org.jboss.portal.identity2.ldap").setLevel(Level.DEBUG);
+ Logger.getLogger("org.jboss.portal.identity2").setLevel(Level.DEBUG);
}
public static TestSuite createTestSuite(Class clazz) throws Exception
@@ -122,7 +122,7 @@
//give a chance to come up...
//Thread.sleep(500);
}*/
- runtimeContext.start();
+ //runtimeContext.start();
populate();
Added: trunk/identity/src/resources/test/config/minimal-db-identity-config.xml
===================================================================
--- trunk/identity/src/resources/test/config/minimal-db-identity-config.xml 2006-11-22
23:48:17 UTC (rev 5717)
+++ trunk/identity/src/resources/test/config/minimal-db-identity-config.xml 2006-11-23
21:53:43 UTC (rev 5718)
@@ -0,0 +1,47 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<identity-configuration>
+ <modules>
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>UserModule</type>
+ <implementation>DB</implementation>
+ </module>
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>RoleModule</type>
+ <implementation>DB</implementation>
+ </module>
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>MembershipModule</type>
+ <implementation>DB</implementation>
+ </module>
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>UserProfileModule</type>
+ <implementation>DB</implementation>
+ </module>
+ </modules>
+</identity-configuration>
\ No newline at end of file
Added: trunk/identity/src/resources/test/config/minimal-ldap-identity-config.xml
===================================================================
--- trunk/identity/src/resources/test/config/minimal-ldap-identity-config.xml 2006-11-22
23:48:17 UTC (rev 5717)
+++ trunk/identity/src/resources/test/config/minimal-ldap-identity-config.xml 2006-11-23
21:53:43 UTC (rev 5718)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<identity-configuration>
+ <modules>
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>UserModule</type>
+ <implementation>LDAP</implementation>
+ </module>
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>RoleModule</type>
+ <implementation>LDAP</implementation>
+ </module>
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>MembershipModule</type>
+ <implementation>LDAP</implementation>
+ </module>
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>UserProfileModule</type>
+ <implementation>LDAP</implementation>
+ </module>
+
+ <!--For ldap configuration this is needed additionally to use ldap
connection...-->
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>ConnectionContext</type>
+ <implementation>LDAP</implementation>
+ <config>
+ <option>
+ <name>host</name>
+ <value>localhost</value>
+ </option>
+ <option>
+ <name>port</name>
+ <value>10389</value>
+ </option>
+ <option>
+ <name>admin-dn</name>
+ <value>cn=Directory Manager</value>
+ </option>
+ <option>
+ <name>admin-password</name>
+ <value>password</value>
+ </option>
+ </config>
+ </module>
+ </modules>
+
+ <options>
+ <option-group>
+ <group-name>common</group-name>
+ <option>
+ <name>userContainerDN</name>
+
<value>ou=People,dc=testsuite,dc=portal,dc=qa,dc=atl,dc=jboss,dc=com</value>
+ </option>
+ <option>
+ <name>roleContainerDN</name>
+
<value>ou=Roles,dc=testsuite,dc=portal,dc=qa,dc=atl,dc=jboss,dc=com</value>
+ </option>
+ </option-group>
+ </options>
+</identity-configuration>
\ No newline at end of file
Added: trunk/identity/src/resources/test/config/standardidentity-config.xml
===================================================================
--- trunk/identity/src/resources/test/config/standardidentity-config.xml 2006-11-22
23:48:17 UTC (rev 5717)
+++ trunk/identity/src/resources/test/config/standardidentity-config.xml 2006-11-23
21:53:43 UTC (rev 5718)
@@ -0,0 +1,322 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<identity-configuration>
+ <modules>
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>UserModule</type>
+ <implementation>DB</implementation>
+
+ <!--name of service and class for creating mbean-->
+ <service-name>portal:service=Module,type=User</service-name>
+ <class>org.jboss.portal.identity.db.DBUserModuleImp</class>
+ <jndi-name>java:/portal/UserModule</jndi-name>
+
+ <!--set of options that are passed to a class constructor-->
+ <config>
+ <option>
+ <name>SessionFactoryJNDIName</name>
+ <value>java:/portal/UserSessionFactory</value>
+ </option>
+ </config>
+ </module>
+
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>RoleModule</type>
+ <implementation>DB</implementation>
+
+ <!--name of service and class for creating mbean-->
+ <service-name>portal:service=Module,type=Role</service-name>
+ <class>org.jboss.portal.identity.db.DBRoleModuleImp</class>
+ <jndi-name>java:/portal/RoleModule</jndi-name>
+
+ <!--set of options that are passed to a class constructor-->
+ <config>
+ <option>
+ <name>SessionFactoryJNDIName</name>
+ <value>java:/portal/UserSessionFactory</value>
+ </option>
+ </config>
+ </module>
+
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>MembershipModule</type>
+ <implementation>DB</implementation>
+
+ <!--name of service and class for creating mbean-->
+ <service-name>portal:service=Module,type=Membership</service-name>
+ <class>org.jboss.portal.identity.db.DBMembershipModuleImp</class>
+ <jndi-name>java:/portal/MembershipModule</jndi-name>
+
+ <!--set of options that are passed to a class constructor-->
+ <config>
+ <option>
+ <name>SessionFactoryJNDIName</name>
+ <value>java:/portal/UserSessionFactory</value>
+ </option>
+ </config>
+ </module>
+
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>UserProfileModule</type>
+ <implementation>DB</implementation>
+
+ <!--name of service and class for creating mbean-->
+ <service-name>portal:service=Module,type=UserProfile</service-name>
+ <class>org.jboss.portal.identity.db.DBUserProfileModuleImp</class>
+ <jndi-name>java:/portal/UserProfileModule</jndi-name>
+
+ <!--set of options that are passed to a class constructor-->
+ <config>
+ <option>
+ <name>SessionFactoryJNDIName</name>
+ <value>java:/portal/UserSessionFactory</value>
+ </option>
+ </config>
+ </module>
+
+ <!--for ldap modules...-->
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>UserModule</type>
+ <implementation>LDAP</implementation>
+
+ <!--name of service and class for creating mbean-->
+ <service-name>portal:service=Module,type=User</service-name>
+ <class>org.jboss.portal.identity2.ldap.LDAPUserModuleImpl</class>
+ <jndi-name>java:/portal/UserModule</jndi-name>
+
+ <!--set of options that are passed to a class constructor-->
+ <config/>
+ </module>
+
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>RoleModule</type>
+ <implementation>LDAP</implementation>
+
+ <!--name of service and class for creating mbean-->
+ <service-name>portal:service=Module,type=Role</service-name>
+ <class>org.jboss.portal.identity2.ldap.LDAPRoleModuleImpl</class>
+ <jndi-name>java:/portal/RoleModule</jndi-name>
+
+ <!--set of options that are passed to a class constructor-->
+ <config/>
+ </module>
+
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>MembershipModule</type>
+ <implementation>LDAP</implementation>
+
+ <!--name of service and class for creating mbean-->
+ <service-name>portal:service=Module,type=Membership</service-name>
+
<class>org.jboss.portal.identity2.ldap.LDAPStaticGroupMembershipModuleImpl</class>
+ <jndi-name>java:/portal/MembershipModule</jndi-name>
+
+ <!--set of options that are passed to a class constructor-->
+ <config/>
+ </module>
+
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>UserProfileModule</type>
+ <implementation>LDAP</implementation>
+
+ <!--name of service and class for creating mbean-->
+ <service-name>portal:service=Module,type=UserProfile</service-name>
+
<class>org.jboss.portal.identity2.ldap.LDAPUserProfileModuleImpl</class>
+ <jndi-name>java:/portal/UserProfileModule</jndi-name>
+
+ <!--set of options that are passed to a class constructor-->
+ <config>
+ <!--<option>
+ <name>LDAPConnectionJNDIName</name>
+ <value>java:/portal/UserSessionFactory</value>
+ </option>-->
+ <!--Hibernate mappings for db level store (dynamic properties not mapped
as ldap attributes)-->
+ <option>
+ <name>SessionFactoryJNDIName</name>
+ <value>java:/portal/PropertyStoreSessionFactory</value>
+ </option>
+ <option>
+ <name>profileMappings</name>
+ <value>ldap-profile.xml</value>
+ </option>
+ </config>
+ </module>
+
+ <!--For ldap configuration this is needed additionally to use ldap
connection...-->
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>ConnectionContext</type>
+ <implementation>LDAP</implementation>
+
+ <!--name of service and class for creating mbean-->
+
<service-name>portal:service=Module,type=LDAPConnectionContext</service-name>
+
<class>org.jboss.portal.identity2.ldap.LDAPConnectionContext</class>
+ <jndi-name>java:/portal/LDAPConnectionContext</jndi-name>
+
+ <!--set of options that are passed to a class constructor-->
+ <config>
+ <option>
+ <name>host</name>
+ <value>jboss.com</value>
+ </option>
+ <option>
+ <name>port</name>
+ <value>389</value>
+ </option>
+ <option>
+ <name>context-factory</name>
+ <value>com.sun.jndi.ldap.LdapCtxFactory</value>
+ </option>
+ <option>
+ <name>admin-dn</name>
+ <value>cn=Directory Manager</value>
+ </option>
+ <option>
+ <name>admin-password</name>
+ <value>password</value>
+ </option>
+ <option>
+ <name>authentication</name>
+ <value>simple</value>
+ </option>
+ </config>
+ </module>
+ </modules>
+
+ <options>
+ <!--Common options section-->
+ <!--
+ <option-group>
+ <group-name>connection</group-name>
+ <option>
+ <name>host</name>
+ <value>localhost</value>
+ </option>
+ <option>
+ <name>port</name>
+ <value>10389</value>
+ </option>
+ <option>
+ <name>context-factory</name>
+ <value>com.sun.jndi.ldap.LdapCtxFactory</value>
+ </option>
+ <option>
+ <name>admin-dn</name>
+ <value>cn=Directory Manager</value>
+ </option>
+ <option>
+ <name>admin-password</name>
+ <value>password</value>
+ </option>
+ </option-group> -->
+ <option-group>
+ <group-name>common</group-name>
+ <option>
+ <name>userContainerDN</name>
+ <value>ou=People,dc=example,dc=com</value>
+ </option>
+ <option>
+ <name>uidAttributeId</name>
+ <value>uid</value>
+ </option>
+ <option>
+ <name>passwordAttributeID</name>
+ <value>userPassword</value>
+ </option>
+ <option>
+ <name>hashAlgorithm</name>
+ <value>MD5</value>
+ </option>
+ <option>
+ <name>hashEncoding</name>
+ <value>hex</value>
+ </option>
+ <option>
+ <name>roleContainerDN</name>
+ <value>ou=Roles,dc=example,dc=com</value>
+ </option>
+ <option>
+ <name>ridAttributeId</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>roleDisplayNameAttributeID</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>membershipAttributeID</name>
+ <value>member</value>
+ </option>
+ <option>
+ <name>membershipAttributeIsDN</name>
+ <value>true</value>
+ </option>
+ </option-group>
+ <option-group>
+ <group-name>userCreateAttibutes</group-name>
+ <option>
+ <name>objectClass</name>
+ <value>top</value>
+ <value>uidObject</value>
+ <value>person</value>
+ <value>inetUser</value>
+ </option>
+ <!--Schema requires those to have initial value-->
+ <option>
+ <name>cn</name>
+ <value>none</value>
+ </option>
+ <option>
+ <name>sn</name>
+ <value>none</value>
+ </option>
+ </option-group>
+ <option-group>
+ <group-name>roleCreateAttibutes</group-name>
+ <option>
+ <name>objectClass</name>
+ <value>top</value>
+ <value>groupOfNames</value>
+ </option>
+ <!--Schema requires those to have initial value-->
+ <option>
+ <name>cn</name>
+ <value>none</value>
+ </option>
+ <!--Some directory servers require this attribute to be valid DN-->
+ <!--For safety reasons point to the admin user here-->
+ <option>
+ <name>member</name>
+
<value>uid=dummynonexistinguser,ou=People,dc=jboss,dc=org</value>
+ </option>
+ </option-group>
+ </options>
+</identity-configuration>
\ No newline at end of file
Modified: trunk/test/src/etc/identityconfig/opends-config.xml
===================================================================
--- trunk/test/src/etc/identityconfig/opends-config.xml 2006-11-22 23:48:17 UTC (rev
5717)
+++ trunk/test/src/etc/identityconfig/opends-config.xml 2006-11-23 21:53:43 UTC (rev
5718)
@@ -22,204 +22,62 @@
~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<identity-configuration>
- <option-group>
- <group-name>connection</group-name>
- <option>
- <name>host</name>
- <value>localhost</value>
- </option>
- <option>
- <name>port</name>
- <value>10389</value>
- </option>
- <option>
- <name>context-factory</name>
- <value>com.sun.jndi.ldap.LdapCtxFactory</value>
- </option>
- <option>
- <name>admin-dn</name>
- <value>cn=Directory Manager</value>
- </option>
- <option>
- <name>admin-password</name>
- <value>password</value>
- </option>
- </option-group>
- <option-group>
- <group-name>common</group-name>
- <option>
- <name>userContainerDN</name>
-
<value>ou=People,dc=testsuite,dc=portal,dc=qa,dc=atl,dc=jboss,dc=com</value>
- </option>
- <option>
- <name>uidAttributeId</name>
- <value>uid</value>
- </option>
- <option>
- <name>passwordAttributeID</name>
- <value>userPassword</value>
- </option>
- <option>
- <name>hashAlgorithm</name>
- <value>MD5</value>
- </option>
- <option>
- <name>hashEncoding</name>
- <value>hex</value>
- </option>
- <option>
- <name>roleContainerDN</name>
-
<value>ou=Roles,dc=testsuite,dc=portal,dc=qa,dc=atl,dc=jboss,dc=com</value>
- </option>
- <option>
- <name>ridAttributeId</name>
- <value>cn</value>
- </option>
- <option>
- <name>roleDisplayNameAttributeID</name>
- <value>cn</value>
- </option>
- <option>
- <name>membershipAttributeID</name>
- <value>member</value>
- </option>
- <option>
- <name>membershipAttributeIsDN</name>
- <value>true</value>
- </option>
- </option-group>
- <option-group>
- <group-name>userCreateAttibutes</group-name>
- <option>
- <name>objectClass</name>
- <value>top</value>
- <value>inetOrgPerson</value>
- <value>person</value>
- </option>
- <!--Schema requires those to have initial value-->
- <option>
- <name>cn</name>
- <value>none</value>
- </option>
- <option>
- <name>sn</name>
- <value>none</value>
- </option>
- </option-group>
- <option-group>
- <group-name>roleCreateAttibutes</group-name>
- <option>
- <name>objectClass</name>
- <value>top</value>
- <value>groupOfNames</value>
- </option>
- <!--Schema requires those to have initial value-->
- <option>
- <name>cn</name>
- <value>none</value>
- </option>
- <!--Some directory servers require this attribute to be valid DN-->
- <!--For safety reasons point to the admin user here-->
- <option>
- <name>member</name>
-
<value>uid=dummynonexistinguser,ou=People,dc=testsuite,dc=portal,dc=qa,dc=atl,dc=jboss,dc=com</value>
- </option>
- </option-group>
- <option-group>
- <group-name>userProfileMappings</group-name>
- <option>
- <name>portal.user.name.given</name>
- <!--inetOrgPerson-->
- <value>givenName</value>
- </option>
- <!--<option>
- <name>portal.user.name.family</name>
- <value></value>
- </option>
- <option>
- <name>portal.user.location</name>
- <value></value>
- </option>-->
- <option>
- <name>portal.user.occupation</name>
- <!--inetOrgPerson-->
- <value>title</value>
- </option>
- <!--<option>
- <name>portal.user.extra</name>
- <value></value>
- </option>-->
- <option>
- <name>portal.user.signature</name>
- <!--newPilotPerson-->
- <value>personalSignature</value>
- </option>
- <!--<option>
- <name>portal.user.interests</name>
- <value></value>
- </option>-->
- <option>
- <name>portal.user.locale</name>
- <!--inetOrgPerson-->
- <value>localityName</value><!--or prefferedLanguage-->
- </option>
- <!--<option>
- <name>portal.user.im.icq</name>
- <value></value>
- </option>
- <option>
- <name>portal.user.im.aim</name>
- <value></value>
- </option>
- <option>
- <name>portal.user.im.msnm</name>
- <value></value>
- </option>
- <option>
- <name>portal.user.im.yim</name>
- <value></value>
- </option>
- <option>
- <name>portal.user.im.skype</name>
- <value></value>
- </option>-->
- <option>
- <name>portal.user.homepage</name>
- <!--inetOrgPerson-->
- <value>seeAlso</value>
- </option>
- <!--<option>
- <name>portal.user.time-zone-offset</name>
- <value></value>
- </option>
- <option>
- <name>portal.user.theme</name>
- <value></value>
- </option>
- <option>
- <name>portal.user.security.question</name>
- <value></value>
- </option>
- <option>
- <name>portal.user.security.answer</name>
- <value></value>
- </option>
- <option>
- <name>portal.user.email.fake</name>
- <value></value>
- </option>
- <option>
- <name>portal.user.email.view-real</name>
- <value></value>
- </option>
- <option>
- <name>portal.user.last-login-date</name>
- <value></value>
- </option>
- <option>
- <name>portal.user.registration-date</name>
- <value></value>
- </option>-->
- </option-group>
+ <modules>
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>UserModule</type>
+ <implementation>LDAP</implementation>
+ </module>
+ <module>
+ <type>RoleModule</type>
+ <implementation>LDAP</implementation>
+ </module>
+ <module>
+ <type>MembershipModule</type>
+ <implementation>LDAP</implementation>
+ </module>
+ <module>
+ <type>UserProfileModule</type>
+ <implementation>LDAP</implementation>
+ </module>
+ <!--For ldap configuration this is needed additionally to use ldap
connection...-->
+ <module>
+ <type>ConnectionContext</type>
+ <implementation>LDAP</implementation>
+ </module>
+ </modules>
+
+ <options>
+ <option-group>
+ <group-name>connection</group-name>
+ <option>
+ <name>host</name>
+ <value>localhost</value>
+ </option>
+ <option>
+ <name>port</name>
+ <value>10389</value>
+ </option>
+ <option>
+ <name>admin-dn</name>
+ <value>cn=Directory Manager</value>
+ </option>
+ <option>
+ <name>admin-password</name>
+ <value>password</value>
+ </option>
+ </option-group>
+ <option-group>
+ <group-name>common</group-name>
+ <option>
+ <name>userContainerDN</name>
+
<value>ou=People,dc=testsuite,dc=portal,dc=qa,dc=atl,dc=jboss,dc=com</value>
+ </option>
+ <option>
+ <name>roleContainerDN</name>
+
<value>ou=Roles,dc=testsuite,dc=portal,dc=qa,dc=atl,dc=jboss,dc=com</value>
+ </option>
+ </option-group>
+ </options>
</identity-configuration>
\ No newline at end of file
Modified: trunk/test/src/etc/identityconfig/rhds-config.xml
===================================================================
--- trunk/test/src/etc/identityconfig/rhds-config.xml 2006-11-22 23:48:17 UTC (rev 5717)
+++ trunk/test/src/etc/identityconfig/rhds-config.xml 2006-11-23 21:53:43 UTC (rev 5718)
@@ -22,107 +22,62 @@
~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
<identity-configuration>
- <option-group>
- <group-name>connection</group-name>
- <option>
- <name>host</name>
- <value>dev39.qa.atl.jboss.com</value>
- </option>
- <option>
- <name>port</name>
- <value>10389</value>
- </option>
- <option>
- <name>context-factory</name>
- <value>com.sun.jndi.ldap.LdapCtxFactory</value>
- </option>
- <option>
- <name>admin-dn</name>
- <value>cn=Directory Manager</value>
- </option>
- <option>
- <name>admin-password</name>
- <value>qpq123qpq</value>
- </option>
- </option-group>
- <option-group>
- <group-name>common</group-name>
- <option>
- <name>userContainerDN</name>
-
<value>ou=People,dc=testsuite,dc=portal,dc=qa,dc=atl,dc=jboss,dc=com</value>
- </option>
- <option>
- <name>uidAttributeId</name>
- <value>uid</value>
- </option>
- <option>
- <name>passwordAttributeID</name>
- <value>userPassword</value>
- </option>
- <option>
- <name>hashAlgorithm</name>
- <value>MD5</value>
- </option>
- <option>
- <name>hashEncoding</name>
- <value>hex</value>
- </option>
- <option>
- <name>roleContainerDN</name>
-
<value>ou=Roles,dc=testsuite,dc=portal,dc=qa,dc=atl,dc=jboss,dc=com</value>
- </option>
- <option>
- <name>ridAttributeId</name>
- <value>cn</value>
- </option>
- <option>
- <name>roleDisplayNameAttributeID</name>
- <value>cn</value>
- </option>
- <option>
- <name>membershipAttributeID</name>
- <value>member</value>
- </option>
- <option>
- <name>membershipAttributeIsDN</name>
- <value>true</value>
- </option>
- </option-group>
- <option-group>
- <group-name>userCreateAttibutes</group-name>
- <option>
- <name>objectClass</name>
- <value>top</value>
- <value>inetOrgPerson</value>
- <value>person</value>
- </option>
- <!--Schema requires those to have initial value-->
- <option>
- <name>cn</name>
- <value>none</value>
- </option>
- <option>
- <name>sn</name>
- <value>none</value>
- </option>
- </option-group>
- <option-group>
- <group-name>roleCreateAttibutes</group-name>
- <option>
- <name>objectClass</name>
- <value>top</value>
- <value>groupOfNames</value>
- </option>
- <!--Schema requires those to have initial value-->
- <option>
- <name>cn</name>
- <value>none</value>
- </option>
- <!--Some directory servers require this attribute to be valid DN-->
- <!--For safety reasons point to the admin user here-->
- <option>
- <name>member</name>
-
<value>uid=dummynonexistinguser,ou=People,dc=testsuite,dc=portal,dc=qa,dc=atl,dc=jboss,dc=com</value>
- </option>
- </option-group>
+ <modules>
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>UserModule</type>
+ <implementation>LDAP</implementation>
+ </module>
+ <module>
+ <type>RoleModule</type>
+ <implementation>LDAP</implementation>
+ </module>
+ <module>
+ <type>MembershipModule</type>
+ <implementation>LDAP</implementation>
+ </module>
+ <module>
+ <type>UserProfileModule</type>
+ <implementation>LDAP</implementation>
+ </module>
+
+ <!--For ldap configuration this is needed additionally to use ldap
connection...-->
+ <module>
+ <type>ConnectionContext</type>
+ <implementation>LDAP</implementation>
+ </module>
+ </modules>
+
+ <options>
+ <option-group>
+ <group-name>connection</group-name>
+ <option>
+ <name>host</name>
+ <value>dev39.qa.atl.jboss.com</value>
+ </option>
+ <option>
+ <name>port</name>
+ <value>10389</value>
+ </option>
+ <option>
+ <name>admin-dn</name>
+ <value>cn=Directory Manager</value>
+ </option>
+ <option>
+ <name>admin-password</name>
+ <value>qpq123qpq</value>
+ </option>
+ </option-group>
+ <option-group>
+ <group-name>common</group-name>
+ <option>
+ <name>userContainerDN</name>
+
<value>ou=People,dc=testsuite,dc=portal,dc=qa,dc=atl,dc=jboss,dc=com</value>
+ </option>
+ <option>
+ <name>roleContainerDN</name>
+
<value>ou=Roles,dc=testsuite,dc=portal,dc=qa,dc=atl,dc=jboss,dc=com</value>
+ </option>
+ </option-group>
+ </options>
</identity-configuration>
\ No newline at end of file
Added: trunk/test/src/etc/identityconfig/standardidentity-config.xml
===================================================================
--- trunk/test/src/etc/identityconfig/standardidentity-config.xml 2006-11-22 23:48:17 UTC
(rev 5717)
+++ trunk/test/src/etc/identityconfig/standardidentity-config.xml 2006-11-23 21:53:43 UTC
(rev 5718)
@@ -0,0 +1,297 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ ~ JBoss, a division of Red Hat ~
+ ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
+ ~ contributors as indicated by the @authors tag. See the ~
+ ~ copyright.txt in the distribution for a full listing of ~
+ ~ individual contributors. ~
+ ~ ~
+ ~ This is free software; you can redistribute it and/or modify it ~
+ ~ under the terms of the GNU Lesser General Public License as ~
+ ~ published by the Free Software Foundation; either version 2.1 of ~
+ ~ the License, or (at your option) any later version. ~
+ ~ ~
+ ~ This software is distributed in the hope that it will be useful, ~
+ ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
+ ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
+ ~ Lesser General Public License for more details. ~
+ ~ ~
+ ~ You should have received a copy of the GNU Lesser General Public ~
+ ~ License along with this software; if not, write to the Free ~
+ ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
+ ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
+<identity-configuration>
+ <modules>
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>UserModule</type>
+ <implementation>DB</implementation>
+
+ <!--name of service and class for creating mbean-->
+ <service-name>portal:service=Module,type=User</service-name>
+ <class>org.jboss.portal.identity.db.DBUserModuleImp</class>
+ <jndi-name>java:/portal/UserModule</jndi-name>
+
+ <!--set of options that are passed to a class constructor-->
+ <config>
+ <option>
+ <name>SessionFactoryJNDIName</name>
+ <value>java:/portal/UserSessionFactory</value>
+ </option>
+ </config>
+ </module>
+
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>RoleModule</type>
+ <implementation>DB</implementation>
+
+ <!--name of service and class for creating mbean-->
+ <service-name>portal:service=Module,type=Role</service-name>
+ <class>org.jboss.portal.identity.db.DBRoleModuleImp</class>
+ <jndi-name>java:/portal/RoleModule</jndi-name>
+
+ <!--set of options that are passed to a class constructor-->
+ <config>
+ <option>
+ <name>SessionFactoryJNDIName</name>
+ <value>java:/portal/UserSessionFactory</value>
+ </option>
+ </config>
+ </module>
+
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>MembershipModule</type>
+ <implementation>DB</implementation>
+
+ <!--name of service and class for creating mbean-->
+ <service-name>portal:service=Module,type=Membership</service-name>
+ <class>org.jboss.portal.identity.db.DBMembershipModuleImp</class>
+ <jndi-name>java:/portal/MembershipModule</jndi-name>
+
+ <!--set of options that are passed to a class constructor-->
+ <config>
+ <option>
+ <name>SessionFactoryJNDIName</name>
+ <value>java:/portal/UserSessionFactory</value>
+ </option>
+ </config>
+ </module>
+
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>UserProfileModule</type>
+ <implementation>DB</implementation>
+
+ <!--name of service and class for creating mbean-->
+ <service-name>portal:service=Module,type=UserProfile</service-name>
+ <class>org.jboss.portal.identity.db.DBUserProfileModuleImp</class>
+ <jndi-name>java:/portal/UserProfileModule</jndi-name>
+
+ <!--set of options that are passed to a class constructor-->
+ <config>
+ <option>
+ <name>SessionFactoryJNDIName</name>
+ <value>java:/portal/UserSessionFactory</value>
+ </option>
+ </config>
+ </module>
+
+ <!--for ldap modules...-->
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>UserModule</type>
+ <implementation>LDAP</implementation>
+
+ <!--name of service and class for creating mbean-->
+ <service-name>portal:service=Module,type=User</service-name>
+ <class>org.jboss.portal.identity2.ldap.LDAPUserModuleImpl</class>
+ <jndi-name>java:/portal/UserModule</jndi-name>
+
+ <!--set of options that are passed to a class constructor-->
+ <config/>
+ </module>
+
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>RoleModule</type>
+ <implementation>LDAP</implementation>
+
+ <!--name of service and class for creating mbean-->
+ <service-name>portal:service=Module,type=Role</service-name>
+ <class>org.jboss.portal.identity2.ldap.LDAPRoleModuleImpl</class>
+ <jndi-name>java:/portal/RoleModule</jndi-name>
+
+ <!--set of options that are passed to a class constructor-->
+ <config/>
+ </module>
+
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>MembershipModule</type>
+ <implementation>LDAP</implementation>
+
+ <!--name of service and class for creating mbean-->
+ <service-name>portal:service=Module,type=Membership</service-name>
+
<class>org.jboss.portal.identity2.ldap.LDAPStaticGroupMembershipModuleImpl</class>
+ <jndi-name>java:/portal/MembershipModule</jndi-name>
+
+ <!--set of options that are passed to a class constructor-->
+ <config/>
+ </module>
+
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>UserProfileModule</type>
+ <implementation>LDAP</implementation>
+
+ <!--name of service and class for creating mbean-->
+ <service-name>portal:service=Module,type=UserProfile</service-name>
+
<class>org.jboss.portal.identity2.ldap.LDAPUserProfileModuleImpl</class>
+ <jndi-name>java:/portal/UserProfileModule</jndi-name>
+
+ <!--set of options that are passed to a class constructor-->
+ <config>
+ <!--<option>
+ <name>LDAPConnectionJNDIName</name>
+ <value>java:/portal/UserSessionFactory</value>
+ </option>-->
+ <!--Hibernate mappings for db level store (dynamic properties not mapped
as ldap attributes)-->
+ <option>
+ <name>SessionFactoryJNDIName</name>
+ <value>java:/portal/PropertyStoreSessionFactory</value>
+ </option>
+ <option>
+ <name>profileMappings</name>
+ <value>ldap-profile.xml</value>
+ </option>
+ </config>
+ </module>
+
+ <!--For ldap configuration this is needed additionally to use ldap
connection...-->
+ <module>
+ <!--type used to correctly map in IdentityContext registry-->
+ <type>ConnectionContext</type>
+ <implementation>LDAP</implementation>
+
+ <!--name of service and class for creating mbean-->
+
<service-name>portal:service=Module,type=LDAPConnectionContext</service-name>
+
<class>org.jboss.portal.identity2.ldap.LDAPConnectionContext</class>
+ <jndi-name>java:/portal/LDAPConnectionContext</jndi-name>
+
+ <!--set of options that are passed to a class constructor-->
+ <config/>
+ </module>
+ </modules>
+
+ <options>
+ <option-group>
+ <group-name>connection</group-name>
+ <option>
+ <name>host</name>
+ <value>jboss.com</value>
+ </option>
+ <option>
+ <name>port</name>
+ <value>389</value>
+ </option>
+ <option>
+ <name>context-factory</name>
+ <value>com.sun.jndi.ldap.LdapCtxFactory</value>
+ </option>
+ <option>
+ <name>admin-dn</name>
+ <value>cn=Directory Manager</value>
+ </option>
+ <option>
+ <name>admin-password</name>
+ <value>password</value>
+ </option>
+ </option-group>
+
+ <!--Common options section-->
+ <option-group>
+ <group-name>common</group-name>
+ <option>
+ <name>userContainerDN</name>
+ <value>ou=People,dc=example,dc=com</value>
+ </option>
+ <option>
+ <name>uidAttributeId</name>
+ <value>uid</value>
+ </option>
+ <option>
+ <name>passwordAttributeID</name>
+ <value>userPassword</value>
+ </option>
+ <option>
+ <name>hashAlgorithm</name>
+ <value>MD5</value>
+ </option>
+ <option>
+ <name>hashEncoding</name>
+ <value>hex</value>
+ </option>
+ <option>
+ <name>roleContainerDN</name>
+ <value>ou=Roles,dc=example,dc=com</value>
+ </option>
+ <option>
+ <name>ridAttributeId</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>roleDisplayNameAttributeID</name>
+ <value>cn</value>
+ </option>
+ <option>
+ <name>membershipAttributeID</name>
+ <value>member</value>
+ </option>
+ <option>
+ <name>membershipAttributeIsDN</name>
+ <value>true</value>
+ </option>
+ </option-group>
+ <option-group>
+ <group-name>userCreateAttibutes</group-name>
+ <option>
+ <name>objectClass</name>
+ <value>top</value>
+ <value>uidObject</value>
+ <value>person</value>
+ <value>inetUser</value>
+ </option>
+ <!--Schema requires those to have initial value-->
+ <option>
+ <name>cn</name>
+ <value>none</value>
+ </option>
+ <option>
+ <name>sn</name>
+ <value>none</value>
+ </option>
+ </option-group>
+ <option-group>
+ <group-name>roleCreateAttibutes</group-name>
+ <option>
+ <name>objectClass</name>
+ <value>top</value>
+ <value>groupOfNames</value>
+ </option>
+ <!--Schema requires those to have initial value-->
+ <option>
+ <name>cn</name>
+ <value>none</value>
+ </option>
+ <!--Some directory servers require this attribute to be valid DN-->
+ <!--For safety reasons point to the admin user here-->
+ <option>
+ <name>member</name>
+
<value>uid=dummynonexistinguser,ou=People,dc=jboss,dc=org</value>
+ </option>
+ </option-group>
+ </options>
+</identity-configuration>
\ No newline at end of file
Deleted: trunk/test/src/etc/identityconfig/test-config.xml
===================================================================
--- trunk/test/src/etc/identityconfig/test-config.xml 2006-11-22 23:48:17 UTC (rev 5717)
+++ trunk/test/src/etc/identityconfig/test-config.xml 2006-11-23 21:53:43 UTC (rev 5718)
@@ -1,84 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
- ~ JBoss, a division of Red Hat ~
- ~ Copyright 2006, Red Hat Middleware, LLC, and individual ~
- ~ contributors as indicated by the @authors tag. See the ~
- ~ copyright.txt in the distribution for a full listing of ~
- ~ individual contributors. ~
- ~ ~
- ~ This is free software; you can redistribute it and/or modify it ~
- ~ under the terms of the GNU Lesser General Public License as ~
- ~ published by the Free Software Foundation; either version 2.1 of ~
- ~ the License, or (at your option) any later version. ~
- ~ ~
- ~ This software is distributed in the hope that it will be useful, ~
- ~ but WITHOUT ANY WARRANTY; without even the implied warranty of ~
- ~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ~
- ~ Lesser General Public License for more details. ~
- ~ ~
- ~ You should have received a copy of the GNU Lesser General Public ~
- ~ License along with this software; if not, write to the Free ~
- ~ Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA ~
- ~ 02110-1301 USA, or see the FSF site:
http://www.fsf.org. ~
- ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~-->
-<identity-configuration>
- <option-group>
- <group-name>connection</group-name>
- <option>
- <name>host</name>
- <value>localhost</value>
- </option>
- <option>
- <name>port</name>
- <value>10389</value>
- </option>
- <option>
- <name>context-factory</name>
- <value>com.sun.jndi.ldap.LdapCtxFactory</value>
- </option>
- <option>
- <name>admin-dn</name>
- <value>cn=Directory Manager</value>
- </option>
- <option>
- <name>admin-password</name>
- <value>password</value>
- </option>
- </option-group>
- <option-group>
- <group-name>common</group-name>
- <option>
- <name>user.containerDN</name>
- <value>ou=People,dc=jboss,dc=com</value>
- </option>
- <option>
- <name>user.uidAttributeId</name>
- <value>uid</value>
- </option>
- <option>
- <name>role.containerDN</name>
- <value>ou=Role,dc=jboss,dc=com</value>
- </option>
- <option>
- <name>role.ridAttributeId</name>
- <value>cn</value>
- </option>
- <option>
- <name>role.displayNameAttributeID</name>
- <value>xxx</value>
- </option>
- </option-group>
- <option-group>
- <group-name>user.createAttibutes</group-name>
- <option>
- <name>objectClass</name>
- <value>top</value>
- <value>uidObject</value>
- <value>person</value>
- </option>
- <option>
- <name>extraSchemaAtrribute</name>
- <value>extraValue</value>
- </option>
- </option-group>
-</identity-configuration>
\ No newline at end of file