You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@directory.apache.org by ak...@apache.org on 2004/11/07 06:59:06 UTC
svn commit: rev 56814 - in incubator/directory/kerberos/trunk/eve-kerberos/src: java/org/apache/kerberos/kdc ldif test/org/apache/kerberos/kdc
Author: akarasulu
Date: Sat Nov 6 21:59:05 2004
New Revision: 56814
Added:
incubator/directory/kerberos/trunk/eve-kerberos/src/ldif/
incubator/directory/kerberos/trunk/eve-kerberos/src/ldif/example.com
- copied unchanged from rev 56804, incubator/directory/eve/branches/eve-0.1-phoenix/src/ldif/ori_example.ldif
Modified:
incubator/directory/kerberos/trunk/eve-kerberos/src/java/org/apache/kerberos/kdc/EmbeddedEveStore.java
incubator/directory/kerberos/trunk/eve-kerberos/src/test/org/apache/kerberos/kdc/EmbeddedEveStoreTest.java
Log:
Changes ...
o adding the raw info before i start slicing it away for the example DIT
o starting to think about how to structure this
Notes ...
o we are going to need some additional attributes for the LDAP stuff just
to have good form so we're not searching the entire directory - I'm
specifically thinking about a kdc.entry.base
o also we might want to have an additional attribute for loading an LDIF
so we do not have to couple this LDIF to the Jar - just getting the
sense it is not good to put this in there
o init can thus lookup if an LDIF should be loaded or if a new base
needs to be created before we go into solid state operation
Modified: incubator/directory/kerberos/trunk/eve-kerberos/src/java/org/apache/kerberos/kdc/EmbeddedEveStore.java
==============================================================================
--- incubator/directory/kerberos/trunk/eve-kerberos/src/java/org/apache/kerberos/kdc/EmbeddedEveStore.java (original)
+++ incubator/directory/kerberos/trunk/eve-kerberos/src/java/org/apache/kerberos/kdc/EmbeddedEveStore.java Sat Nov 6 21:59:05 2004
@@ -25,7 +25,6 @@
import org.apache.kerberos.kdc.store.PrincipalStore;
import org.apache.kerberos.kdc.store.PrincipalStoreEntry;
-import org.apache.kerberos.kdc.store.LdapStore;
import org.apache.kerberos.kdc.store.PrincipalStoreEntryModifier;
@@ -64,10 +63,14 @@
/**
- * Does nothing really.
+ * Fires up the Eve using the environment properties supplied to the
+ * constructor. The JNDI default context factor and some other parameters
+ * are automatically set though. This method then checks to see if the
+ * suffix is installed and setup according to the needed DIT structure.
*/
public void init()
{
+
}
@@ -95,13 +98,13 @@
filter.append( PRINCIPAL_NAME );
filter.append( '=' );
filter.append( principal.getName() );
- filter.append( ") ( objectClass = krb5Principal ) )" );
+ filter.append( ") ( objectClass = krb5KDCEntry ) )" );
SearchControls ctrls = new SearchControls();
try
{
Attributes attrs = null;
- NamingEnumeration list = ctx.search( "", filter.toString(), ctrls );
+ NamingEnumeration list = ctx.search( "ou=users", filter.toString(), ctrls );
if ( list.hasMore() )
{
SearchResult result = ( SearchResult ) list.next();
@@ -131,7 +134,7 @@
String principal = (String) attrs.get( PRINCIPAL_NAME ).get();
String encryptionType = (String) attrs.get( ENCRYPTION_TYPE ).get();
String keyVersionNumber = (String) attrs.get( KEY_VERSION_NUMBER ).get();
- byte[] keyBytes = (byte[]) attrs.get( LdapStore.KEY ).get();
+ byte[] keyBytes = (byte[]) attrs.get( KEY ).get();
modifier.setPrincipal( new KerberosPrincipal( principal ) );
modifier.setEncryptionType( Integer.parseInt( encryptionType ) );
Modified: incubator/directory/kerberos/trunk/eve-kerberos/src/test/org/apache/kerberos/kdc/EmbeddedEveStoreTest.java
==============================================================================
--- incubator/directory/kerberos/trunk/eve-kerberos/src/test/org/apache/kerberos/kdc/EmbeddedEveStoreTest.java (original)
+++ incubator/directory/kerberos/trunk/eve-kerberos/src/test/org/apache/kerberos/kdc/EmbeddedEveStoreTest.java Sat Nov 6 21:59:05 2004
@@ -18,6 +18,7 @@
import java.util.Hashtable;
+import java.io.File;
import javax.naming.Context;
import javax.naming.directory.*;
@@ -25,6 +26,7 @@
import junit.framework.TestCase;
import org.apache.eve.jndi.EveContextFactory;
+import org.apache.kerberos.kdc.store.PrincipalStoreEntry;
/**
@@ -40,6 +42,7 @@
Hashtable env = new Hashtable();
env.put( Context.PROVIDER_URL, "dc=example,dc=com" );
env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.eve.jndi.EveContextFactory" );
+ env.put( EveContextFactory.WKDIR_ENV, "target" + File.separator + "eve" );
BasicAttributes attrs = new BasicAttributes( true );
BasicAttribute attr = new BasicAttribute( "objectClass" );
@@ -67,6 +70,7 @@
Hashtable env = new Hashtable();
env.put( Context.PROVIDER_URL, "dc=example,dc=com" );
env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.eve.jndi.EveContextFactory" );
+ env.put( EveContextFactory.WKDIR_ENV, "target" + File.separator + "eve" );
BasicAttributes attrs = new BasicAttributes( true );
BasicAttribute attr = new BasicAttribute( "objectClass" );
@@ -85,6 +89,6 @@
EmbeddedEveStore store = new EmbeddedEveStore( env );
KerberosPrincipal principal = new KerberosPrincipal( "krbtgt/EXAMPLE.COM@EXAMPLE.COM" );
- store.getEntry( principal );
+ PrincipalStoreEntry entry = store.getEntry( principal );
}
}