directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From erodrig...@apache.org
Subject svn commit: r327937 - in /directory/shared/kerberos/trunk/common: ./ src/java/org/apache/kerberos/service/ src/java/org/apache/kerberos/store/ src/java/org/apache/kerberos/store/operations/
Date Mon, 24 Oct 2005 03:11:57 GMT
Author: erodriguez
Date: Sun Oct 23 20:11:50 2005
New Revision: 327937

URL: http://svn.apache.org/viewcvs?rev=327937&view=rev
Log:
Refactoring classes commonly used by protocol-providers to new protocol-common subproject.

Modified:
    directory/shared/kerberos/trunk/common/project.xml
    directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/DesStringToKey.java
    directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/ErrorMessageHandler.java
    directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/GetPrincipalStoreEntry.java
    directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/VerifyAuthHeader.java
    directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/VerifyTicket.java
    directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/JndiPrincipalStoreImpl.java
    directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/PrincipalStore.java
    directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/operations/ChangePassword.java
    directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/operations/GetPrincipal.java

Modified: directory/shared/kerberos/trunk/common/project.xml
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/project.xml?rev=327937&r1=327936&r2=327937&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/project.xml (original)
+++ directory/shared/kerberos/trunk/common/project.xml Sun Oct 23 20:11:50 2005
@@ -21,6 +21,11 @@
       <version>0.9.2-SNAPSHOT</version>
     </dependency>
     <dependency>
+      <groupId>directory-shared</groupId>
+      <artifactId>protocol-common</artifactId>
+      <version>0.5.0-SNAPSHOT</version>
+    </dependency>
+    <dependency>
       <groupId>bouncycastle</groupId>
       <artifactId>bcprov-jdk14</artifactId>
       <version>124</version>
@@ -30,4 +35,3 @@
     </dependency>
   </dependencies>
 </project>
