You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by dj...@apache.org on 2007/01/16 09:24:50 UTC
svn commit: r496618 [5/5] - in /directory/sandbox/triplesec-jacc2: ./
admin-api2/ admin-api2/src/
admin-api2/src/main/java/org/safehaus/triplesec/admin/
admin-api2/src/main/java/org/safehaus/triplesec/admin/dao/
admin-api2/src/main/java/org/safehaus/tr...
Modified: directory/sandbox/triplesec-jacc2/jacc/src/test/java/org/apache/directory/triplesec/jacc/TripleSecPolicyIntegrationTest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/triplesec-jacc2/jacc/src/test/java/org/apache/directory/triplesec/jacc/TripleSecPolicyIntegrationTest.java?view=diff&rev=496618&r1=496617&r2=496618
==============================================================================
--- directory/sandbox/triplesec-jacc2/jacc/src/test/java/org/apache/directory/triplesec/jacc/TripleSecPolicyIntegrationTest.java (original)
+++ directory/sandbox/triplesec-jacc2/jacc/src/test/java/org/apache/directory/triplesec/jacc/TripleSecPolicyIntegrationTest.java Tue Jan 16 00:24:45 2007
@@ -51,10 +51,9 @@
import org.safehaus.triplesec.guardian.StringPermission;
import org.safehaus.triplesec.guardian.StoreConnectionException;
import org.safehaus.triplesec.integration.TriplesecIntegration;
-import org.safehaus.triplesec.jaas.ProfileIdCallback;
import org.safehaus.triplesec.jaas.SafehausLoginModule;
-import org.safehaus.triplesec.admin.dao.DaoFactory;
-import org.safehaus.triplesec.admin.dao.ldap.LdapDaoFactory;
+import org.safehaus.triplesec.jaas.TriplesecRealmPrincipalLoginModule;
+import org.safehaus.triplesec.jaas.LdapBindLoginModule;
/**
* @version $Rev$ $Date$
@@ -85,7 +84,8 @@
props = new Properties();
props.setProperty("applicationPrincipalDN", "appName=" + APP_NAME + ",ou=applications," + BASE_URL);
props.setProperty("applicationCredentials", "testing");
- props.setProperty( DaoFactory.IMPLEMENTATION_CLASS, LdapDaoFactory.class.getName() );
+ //TODO we need something
+// props.setProperty( DaoFactory.IMPLEMENTATION_CLASS, LdapDaoFactory.class.getName() );
props.setProperty( "java.naming.factory.initial", "com.sun.jndi.ldap.LdapCtxFactory" );
props.setProperty( "java.naming.provider.url", "ldap://localhost:" + getLdapPort() + "/dc=example,dc=com" );
props.setProperty( "java.naming.security.principal", "uid=admin,ou=system" );
@@ -208,8 +208,8 @@
Map<String, Object> options = new HashMap<String, Object>();
options.put(Context.PROVIDER_URL, providerUrl);
options.put(Context.SECURITY_AUTHENTICATION, "simple");
- options.put(SafehausLoginModule.REALM_KEY, "example.com");
- options.put(SafehausLoginModule.REALM_POLICY_KEY, realmPolicy);
+ options.put( LdapBindLoginModule.REALM_KEY, "example.com");
+ options.put( TriplesecRealmPrincipalLoginModule.POLICY_KEY, realmPolicy);
SafehausLoginModule module = new SafehausLoginModule();
Subject subject = new Subject();
CallbackHandler callbackHandler = new TestCallbackHandler("akarasulu", "mockProfile1", "maxwell".toCharArray());
@@ -266,8 +266,8 @@
((NameCallback) callback).setName(name);
} else if (callback instanceof PasswordCallback) {
((PasswordCallback) callback).setPassword(password);
- } else if (callback instanceof ProfileIdCallback) {
- ((ProfileIdCallback) callback).setProfileId(profileId);
+// } else if (callback instanceof ProfileIdCallback) {
+// ((ProfileIdCallback) callback).setProfileId(profileId);
}
}
}
Modified: directory/sandbox/triplesec-jacc2/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/triplesec-jacc2/pom.xml?view=diff&rev=496618&r1=496617&r2=496618
==============================================================================
--- directory/sandbox/triplesec-jacc2/pom.xml (original)
+++ directory/sandbox/triplesec-jacc2/pom.xml Tue Jan 16 00:24:45 2007
@@ -175,6 +175,21 @@
<dependency>
<groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-schema-bootstrap</artifactId>
+ <version>1.5.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-schema-extras</artifactId>
+ <version>1.5.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-schema-registries</artifactId>
+ <version>1.5.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
<artifactId>apacheds-server-ssl</artifactId>
<version>1.5.0-SNAPSHOT</version>
</dependency>
@@ -634,7 +649,9 @@
</activation>
<modules>
+<!--
<module>changelog</module>
+-->
<module>configuration</module>
<module>configuration-io</module>
<module>crypto</module>
@@ -642,9 +659,7 @@
<module>profile</module>
<module>testdata</module>
<module>jaas</module>
-<!--
<module>jacc</module>
--->
<module>sms</module>
<module>itest-data</module>
<module>store</module>
@@ -652,7 +667,7 @@
<module>main</module>
<module>integration</module>
<module>tools</module>
- <module>admin-api</module>
+ <module>admin-api2</module>
<module>guardian-api</module>
<module>guardian-ldap</module>
<module>guardian-ldif</module>
@@ -695,7 +710,7 @@
<module>main</module>
<module>integration</module>
<module>tools</module>
- <module>admin-api</module>
+ <module>admin-api2</module>
<module>guardian-api</module>
<module>guardian-ldap</module>
<module>guardian-ldif</module>
@@ -752,7 +767,7 @@
<module>main</module>
<module>integration</module>
<module>tools</module>
- <module>admin-api</module>
+ <module>admin-api2</module>
<module>guardian-api</module>
<module>guardian-ldap</module>
<module>guardian-ldif</module>
Modified: directory/sandbox/triplesec-jacc2/store/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/triplesec-jacc2/store/pom.xml?view=diff&rev=496618&r1=496617&r2=496618
==============================================================================
--- directory/sandbox/triplesec-jacc2/store/pom.xml (original)
+++ directory/sandbox/triplesec-jacc2/store/pom.xml Tue Jan 16 00:24:45 2007
@@ -59,6 +59,18 @@
<artifactId>apacheds-core</artifactId>
</dependency>
<dependency>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-schema-bootstrap</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-schema-extras</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-schema-registries</artifactId>
+ </dependency>
+ <dependency>
<groupId>org.apache.directory.shared</groupId>
<artifactId>shared-ldap</artifactId>
</dependency>
Modified: directory/sandbox/triplesec-jacc2/store/src/main/java/org/safehaus/triplesec/store/DefaultServerProfileStore.java
URL: http://svn.apache.org/viewvc/directory/sandbox/triplesec-jacc2/store/src/main/java/org/safehaus/triplesec/store/DefaultServerProfileStore.java?view=diff&rev=496618&r1=496617&r2=496618
==============================================================================
--- directory/sandbox/triplesec-jacc2/store/src/main/java/org/safehaus/triplesec/store/DefaultServerProfileStore.java (original)
+++ directory/sandbox/triplesec-jacc2/store/src/main/java/org/safehaus/triplesec/store/DefaultServerProfileStore.java Tue Jan 16 00:24:45 2007
@@ -30,8 +30,8 @@
import org.apache.directory.shared.ldap.NotImplementedException;
import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.message.LockableAttributesImpl;
-import org.apache.directory.shared.ldap.message.LockableAttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
import org.safehaus.profile.ServerProfile;
@@ -89,7 +89,7 @@
public ServerProfile getProfile( KerberosPrincipal principal ) throws NamingException
{
- Attributes attributes = new LockableAttributesImpl();
+ Attributes attributes = new AttributesImpl();
attributes.put( PRINCIPAL_ATTR, principal.getName() );
SearchResult result = null;
Attributes attrs = null;
@@ -122,7 +122,7 @@
private SearchResult getProfileEntry( KerberosPrincipal principal ) throws NamingException
{
- Attributes attributes = new LockableAttributesImpl();
+ Attributes attributes = new AttributesImpl();
attributes.put( PRINCIPAL_ATTR, principal.getName() );
SearchResult result = null;
NamingEnumeration list = userContext.search( "", attributes );
@@ -137,7 +137,7 @@
public boolean hasProfile( KerberosPrincipal principal ) throws NamingException
{
- Attributes attributes = new LockableAttributesImpl();
+ Attributes attributes = new AttributesImpl();
attributes.put( PRINCIPAL_ATTR, principal.getName() );
SearchResult result = null;
Attributes attrs = null;
@@ -194,56 +194,56 @@
if ( updated.getFactor() != getLong( "safehausFactor", original ) )
{
- Attribute attr = new LockableAttributeImpl( "safehausFactor" );
+ Attribute attr = new AttributeImpl( "safehausFactor" );
attr.add( Long.toString( updated.getFactor() ) );
list.add( new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr ) );
}
if ( updated.getResynchCount() != getInt( "safehausResynchCount", original ) )
{
- Attribute attr = new LockableAttributeImpl( "safehausResynchCount" );
+ Attribute attr = new AttributeImpl( "safehausResynchCount" );
attr.add( Integer.toString( updated.getResynchCount() ) );
list.add( new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr ) );
}
if ( updated.getFailuresInEpoch() != getInt( "safehausFailuresInEpoch", original ) )
{
- Attribute attr = new LockableAttributeImpl( "safehausFailuresInEpoch" );
+ Attribute attr = new AttributeImpl( "safehausFailuresInEpoch" );
attr.add( Integer.toString( updated.getFailuresInEpoch() ) );
list.add( new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr ) );
}
if ( ! updated.getUserId().equals( getString( "safehausUid", original ) ) )
{
- Attribute attr = new LockableAttributeImpl( "safehausUid" );
+ Attribute attr = new AttributeImpl( "safehausUid" );
attr.add( updated.getUserId() );
list.add( new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr ) );
}
if ( ! updated.getRealm().equals( getString( "safehausRealm", original ) ) )
{
- Attribute attr = new LockableAttributeImpl( "safehausRealm" );
+ Attribute attr = new AttributeImpl( "safehausRealm" );
attr.add( updated.getRealm() );
list.add( new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr ) );
}
if ( ! updated.getLabel().equals( getString( "safehausLabel", original ) ) )
{
- Attribute attr = new LockableAttributeImpl( "safehausLabel" );
+ Attribute attr = new AttributeImpl( "safehausLabel" );
attr.add( updated.getLabel() );
list.add( new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr ) );
}
if ( ! updated.getSecret().equals( getString( "safehausSecret", original ) ) )
{
- Attribute attr = new LockableAttributeImpl( "safehausSecret" );
+ Attribute attr = new AttributeImpl( "safehausSecret" );
attr.add( updated.getSecret() );
list.add( new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr ) );
}
if ( updated.getInfo() != null && ! updated.getInfo().equals( getString( "safehausInfo", original ) ) )
{
- Attribute attr = new LockableAttributeImpl( "safehausInfo" );
+ Attribute attr = new AttributeImpl( "safehausInfo" );
attr.add( updated.getInfo() );
list.add( new ModificationItem( DirContext.REPLACE_ATTRIBUTE, attr ) );
}
Modified: directory/sandbox/triplesec-jacc2/store/src/main/java/org/safehaus/triplesec/store/ProfileStateFactory.java
URL: http://svn.apache.org/viewvc/directory/sandbox/triplesec-jacc2/store/src/main/java/org/safehaus/triplesec/store/ProfileStateFactory.java?view=diff&rev=496618&r1=496617&r2=496618
==============================================================================
--- directory/sandbox/triplesec-jacc2/store/src/main/java/org/safehaus/triplesec/store/ProfileStateFactory.java (original)
+++ directory/sandbox/triplesec-jacc2/store/src/main/java/org/safehaus/triplesec/store/ProfileStateFactory.java Tue Jan 16 00:24:45 2007
@@ -36,7 +36,7 @@
import org.safehaus.profile.ServerProfile;
import org.apache.directory.server.kerberos.shared.store.KerberosAttribute;
-import org.apache.directory.shared.ldap.message.LockableAttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
/**
@@ -84,7 +84,7 @@
if ( oc == null )
{
- oc = new LockableAttributeImpl( "objectClass" );
+ oc = new AttributeImpl( "objectClass" );
outAttrs.put( oc );
}
@@ -162,23 +162,23 @@
// process the Profile specific attributes
- outAttrs.put( new LockableAttributeImpl( "safehausUid", p.getUserId() ) );
- outAttrs.put( new LockableAttributeImpl( "safehausRealm", p.getRealm() ) );
- outAttrs.put( new LockableAttributeImpl( "safehausFactor", String.valueOf( p.getFactor() ) ) );
- outAttrs.put( new LockableAttributeImpl( "safehausSecret", p.getSecret() ) );
- outAttrs.put( new LockableAttributeImpl( "safehausLabel", p.getLabel() ) );
- outAttrs.put( new LockableAttributeImpl( "safehausTokenPin", p.getTokenPin() ) );
- outAttrs.put( new LockableAttributeImpl( "safehausNotifyBy", p.getNotifyBy() ) );
- outAttrs.put( new LockableAttributeImpl( KerberosAttribute.ACCOUNT_DISABLED, String.valueOf( p.isDisabled() ).toUpperCase() ) );
- outAttrs.put( new LockableAttributeImpl( "userPassword", p.getPassword() ) );
+ outAttrs.put( new AttributeImpl( "safehausUid", p.getUserId() ) );
+ outAttrs.put( new AttributeImpl( "safehausRealm", p.getRealm() ) );
+ outAttrs.put( new AttributeImpl( "safehausFactor", String.valueOf( p.getFactor() ) ) );
+ outAttrs.put( new AttributeImpl( "safehausSecret", p.getSecret() ) );
+ outAttrs.put( new AttributeImpl( "safehausLabel", p.getLabel() ) );
+ outAttrs.put( new AttributeImpl( "safehausTokenPin", p.getTokenPin() ) );
+ outAttrs.put( new AttributeImpl( "safehausNotifyBy", p.getNotifyBy() ) );
+ outAttrs.put( new AttributeImpl( KerberosAttribute.ACCOUNT_DISABLED, String.valueOf( p.isDisabled() ).toUpperCase() ) );
+ outAttrs.put( new AttributeImpl( "userPassword", p.getPassword() ) );
if ( p.getActivationKey() != null )
{
- outAttrs.put( new LockableAttributeImpl( "safehausActivationKey", p.getActivationKey() ) );
+ outAttrs.put( new AttributeImpl( "safehausActivationKey", p.getActivationKey() ) );
}
- outAttrs.put( new LockableAttributeImpl( "safehausResynchCount", Integer.toString( p.getResynchCount() ) ) );
- outAttrs.put( new LockableAttributeImpl( "safehausFailuresInEpoch", Integer.toString( p.getFailuresInEpoch() ) ) );
+ outAttrs.put( new AttributeImpl( "safehausResynchCount", Integer.toString( p.getResynchCount() ) ) );
+ outAttrs.put( new AttributeImpl( "safehausFailuresInEpoch", Integer.toString( p.getFailuresInEpoch() ) ) );
if ( p.getInfo() != null )
{
outAttrs.put( new BasicAttribute( "safehausInfo", p.getInfo() ) );
Modified: directory/sandbox/triplesec-jacc2/store/src/main/java/org/safehaus/triplesec/store/interceptor/ApplicationAciManager.java
URL: http://svn.apache.org/viewvc/directory/sandbox/triplesec-jacc2/store/src/main/java/org/safehaus/triplesec/store/interceptor/ApplicationAciManager.java?view=diff&rev=496618&r1=496617&r2=496618
==============================================================================
--- directory/sandbox/triplesec-jacc2/store/src/main/java/org/safehaus/triplesec/store/interceptor/ApplicationAciManager.java (original)
+++ directory/sandbox/triplesec-jacc2/store/src/main/java/org/safehaus/triplesec/store/interceptor/ApplicationAciManager.java Tue Jan 16 00:24:45 2007
@@ -20,25 +20,28 @@
package org.safehaus.triplesec.store.interceptor;
-import org.apache.directory.shared.ldap.message.LockableAttributeImpl;
-import org.apache.directory.shared.ldap.message.LockableAttributesImpl;
-import org.apache.directory.shared.ldap.name.LdapDN;
-import org.apache.directory.shared.ldap.schema.AttributeType;
-import org.apache.directory.shared.ldap.util.AttributeUtils;
-import org.apache.directory.shared.ldap.util.NamespaceTools;
-import org.apache.directory.shared.ldap.exception.LdapNameAlreadyBoundException;
-import org.apache.directory.server.core.invocation.InvocationStack;
-import org.apache.directory.server.core.partition.PartitionNexusProxy;
-import org.apache.directory.server.core.schema.AttributeTypeRegistry;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.Set;
import javax.naming.NamingException;
import javax.naming.directory.Attribute;
import javax.naming.directory.Attributes;
import javax.naming.directory.DirContext;
-import java.util.*;
+import org.apache.directory.server.core.invocation.InvocationStack;
+import org.apache.directory.server.core.partition.PartitionNexusProxy;
+import org.apache.directory.server.schema.registries.AttributeTypeRegistry;
+import org.apache.directory.shared.ldap.exception.LdapNameAlreadyBoundException;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
+import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.schema.AttributeType;
+import org.apache.directory.shared.ldap.util.AttributeUtils;
+import org.apache.directory.shared.ldap.util.NamespaceTools;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
/**
@@ -205,7 +208,7 @@
// continue building the name for the new group entry off of ou=groups
StringBuffer buf = new StringBuffer();
- Attribute cnAttr = new LockableAttributeImpl( "cn" );
+ Attribute cnAttr = new AttributeImpl( "cn" );
buf.append( appUpName );
buf.append( APPADMIN_GROUP_SUFFIX );
cnAttr.add( buf.toString() );
@@ -214,7 +217,7 @@
groupDn.normalize( registry.getNormalizerMapping() );
// create the admin group entry
- Attributes group = new LockableAttributesImpl();
+ Attributes group = new AttributesImpl();
group.put( "objectClass", "top" );
group.get( "objectClass" ).add( "groupOfUniqueNames" );
group.put( cnAttr );
@@ -238,7 +241,7 @@
return;
}
- Attributes groups = new LockableAttributesImpl();
+ Attributes groups = new AttributesImpl();
groups.put( "objectClass", "top" );
groups.get( "objectClass" ).add( "organizationalUnit" );
groups.put( "ou", "Groups" );
@@ -313,7 +316,7 @@
// calculate subentry attributes with both app user ACI and
// app admin group ACI in same subentry
- Attributes subentry = new LockableAttributesImpl();
+ Attributes subentry = new AttributesImpl();
subentry.put( "objectClass", "top" );
subentry.get( "objectClass" ).add( "subentry" );
subentry.get( "objectClass" ).add( "accessControlSubentry" );
@@ -371,7 +374,7 @@
}
}
- Attributes mods = new LockableAttributesImpl();
+ Attributes mods = new AttributesImpl();
mods.put( "administrativeRole", "accessControlSpecificArea" );
proxy.modify( apDn, DirContext.ADD_ATTRIBUTE, mods );
acsaLut.add( apDn.getNormName() );
Modified: directory/sandbox/triplesec-jacc2/store/src/main/java/org/safehaus/triplesec/store/interceptor/PolicyProtectionInterceptor.java
URL: http://svn.apache.org/viewvc/directory/sandbox/triplesec-jacc2/store/src/main/java/org/safehaus/triplesec/store/interceptor/PolicyProtectionInterceptor.java?view=diff&rev=496618&r1=496617&r2=496618
==============================================================================
--- directory/sandbox/triplesec-jacc2/store/src/main/java/org/safehaus/triplesec/store/interceptor/PolicyProtectionInterceptor.java (original)
+++ directory/sandbox/triplesec-jacc2/store/src/main/java/org/safehaus/triplesec/store/interceptor/PolicyProtectionInterceptor.java Tue Jan 16 00:24:45 2007
@@ -32,6 +32,7 @@
import org.apache.directory.shared.ldap.filter.FilterParserImpl;
import org.apache.directory.shared.ldap.util.NamespaceTools;
import org.apache.directory.shared.ldap.name.LdapDN;
+import org.apache.directory.shared.ldap.message.ModificationItemImpl;
import org.apache.directory.server.core.configuration.InterceptorConfiguration;
import org.apache.directory.server.core.interceptor.BaseInterceptor;
import org.apache.directory.server.core.interceptor.Interceptor;
@@ -62,7 +63,7 @@
public void init( DirectoryServiceConfiguration factoryCfg, InterceptorConfiguration cfg ) throws NamingException
{
factoryConfiguration = factoryCfg;
- aciManager = new ApplicationAciManager( factoryCfg.getGlobalRegistries().getAttributeTypeRegistry() );
+ aciManager = new ApplicationAciManager( factoryCfg.getRegistries().getAttributeTypeRegistry() );
}
@@ -202,7 +203,7 @@
}
- public void modify( NextInterceptor next, LdapDN name, ModificationItem[] modItems ) throws NamingException
+ public void modify( NextInterceptor next, LdapDN name, ModificationItemImpl[] modItems ) throws NamingException
{
LdapDN baseName = getBaseName( next, name );
if( baseName == null )
Modified: directory/sandbox/triplesec-jacc2/store/src/test/java/org/safehaus/triplesec/store/ProfileFactoryITest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/triplesec-jacc2/store/src/test/java/org/safehaus/triplesec/store/ProfileFactoryITest.java?view=diff&rev=496618&r1=496617&r2=496618
==============================================================================
--- directory/sandbox/triplesec-jacc2/store/src/test/java/org/safehaus/triplesec/store/ProfileFactoryITest.java (original)
+++ directory/sandbox/triplesec-jacc2/store/src/test/java/org/safehaus/triplesec/store/ProfileFactoryITest.java Tue Jan 16 00:24:45 2007
@@ -25,8 +25,17 @@
import javax.naming.Context;
import org.apache.directory.server.core.unit.AbstractAdminTestCase;
-import org.apache.directory.server.core.schema.bootstrap.*;
import org.apache.directory.server.core.configuration.MutableStartupConfiguration;
+import org.apache.directory.server.schema.bootstrap.BootstrapSchemaLoader;
+import org.apache.directory.server.schema.bootstrap.Schema;
+import org.apache.directory.server.schema.bootstrap.SystemSchema;
+import org.apache.directory.server.schema.bootstrap.CoreSchema;
+import org.apache.directory.server.schema.bootstrap.ApacheSchema;
+import org.apache.directory.server.schema.bootstrap.Krb5kdcSchema;
+import org.apache.directory.server.schema.bootstrap.InetorgpersonSchema;
+import org.apache.directory.server.schema.bootstrap.CosineSchema;
+import org.apache.directory.server.schema.registries.DefaultRegistries;
+import org.apache.directory.server.schema.registries.DefaultOidRegistry;
import org.apache.directory.shared.ldap.ldif.Entry;
import org.apache.directory.shared.ldap.ldif.LdifReader;
@@ -46,10 +55,12 @@
*/
public class ProfileFactoryITest extends AbstractAdminTestCase
{
- public ProfileFactoryITest()
+ public ProfileFactoryITest() throws NamingException
{
MutableStartupConfiguration cfg = super.configuration;
- Set schemas = new HashSet();
+ BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
+ DefaultRegistries bsRegistries = new DefaultRegistries( "bootstrap", loader, new DefaultOidRegistry() );
+ Set<Schema> schemas = new HashSet<Schema>();
schemas.add( new SystemSchema() );
schemas.add( new SafehausSchema() );
schemas.add( new ApacheSchema() );
@@ -57,7 +68,8 @@
schemas.add( new CosineSchema() );
schemas.add( new InetorgpersonSchema() );
schemas.add( new Krb5kdcSchema() );
- cfg.setBootstrapSchemas( schemas );
+// config.setBootstrapSchemas( schemas );
+ loader.loadWithDependencies( schemas, bsRegistries );
cfg.setShutdownHookEnabled( false );
super.overrideEnvironment( Context.OBJECT_FACTORIES, ProfileObjectFactory.class.getName() );
super.overrideEnvironment( Context.STATE_FACTORIES, ProfileStateFactory.class.getName() );
Modified: directory/sandbox/triplesec-jacc2/store/src/test/java/org/safehaus/triplesec/store/ServerProfileStoreITest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/triplesec-jacc2/store/src/test/java/org/safehaus/triplesec/store/ServerProfileStoreITest.java?view=diff&rev=496618&r1=496617&r2=496618
==============================================================================
--- directory/sandbox/triplesec-jacc2/store/src/test/java/org/safehaus/triplesec/store/ServerProfileStoreITest.java (original)
+++ directory/sandbox/triplesec-jacc2/store/src/test/java/org/safehaus/triplesec/store/ServerProfileStoreITest.java Tue Jan 16 00:24:45 2007
@@ -32,20 +32,24 @@
import javax.security.auth.kerberos.KerberosPrincipal;
import org.apache.commons.io.FileUtils;
-import org.apache.directory.shared.ldap.message.LockableAttributeImpl;
-import org.apache.directory.shared.ldap.message.LockableAttributesImpl;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
import org.apache.directory.server.core.configuration.Configuration;
import org.apache.directory.server.core.configuration.MutablePartitionConfiguration;
import org.apache.directory.server.core.configuration.MutableStartupConfiguration;
import org.apache.directory.server.core.configuration.ShutdownConfiguration;
-import org.apache.directory.server.core.schema.bootstrap.ApacheSchema;
-import org.apache.directory.server.core.schema.bootstrap.CoreSchema;
-import org.apache.directory.server.core.schema.bootstrap.CosineSchema;
-import org.apache.directory.server.core.schema.bootstrap.InetorgpersonSchema;
-import org.apache.directory.server.core.schema.bootstrap.Krb5kdcSchema;
-import org.apache.directory.server.core.schema.bootstrap.SystemSchema;
import org.apache.directory.server.protocol.shared.store.Krb5KdcEntryFilter;
import org.apache.directory.server.protocol.shared.store.LdifFileLoader;
+import org.apache.directory.server.schema.bootstrap.SystemSchema;
+import org.apache.directory.server.schema.bootstrap.CoreSchema;
+import org.apache.directory.server.schema.bootstrap.ApacheSchema;
+import org.apache.directory.server.schema.bootstrap.CosineSchema;
+import org.apache.directory.server.schema.bootstrap.InetorgpersonSchema;
+import org.apache.directory.server.schema.bootstrap.Krb5kdcSchema;
+import org.apache.directory.server.schema.bootstrap.BootstrapSchemaLoader;
+import org.apache.directory.server.schema.bootstrap.Schema;
+import org.apache.directory.server.schema.registries.DefaultRegistries;
+import org.apache.directory.server.schema.registries.DefaultOidRegistry;
import org.safehaus.profile.BaseServerProfileModifier;
import org.safehaus.profile.ProfileTestData;
import org.safehaus.profile.ServerProfile;
@@ -61,7 +65,9 @@
*/
public class ServerProfileStoreITest extends TestCase
{
- /** the server side store for profiles */
+ /**
+ * the server side store for profiles
+ */
ServerProfileStore store = null;
DirContext userContext = null;
@@ -74,12 +80,12 @@
protected void setUp() throws Exception
{
File workingDirectory = File.createTempFile( "ServerProfileStoreITest", "test" );
- if ( ! workingDirectory.exists() )
+ if ( ! workingDirectory.exists() )
{
workingDirectory.mkdirs();
}
FileUtils.forceDelete( workingDirectory );
-
+
MutableStartupConfiguration config = new MutableStartupConfiguration();
config.setWorkingDirectory( workingDirectory );
MutablePartitionConfiguration partConfig = new MutablePartitionConfiguration();
@@ -95,15 +101,17 @@
partConfig.setSuffix( "dc=example,dc=com" );
- LockableAttributesImpl attrs = new LockableAttributesImpl();
- LockableAttributeImpl attr = new LockableAttributeImpl( "objectClass" );
+ AttributesImpl attrs = new AttributesImpl();
+ AttributeImpl attr = new AttributeImpl( "objectClass" );
attr.add( "top" );
attr.add( "domain" );
attrs.put( attr );
attrs.put( "dc", "example" );
partConfig.setContextEntry( attrs );
- Set schemas = new HashSet();
+ BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
+ DefaultRegistries bsRegistries = new DefaultRegistries( "bootstrap", loader, new DefaultOidRegistry() );
+ Set<Schema> schemas = new HashSet<Schema>();
schemas.add( new SystemSchema() );
schemas.add( new SafehausSchema() );
schemas.add( new ApacheSchema() );
@@ -111,10 +119,11 @@
schemas.add( new CosineSchema() );
schemas.add( new InetorgpersonSchema() );
schemas.add( new Krb5kdcSchema() );
- config.setBootstrapSchemas( schemas );
- config.setContextPartitionConfigurations( Collections.singleton( partConfig ) );
+// config.setBootstrapSchemas( schemas );
+ loader.loadWithDependencies( schemas, bsRegistries );
+ config.setPartitionConfigurations( Collections.singleton( partConfig ) );
config.setShutdownHookEnabled( false );
-
+
Hashtable env = new Hashtable();
env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.directory.server.core.jndi.CoreContextFactory" );
env.put( Context.PROVIDER_URL, "dc=example,dc=com" );
@@ -142,8 +151,8 @@
store.init();
List filters = Collections.singletonList( new Krb5KdcEntryFilter() );
- LdifFileLoader loader = new LdifFileLoader( userContext, new File( "safehaus.ldif" ), filters, getClass().getClassLoader() );
- loader.execute();
+ LdifFileLoader ldifLoader = new LdifFileLoader( userContext, new File( "safehaus.ldif" ), filters, getClass().getClassLoader() );
+ ldifLoader.execute();
assertNotNull( store );
}
@@ -163,7 +172,7 @@
env.put( Context.STATE_FACTORIES, ProfileStateFactory.class.getName() );
env.put( Context.OBJECT_FACTORIES, ProfileObjectFactory.class.getName() );
new InitialDirContext( env );
-
+
userContext = null;
store = null;
}
Modified: directory/sandbox/triplesec-jacc2/store/src/test/java/org/safehaus/triplesec/store/interceptor/ApplicationACIManagerITest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/triplesec-jacc2/store/src/test/java/org/safehaus/triplesec/store/interceptor/ApplicationACIManagerITest.java?view=diff&rev=496618&r1=496617&r2=496618
==============================================================================
--- directory/sandbox/triplesec-jacc2/store/src/test/java/org/safehaus/triplesec/store/interceptor/ApplicationACIManagerITest.java (original)
+++ directory/sandbox/triplesec-jacc2/store/src/test/java/org/safehaus/triplesec/store/interceptor/ApplicationACIManagerITest.java Tue Jan 16 00:24:45 2007
@@ -23,6 +23,7 @@
import java.util.Hashtable;
import java.util.List;
import java.util.Set;
+import java.util.HashSet;
import javax.naming.Context;
import javax.naming.NameNotFoundException;
@@ -34,15 +35,19 @@
import javax.naming.directory.InitialDirContext;
import org.apache.directory.server.core.unit.AbstractAdminTestCase;
-import org.apache.directory.server.core.schema.bootstrap.SystemSchema;
-import org.apache.directory.server.core.schema.bootstrap.CoreSchema;
-import org.apache.directory.server.core.schema.bootstrap.Krb5kdcSchema;
import org.apache.directory.server.core.configuration.Configuration;
import org.apache.directory.server.core.configuration.MutablePartitionConfiguration;
import org.apache.directory.server.core.configuration.MutableInterceptorConfiguration;
import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition;
-import org.apache.directory.shared.ldap.message.LockableAttributeImpl;
-import org.apache.directory.shared.ldap.message.LockableAttributesImpl;
+import org.apache.directory.server.schema.bootstrap.Krb5kdcSchema;
+import org.apache.directory.server.schema.bootstrap.CoreSchema;
+import org.apache.directory.server.schema.bootstrap.SystemSchema;
+import org.apache.directory.server.schema.bootstrap.BootstrapSchemaLoader;
+import org.apache.directory.server.schema.bootstrap.Schema;
+import org.apache.directory.server.schema.registries.DefaultRegistries;
+import org.apache.directory.server.schema.registries.DefaultOidRegistry;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
import org.apache.directory.shared.ldap.name.LdapDN;
import org.safehaus.triplesec.store.ProfileObjectFactory;
import org.safehaus.triplesec.store.ProfileStateFactory;
@@ -62,27 +67,30 @@
public void setUp() throws Exception
{
- Set schemas = super.configuration.getBootstrapSchemas();
+ BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
+ DefaultRegistries bsRegistries = new DefaultRegistries( "bootstrap", loader, new DefaultOidRegistry() );
+ Set<Schema> schemas = new HashSet<Schema>();
schemas.add( new CoreSchema() );
schemas.add( new SystemSchema() );
schemas.add( new Krb5kdcSchema() );
schemas.add( new SafehausSchema() );
- super.configuration.setBootstrapSchemas( schemas );
+// config.setBootstrapSchemas( schemas );
+ loader.loadWithDependencies( schemas, bsRegistries );
super.configuration.setShutdownHookEnabled( false );
MutablePartitionConfiguration partitionCfg = new MutablePartitionConfiguration();
partitionCfg.setName( "example" );
partitionCfg.setSuffix( "dc=example,dc=com" );
- Attributes ctxEntry = new LockableAttributesImpl();
+ Attributes ctxEntry = new AttributesImpl();
ctxEntry.put( "objectClass", "top" );
ctxEntry.put( "dc", "example" );
ctxEntry.put( "administrativeRole", "accessControlSpecificArea" );
partitionCfg.setContextEntry( ctxEntry );
partitionCfg.setContextPartition( new JdbmPartition() );
- Set partitions = super.configuration.getContextPartitionConfigurations();
+ Set partitions = super.configuration.getPartitionConfigurations();
partitions.add( partitionCfg );
- super.configuration.setContextPartitionConfigurations( partitions );
+ super.configuration.setPartitionConfigurations( partitions );
List interceptors = super.configuration.getInterceptorConfigurations();
MutableInterceptorConfiguration interceptorCfg = new MutableInterceptorConfiguration();
@@ -240,8 +248,8 @@
private void createApplication( String appName, String userPassword ) throws NamingException
{
// create the main application entry
- Attributes attrs = new LockableAttributesImpl();
- Attribute oc = new LockableAttributeImpl( "objectClass" );
+ Attributes attrs = new AttributesImpl();
+ Attribute oc = new AttributeImpl( "objectClass" );
oc.add( "top" );
oc.add( "policyApplication" );
attrs.put( oc );
@@ -254,8 +262,8 @@
ctx.createSubcontext( dn, attrs );
// create ou=permissions
- attrs = new LockableAttributesImpl();
- oc = new LockableAttributeImpl( "objectClass" );
+ attrs = new AttributesImpl();
+ oc = new AttributeImpl( "objectClass" );
oc.add( "top" );
oc.add( "organizationalUnit" );
attrs.put( oc );
@@ -264,8 +272,8 @@
ctx.createSubcontext( dn, attrs );
// create ou=roles
- attrs = new LockableAttributesImpl();
- oc = new LockableAttributeImpl( "objectClass" );
+ attrs = new AttributesImpl();
+ oc = new AttributeImpl( "objectClass" );
oc.add( "top" );
oc.add( "organizationalUnit" );
attrs.put( oc );
@@ -274,8 +282,8 @@
ctx.createSubcontext( dn, attrs );
// create ou=profiles
- attrs = new LockableAttributesImpl();
- oc = new LockableAttributeImpl( "objectClass" );
+ attrs = new AttributesImpl();
+ oc = new AttributeImpl( "objectClass" );
oc.add( "top" );
oc.add( "organizationalUnit" );
attrs.put( oc );
@@ -288,7 +296,7 @@
public void addAppUserToAdminGroup( String appName ) throws NamingException
{
LdapDN dn = new LdapDN( "appName="+appName+",ou=Applications,dc=example,dc=com" );
- Attributes attrs = new LockableAttributesImpl();
+ Attributes attrs = new AttributesImpl();
attrs.put( "uniqueMember", dn.getUpName() );
ctx.modifyAttributes( "cn=" + appName + "AdminGroup,ou=Groups,dc=example,dc=com",
@@ -299,7 +307,7 @@
private boolean canWriteToPermissions( String appName ) throws NamingException
{
DirContext appUserCtx = getAppContextAsApp( appName );
- Attributes attrs = new LockableAttributesImpl();
+ Attributes attrs = new AttributesImpl();
attrs.put( "objectClass", "policyPermission" );
attrs.put( "permName", "testPerm" );
Modified: directory/sandbox/triplesec-jacc2/store/src/test/java/org/safehaus/triplesec/store/interceptor/PolicyProtectionInterceptorITest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/triplesec-jacc2/store/src/test/java/org/safehaus/triplesec/store/interceptor/PolicyProtectionInterceptorITest.java?view=diff&rev=496618&r1=496617&r2=496618
==============================================================================
--- directory/sandbox/triplesec-jacc2/store/src/test/java/org/safehaus/triplesec/store/interceptor/PolicyProtectionInterceptorITest.java (original)
+++ directory/sandbox/triplesec-jacc2/store/src/test/java/org/safehaus/triplesec/store/interceptor/PolicyProtectionInterceptorITest.java Tue Jan 16 00:24:45 2007
@@ -23,6 +23,7 @@
import java.util.Hashtable;
import java.util.List;
import java.util.Set;
+import java.util.HashSet;
import javax.naming.Context;
import javax.naming.NamingException;
@@ -38,13 +39,17 @@
import junit.framework.Assert;
import org.apache.directory.server.core.unit.AbstractAdminTestCase;
-import org.apache.directory.server.core.schema.bootstrap.SystemSchema;
-import org.apache.directory.server.core.schema.bootstrap.CoreSchema;
-import org.apache.directory.server.core.schema.bootstrap.Krb5kdcSchema;
import org.apache.directory.server.core.configuration.Configuration;
import org.apache.directory.server.core.configuration.MutablePartitionConfiguration;
import org.apache.directory.server.core.configuration.MutableInterceptorConfiguration;
import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition;
+import org.apache.directory.server.schema.bootstrap.BootstrapSchemaLoader;
+import org.apache.directory.server.schema.bootstrap.Schema;
+import org.apache.directory.server.schema.bootstrap.Krb5kdcSchema;
+import org.apache.directory.server.schema.bootstrap.SystemSchema;
+import org.apache.directory.server.schema.bootstrap.CoreSchema;
+import org.apache.directory.server.schema.registries.DefaultRegistries;
+import org.apache.directory.server.schema.registries.DefaultOidRegistry;
import org.safehaus.triplesec.store.ProfileObjectFactory;
import org.safehaus.triplesec.store.ProfileStateFactory;
import org.safehaus.triplesec.store.schema.SafehausSchema;
@@ -63,12 +68,15 @@
public void setUp() throws Exception
{
- Set schemas = super.configuration.getBootstrapSchemas();
+ BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
+ DefaultRegistries bsRegistries = new DefaultRegistries( "bootstrap", loader, new DefaultOidRegistry() );
+ Set<Schema> schemas = new HashSet<Schema>();
schemas.add( new CoreSchema() );
schemas.add( new SystemSchema() );
schemas.add( new Krb5kdcSchema() );
schemas.add( new SafehausSchema() );
- super.configuration.setBootstrapSchemas( schemas );
+// config.setBootstrapSchemas( schemas );
+ loader.loadWithDependencies( schemas, bsRegistries );
super.configuration.setShutdownHookEnabled( false );
super.configuration.setAccessControlEnabled( true );
@@ -81,9 +89,9 @@
partitionCfg.setContextEntry( ctxEntry );
partitionCfg.setContextPartition( new JdbmPartition() );
- Set partitions = super.configuration.getContextPartitionConfigurations();
+ Set partitions = super.configuration.getPartitionConfigurations();
partitions.add( partitionCfg );
- super.configuration.setContextPartitionConfigurations( partitions );
+ super.configuration.setPartitionConfigurations( partitions );
List interceptors = super.configuration.getInterceptorConfigurations();
MutableInterceptorConfiguration interceptorCfg = new MutableInterceptorConfiguration();
Modified: directory/sandbox/triplesec-jacc2/verifier/pom.xml
URL: http://svn.apache.org/viewvc/directory/sandbox/triplesec-jacc2/verifier/pom.xml?view=diff&rev=496618&r1=496617&r2=496618
==============================================================================
--- directory/sandbox/triplesec-jacc2/verifier/pom.xml (original)
+++ directory/sandbox/triplesec-jacc2/verifier/pom.xml Tue Jan 16 00:24:45 2007
@@ -51,6 +51,18 @@
</dependency>
<dependency>
<groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-schema-bootstrap</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-schema-extras</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
+ <artifactId>apacheds-schema-registries</artifactId>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.directory.server</groupId>
<artifactId>apacheds-core-unit</artifactId>
<scope>test</scope>
</dependency>
Modified: directory/sandbox/triplesec-jacc2/verifier/src/test/java/org/safehaus/triplesec/verifier/hotp/GenerateHotp.java
URL: http://svn.apache.org/viewvc/directory/sandbox/triplesec-jacc2/verifier/src/test/java/org/safehaus/triplesec/verifier/hotp/GenerateHotp.java?view=diff&rev=496618&r1=496617&r2=496618
==============================================================================
--- directory/sandbox/triplesec-jacc2/verifier/src/test/java/org/safehaus/triplesec/verifier/hotp/GenerateHotp.java (original)
+++ directory/sandbox/triplesec-jacc2/verifier/src/test/java/org/safehaus/triplesec/verifier/hotp/GenerateHotp.java Tue Jan 16 00:24:45 2007
@@ -37,14 +37,23 @@
import org.safehaus.profile.BaseServerProfileModifier;
import org.safehaus.otp.Hotp;
import org.safehaus.otp.Base64;
-import org.apache.directory.server.core.schema.bootstrap.*;
import org.apache.directory.server.core.configuration.MutableStartupConfiguration;
import org.apache.directory.server.core.configuration.MutablePartitionConfiguration;
import org.apache.directory.server.core.configuration.Configuration;
-import org.apache.directory.shared.ldap.message.LockableAttributesImpl;
-import org.apache.directory.shared.ldap.message.LockableAttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
import org.apache.directory.server.protocol.shared.store.Krb5KdcEntryFilter;
import org.apache.directory.server.protocol.shared.store.LdifFileLoader;
+import org.apache.directory.server.schema.bootstrap.SystemSchema;
+import org.apache.directory.server.schema.bootstrap.CosineSchema;
+import org.apache.directory.server.schema.bootstrap.CoreSchema;
+import org.apache.directory.server.schema.bootstrap.Krb5kdcSchema;
+import org.apache.directory.server.schema.bootstrap.InetorgpersonSchema;
+import org.apache.directory.server.schema.bootstrap.ApacheSchema;
+import org.apache.directory.server.schema.bootstrap.BootstrapSchemaLoader;
+import org.apache.directory.server.schema.bootstrap.Schema;
+import org.apache.directory.server.schema.registries.DefaultRegistries;
+import org.apache.directory.server.schema.registries.DefaultOidRegistry;
/**
@@ -83,15 +92,17 @@
partConfig.setSuffix( "dc=example,dc=com" );
- LockableAttributesImpl attrs = new LockableAttributesImpl();
- LockableAttributeImpl attr = new LockableAttributeImpl( "objectClass" );
+ AttributesImpl attrs = new AttributesImpl();
+ AttributeImpl attr = new AttributeImpl( "objectClass" );
attr.add( "top" );
attr.add( "domain" );
attrs.put( attr );
attrs.put( "dc", "example" );
partConfig.setContextEntry( attrs );
- Set schemas = new HashSet();
+ BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
+ DefaultRegistries bsRegistries = new DefaultRegistries( "bootstrap", loader, new DefaultOidRegistry() );
+ Set<Schema> schemas = new HashSet<Schema>();
schemas.add( new SystemSchema() );
schemas.add( new SafehausSchema() );
schemas.add( new ApacheSchema() );
@@ -99,8 +110,9 @@
schemas.add( new CosineSchema() );
schemas.add( new InetorgpersonSchema() );
schemas.add( new Krb5kdcSchema() );
- config.setBootstrapSchemas( schemas );
- config.setContextPartitionConfigurations( Collections.singleton( partConfig ) );
+// config.setBootstrapSchemas( schemas );
+ loader.loadWithDependencies( schemas, bsRegistries );
+ config.setPartitionConfigurations( Collections.singleton( partConfig ) );
partConfig.setSuffix( "dc=example,dc=com" );
@@ -131,9 +143,9 @@
store.init();
List filters = Collections.singletonList( new Krb5KdcEntryFilter() );
- LdifFileLoader loader = new LdifFileLoader( userContext, new File( "safehaus.ldif" ), filters,
+ LdifFileLoader ldifLoader = new LdifFileLoader( userContext, new File( "safehaus.ldif" ), filters,
GenerateHotp.class.getClassLoader() );
- loader.execute();
+ ldifLoader.execute();
if ( args.length > 0 )
{
Modified: directory/sandbox/triplesec-jacc2/verifier/src/test/java/org/safehaus/triplesec/verifier/hotp/HotpSamVerifierITest.java
URL: http://svn.apache.org/viewvc/directory/sandbox/triplesec-jacc2/verifier/src/test/java/org/safehaus/triplesec/verifier/hotp/HotpSamVerifierITest.java?view=diff&rev=496618&r1=496617&r2=496618
==============================================================================
--- directory/sandbox/triplesec-jacc2/verifier/src/test/java/org/safehaus/triplesec/verifier/hotp/HotpSamVerifierITest.java (original)
+++ directory/sandbox/triplesec-jacc2/verifier/src/test/java/org/safehaus/triplesec/verifier/hotp/HotpSamVerifierITest.java Tue Jan 16 00:24:45 2007
@@ -49,20 +49,24 @@
import org.apache.directory.server.kerberos.shared.messages.value.KerberosTime;
import org.apache.directory.server.kerberos.sam.SamException;
import org.apache.directory.server.kerberos.sam.TimestampChecker;
-import org.apache.directory.shared.ldap.message.LockableAttributeImpl;
-import org.apache.directory.shared.ldap.message.LockableAttributesImpl;
+import org.apache.directory.shared.ldap.message.AttributeImpl;
+import org.apache.directory.shared.ldap.message.AttributesImpl;
import org.apache.directory.server.core.configuration.Configuration;
import org.apache.directory.server.core.configuration.MutablePartitionConfiguration;
import org.apache.directory.server.core.configuration.MutableStartupConfiguration;
import org.apache.directory.server.core.configuration.ShutdownConfiguration;
-import org.apache.directory.server.core.schema.bootstrap.ApacheSchema;
-import org.apache.directory.server.core.schema.bootstrap.CoreSchema;
-import org.apache.directory.server.core.schema.bootstrap.CosineSchema;
-import org.apache.directory.server.core.schema.bootstrap.InetorgpersonSchema;
-import org.apache.directory.server.core.schema.bootstrap.Krb5kdcSchema;
-import org.apache.directory.server.core.schema.bootstrap.SystemSchema;
import org.apache.directory.server.protocol.shared.store.Krb5KdcEntryFilter;
import org.apache.directory.server.protocol.shared.store.LdifFileLoader;
+import org.apache.directory.server.schema.bootstrap.SystemSchema;
+import org.apache.directory.server.schema.bootstrap.ApacheSchema;
+import org.apache.directory.server.schema.bootstrap.CoreSchema;
+import org.apache.directory.server.schema.bootstrap.CosineSchema;
+import org.apache.directory.server.schema.bootstrap.InetorgpersonSchema;
+import org.apache.directory.server.schema.bootstrap.Krb5kdcSchema;
+import org.apache.directory.server.schema.bootstrap.BootstrapSchemaLoader;
+import org.apache.directory.server.schema.bootstrap.Schema;
+import org.apache.directory.server.schema.registries.DefaultRegistries;
+import org.apache.directory.server.schema.registries.DefaultOidRegistry;
import org.safehaus.otp.Hotp;
import org.safehaus.otp.HotpErrorConstants;
import org.safehaus.otp.ResynchParameters;
@@ -118,15 +122,17 @@
partConfig.setSuffix( "dc=example,dc=com" );
- LockableAttributesImpl attrs = new LockableAttributesImpl();
- LockableAttributeImpl attr = new LockableAttributeImpl( "objectClass" );
+ AttributesImpl attrs = new AttributesImpl();
+ AttributeImpl attr = new AttributeImpl( "objectClass" );
attr.add( "top" );
attr.add( "domain" );
attrs.put( attr );
attrs.put( "dc", "example" );
partConfig.setContextEntry( attrs );
- Set schemas = new HashSet();
+ BootstrapSchemaLoader loader = new BootstrapSchemaLoader();
+ DefaultRegistries bsRegistries = new DefaultRegistries( "bootstrap", loader, new DefaultOidRegistry() );
+ Set<Schema> schemas = new HashSet<Schema>();
schemas.add( new SystemSchema() );
schemas.add( new SafehausSchema() );
schemas.add( new ApacheSchema() );
@@ -134,8 +140,9 @@
schemas.add( new CosineSchema() );
schemas.add( new InetorgpersonSchema() );
schemas.add( new Krb5kdcSchema() );
- config.setBootstrapSchemas( schemas );
- config.setContextPartitionConfigurations( Collections.singleton( partConfig ) );
+// config.setBootstrapSchemas( schemas );
+ loader.loadWithDependencies( schemas, bsRegistries );
+ config.setPartitionConfigurations( Collections.singleton( partConfig ) );
Hashtable env = new Hashtable();
env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.directory.server.core.jndi.CoreContextFactory" );
@@ -164,8 +171,8 @@
store.init();
List filters = Collections.singletonList( new Krb5KdcEntryFilter() );
- LdifFileLoader loader = new LdifFileLoader( userContext, new File( "safehaus.ldif" ), filters, getClass().getClassLoader() );
- loader.execute();
+ LdifFileLoader ldifLoader = new LdifFileLoader( userContext, new File( "safehaus.ldif" ), filters, getClass().getClassLoader() );
+ ldifLoader.execute();
}