directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ckopp...@apache.org
Subject svn commit: r760603 - in /directory/apacheds/trunk: kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/ kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/ protocol-changepw/src/main/...
Date Tue, 31 Mar 2009 20:45:51 GMT
Author: ckoppelt
Date: Tue Mar 31 20:45:50 2009
New Revision: 760603

URL: http://svn.apache.org/viewvc?rev=760603&view=rev
Log:
started fixing the Kerberos server

Modified:
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/DirectoryPrincipalStore.java
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/SingleBaseSearch.java
    directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/StoreUtils.java
    directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/ChangePasswordServer.java
    directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KdcServer.java

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/DirectoryPrincipalStore.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/DirectoryPrincipalStore.java?rev=760603&r1=760602&r2=760603&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/DirectoryPrincipalStore.java
(original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/DirectoryPrincipalStore.java
Tue Mar 31 20:45:50 2009
@@ -24,6 +24,7 @@
 
 import org.apache.directory.server.core.DirectoryService;
 import org.apache.directory.shared.ldap.NotImplementedException;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
 
 /**
@@ -38,6 +39,7 @@
 {
     /** The directory service backing store for this PrincipalStore. */
     private DirectoryService directoryService;
+    private LdapDN searchBaseDn;
     
     
     /**
@@ -45,9 +47,10 @@
      *
      * @param directoryService backing store for this PrincipalStore
      */
-    public DirectoryPrincipalStore( DirectoryService directoryService )
+    public DirectoryPrincipalStore( DirectoryService directoryService, LdapDN searchBaseDn
)
     {
         this.directoryService = directoryService;
+        this.searchBaseDn = searchBaseDn;
     }
     
     
@@ -92,6 +95,7 @@
      */
     public PrincipalStoreEntry getPrincipal( KerberosPrincipal principal ) throws Exception
     {
-        throw new NotImplementedException();
+        SingleBaseSearch singleBaseSearch = new SingleBaseSearch (directoryService, searchBaseDn);
+        return singleBaseSearch.getPrincipal (principal);
     }
 }

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/SingleBaseSearch.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/SingleBaseSearch.java?rev=760603&r1=760602&r2=760603&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/SingleBaseSearch.java
(original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/SingleBaseSearch.java
Tue Mar 31 20:45:50 2009
@@ -28,6 +28,7 @@
 import org.apache.directory.server.kerberos.shared.store.operations.GetAllPrincipals;
 import org.apache.directory.server.kerberos.shared.store.operations.GetPrincipal;
 import org.apache.directory.server.protocol.shared.ServiceConfigurationException;
+import org.apache.directory.shared.ldap.name.LdapDN;
 
 import javax.security.auth.kerberos.KerberosPrincipal;
 
@@ -42,13 +43,15 @@
 class SingleBaseSearch implements PrincipalStore
 {
     private final CoreSession session;
+    private final LdapDN searchBaseDn;
 
 
-    SingleBaseSearch( DirectoryService directoryService )
+    SingleBaseSearch( DirectoryService directoryService, LdapDN searchBaseDn )
     {
         try
         {
-            session = directoryService.getSession();
+            session = directoryService.getAdminSession();
+            this.searchBaseDn = searchBaseDn;
         } 
         catch ( Exception e )
         {
@@ -78,7 +81,7 @@
 
     public PrincipalStoreEntry getPrincipal( KerberosPrincipal principal ) throws Exception
     {
-        return ( PrincipalStoreEntry ) new GetPrincipal( principal ).execute( session, null
);
+        return ( PrincipalStoreEntry ) new GetPrincipal( principal ).execute( session, searchBaseDn
);
     }
 
 

Modified: directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/StoreUtils.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/StoreUtils.java?rev=760603&r1=760602&r2=760603&view=diff
==============================================================================
--- directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/StoreUtils.java
(original)
+++ directory/apacheds/trunk/kerberos-shared/src/main/java/org/apache/directory/server/kerberos/shared/store/operations/StoreUtils.java
Tue Mar 31 20:45:50 2009
@@ -103,9 +103,9 @@
      */
     private static ExprNode getFilter( AttributeTypeRegistry registry, String principal )
throws Exception
     {
-        AttributeType type = registry.lookup( "krb5Principal" );
+        AttributeType type = registry.lookup( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT );
         Value<String> value = new ServerStringValue( type, principal );
-        return new EqualityNode<String>( "krb5Principal", value );
+        return new EqualityNode<String>( KerberosAttribute.KRB5_PRINCIPAL_NAME_AT,
value );
     }
     
 

Modified: directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/ChangePasswordServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/ChangePasswordServer.java?rev=760603&r1=760602&r2=760603&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/ChangePasswordServer.java
(original)
+++ directory/apacheds/trunk/protocol-changepw/src/main/java/org/apache/directory/server/changepw/ChangePasswordServer.java
Tue Mar 31 20:45:50 2009
@@ -24,6 +24,7 @@
 import java.util.ArrayList;
 import java.util.List;
 
+import javax.naming.InvalidNameException;
 import javax.security.auth.kerberos.KerberosPrincipal;
 
 import org.apache.directory.server.changepw.protocol.ChangePasswordProtocolHandler;
@@ -34,6 +35,7 @@
 import org.apache.directory.server.protocol.shared.DirectoryBackedService;
 import org.apache.directory.server.protocol.shared.transport.TcpTransport;
 import org.apache.directory.server.protocol.shared.transport.UdpTransport;
+import org.apache.directory.shared.ldap.name.LdapDN;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -263,9 +265,9 @@
     /**
      * @throws IOException if we cannot bind to the specified ports
      */
-    public void start() throws IOException
+    public void start() throws IOException, InvalidNameException
     {
-        PrincipalStore store = new DirectoryPrincipalStore( getDirectoryService() );
+        PrincipalStore store = new DirectoryPrincipalStore( getDirectoryService(), new LdapDN(this.getSearchBaseDn())
 );
         
         if ( getDatagramAcceptor() != null )
         {

Modified: directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KdcServer.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KdcServer.java?rev=760603&r1=760602&r2=760603&view=diff
==============================================================================
--- directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KdcServer.java
(original)
+++ directory/apacheds/trunk/protocol-kerberos/src/main/java/org/apache/directory/server/kerberos/kdc/KdcServer.java
Tue Mar 31 20:45:50 2009
@@ -24,6 +24,7 @@
 import java.util.HashSet;
 import java.util.Set;
 
+import javax.naming.InvalidNameException;
 import javax.security.auth.kerberos.KerberosPrincipal;
 
 import org.apache.directory.server.constants.ServerDNConstants;
@@ -37,6 +38,7 @@
 import org.apache.directory.server.protocol.shared.transport.TcpTransport;
 import org.apache.directory.server.protocol.shared.transport.Transport;
 import org.apache.directory.server.protocol.shared.transport.UdpTransport;
+import org.apache.directory.shared.ldap.name.LdapDN;
 import org.apache.mina.core.filterchain.DefaultIoFilterChainBuilder;
 import org.apache.mina.core.filterchain.IoFilterChainBuilder;
 import org.apache.mina.core.service.IoAcceptor;
@@ -435,12 +437,12 @@
     /**
      * @throws IOException if we cannot bind to the sockets
      */
-    public void start() throws IOException
+    public void start() throws IOException, InvalidNameException
     {
         PrincipalStore store;
 
         // TODO - for now ignoring this catalog crap
-        store = new DirectoryPrincipalStore( getDirectoryService() );
+        store = new DirectoryPrincipalStore( getDirectoryService(), new LdapDN(this.getSearchBaseDn())
 );
         
         Transport udpTransport = getUdpTransport();
 



Mime
View raw message