-

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/DesStringToKey.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/DesStringToKey.java?rev=327937&r1=327936&r2=327937&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/DesStringToKey.java
(original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/DesStringToKey.java
Sun Oct 23 20:11:50 2005
@@ -18,7 +18,7 @@
 
 import java.io.UnsupportedEncodingException;
 
-import org.apache.kerberos.chain.impl.CommandBase;
+import org.apache.protocol.common.chain.impl.CommandBase;
 import org.bouncycastle.crypto.engines.DESEngine;
 import org.bouncycastle.crypto.modes.CBCBlockCipher;
 import org.bouncycastle.crypto.params.DESParameters;

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/ErrorMessageHandler.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/ErrorMessageHandler.java?rev=327937&r1=327936&r2=327937&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/ErrorMessageHandler.java
(original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/ErrorMessageHandler.java
Sun Oct 23 20:11:50 2005
@@ -18,13 +18,13 @@
 
 import javax.security.auth.kerberos.KerberosPrincipal;
 
-import org.apache.kerberos.chain.Command;
-import org.apache.kerberos.chain.Filter;
-import org.apache.kerberos.chain.impl.CommandBase;
 import org.apache.kerberos.exceptions.KerberosException;
 import org.apache.kerberos.messages.ErrorMessage;
 import org.apache.kerberos.messages.ErrorMessageModifier;
 import org.apache.kerberos.messages.value.KerberosTime;
+import org.apache.protocol.common.chain.Command;
+import org.apache.protocol.common.chain.Filter;
+import org.apache.protocol.common.chain.impl.CommandBase;
 
 /**
  * A {@link Command} for helping convert a {@link KerberosException} into

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/GetPrincipalStoreEntry.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/GetPrincipalStoreEntry.java?rev=327937&r1=327936&r2=327937&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/GetPrincipalStoreEntry.java
(original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/GetPrincipalStoreEntry.java
Sun Oct 23 20:11:50 2005
@@ -18,12 +18,11 @@
 
 import javax.security.auth.kerberos.KerberosPrincipal;
 
-import org.apache.kerberos.chain.impl.CommandBase;
 import org.apache.kerberos.exceptions.ErrorType;
 import org.apache.kerberos.exceptions.KerberosException;
 import org.apache.kerberos.store.PrincipalStore;
 import org.apache.kerberos.store.PrincipalStoreEntry;
-import org.apache.kerberos.store.operations.GetPrincipal;
+import org.apache.protocol.common.chain.impl.CommandBase;
 
 public abstract class GetPrincipalStoreEntry extends CommandBase
 {
@@ -34,7 +33,7 @@
 
         try
         {
-            entry = (PrincipalStoreEntry) store.execute( new GetPrincipal( principal ) );
+            entry = store.getPrincipal( principal );
         }
         catch ( Exception e )
         {

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/VerifyAuthHeader.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/VerifyAuthHeader.java?rev=327937&r1=327936&r2=327937&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/VerifyAuthHeader.java
(original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/VerifyAuthHeader.java
Sun Oct 23 20:11:50 2005
@@ -18,7 +18,6 @@
 
 import java.net.InetAddress;
 
-import org.apache.kerberos.chain.impl.CommandBase;
 import org.apache.kerberos.exceptions.ErrorType;
 import org.apache.kerberos.exceptions.KerberosException;
 import org.apache.kerberos.messages.ApplicationRequest;
@@ -32,6 +31,7 @@
 import org.apache.kerberos.messages.value.KerberosTime;
 import org.apache.kerberos.messages.value.TicketFlags;
 import org.apache.kerberos.replay.ReplayCache;
+import org.apache.protocol.common.chain.impl.CommandBase;
 
 /*
  * Shared by TGS and Changepw

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/VerifyTicket.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/VerifyTicket.java?rev=327937&r1=327936&r2=327937&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/VerifyTicket.java
(original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/service/VerifyTicket.java
Sun Oct 23 20:11:50 2005
@@ -18,10 +18,10 @@
 
 import javax.security.auth.kerberos.KerberosPrincipal;
 
-import org.apache.kerberos.chain.impl.CommandBase;
 import org.apache.kerberos.exceptions.ErrorType;
 import org.apache.kerberos.exceptions.KerberosException;
 import org.apache.kerberos.messages.components.Ticket;
+import org.apache.protocol.common.chain.impl.CommandBase;
 
 /*
  * Shared by TGS and Changepw

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/JndiPrincipalStoreImpl.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/JndiPrincipalStoreImpl.java?rev=327937&r1=327936&r2=327937&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/JndiPrincipalStoreImpl.java
(original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/JndiPrincipalStoreImpl.java
Sun Oct 23 20:11:50 2005
@@ -18,13 +18,18 @@
 
 import javax.naming.Name;
 import javax.naming.ldap.LdapContext;
+import javax.security.auth.kerberos.KerberosKey;
+import javax.security.auth.kerberos.KerberosPrincipal;
+
+import org.apache.kerberos.store.operations.ChangePassword;
+import org.apache.kerberos.store.operations.GetPrincipal;
+import org.apache.protocol.common.store.ContextOperation;
 
 /**
- * A simple implementation of the PrincipalStore interface using a JNDI
- * based store.
+ * A simple implementation of the PrincipalStore interface using a JNDI-based store.
  *
  * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
- * @version $Rev$
+ * @version $Rev$, $Date$
  */
 public class JndiPrincipalStoreImpl implements PrincipalStore
 {
@@ -48,28 +53,18 @@
         this.searchBase = searchBase;
     }
 
-    public Object execute( ContextOperation operation ) throws Exception
+    public PrincipalStoreEntry getPrincipal( KerberosPrincipal principal ) throws Exception
     {
-        return operation.execute( ctx, searchBase );
+        return (PrincipalStoreEntry) execute( new GetPrincipal( principal ) );
     }
 
-    /**
-     * Gets the LdapContext used to search for principals in the JNDI store.
-     *
-     * @return the context for the search searchBase
-     */
-    protected LdapContext getContext()
+    public String changePassword( KerberosPrincipal principal, KerberosKey newKey ) throws
Exception
     {
-        return ctx;
+        return (String) execute( new ChangePassword( principal, newKey ) );
     }
 
-    /**
-     * Gets the search base use for finding principals in the the store.
-     *
-     * @return search base relative to the supplied context
-     */
-    protected Name getSearchBase()
+    private Object execute( ContextOperation operation ) throws Exception
     {
-        return searchBase;
+        return operation.execute( ctx, searchBase );
     }
 }

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/PrincipalStore.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/PrincipalStore.java?rev=327937&r1=327936&r2=327937&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/PrincipalStore.java
(original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/PrincipalStore.java
Sun Oct 23 20:11:50 2005
@@ -16,7 +16,16 @@
  */
 package org.apache.kerberos.store;
 
+import javax.security.auth.kerberos.KerberosKey;
+import javax.security.auth.kerberos.KerberosPrincipal;
+
+/**
+ * @author <a href="mailto:dev@directory.apache.org">Apache Directory Project</a>
+ * @version $Rev$, $Date$
+ */
 public interface PrincipalStore
 {
-    public Object execute( ContextOperation operation ) throws Exception;
+    public PrincipalStoreEntry getPrincipal( KerberosPrincipal principal ) throws Exception;
+
+    public String changePassword( KerberosPrincipal principal, KerberosKey newKey ) throws
Exception;
 }

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/operations/ChangePassword.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/operations/ChangePassword.java?rev=327937&r1=327936&r2=327937&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/operations/ChangePassword.java
(original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/operations/ChangePassword.java
Sun Oct 23 20:11:50 2005
@@ -32,8 +32,8 @@
 import javax.security.auth.kerberos.KerberosKey;
 import javax.security.auth.kerberos.KerberosPrincipal;
 
-import org.apache.kerberos.store.ContextOperation;
 import org.apache.kerberos.store.KerberosAttribute;
+import org.apache.protocol.common.store.ContextOperation;
 
 /**
  * Command for changing a principal's password in a JNDI context.

Modified: directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/operations/GetPrincipal.java
URL: http://svn.apache.org/viewcvs/directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/operations/GetPrincipal.java?rev=327937&r1=327936&r2=327937&view=diff
==============================================================================
--- directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/operations/GetPrincipal.java
(original)
+++ directory/shared/kerberos/trunk/common/src/java/org/apache/kerberos/store/operations/GetPrincipal.java
Sun Oct 23 20:11:50 2005
@@ -27,10 +27,10 @@
 import javax.security.auth.kerberos.KerberosPrincipal;
 
 import org.apache.kerberos.messages.value.SamType;
-import org.apache.kerberos.store.ContextOperation;
 import org.apache.kerberos.store.KerberosAttribute;
 import org.apache.kerberos.store.PrincipalStoreEntry;
 import org.apache.kerberos.store.PrincipalStoreEntryModifier;
+import org.apache.protocol.common.store.ContextOperation;
 
 /**
  * Encapsulates the action of looking up a principal in an embedded ApacheDS DIT.
@@ -52,16 +52,7 @@
     }
 
     /**
-     * Gets the KerberosPrincipal associated with this context operation.
-     * @return
-     */
-    protected KerberosPrincipal getPrincipal()
-    {
-        return principal;
-    }
-
-    /**
-     * Note that the base is a relative path from the exiting context.
+     * Note that the base is a relative path from the existing context.
      * It is not a DN.
      */
     public Object execute( DirContext ctx, Name base )



Mime
View raw message