directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From elecha...@apache.org
Subject svn commit: r1197688 - in /directory/apacheds/trunk: core-api/ core-api/src/main/java/org/apache/directory/server/core/api/interceptor/ core-api/src/main/java/org/apache/directory/server/core/api/partition/ core/ core/src/test/java/org/apache/directory...
Date Fri, 04 Nov 2011 17:41:48 GMT
Author: elecharny
Date: Fri Nov  4 17:41:47 2011
New Revision: 1197688

URL: http://svn.apache.org/viewvc?rev=1197688&view=rev
Log:
Merged back modifications on bypasses from osgi branch

Removed:
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/partition/ByPassConstants.java
Modified:
    directory/apacheds/trunk/core/   (props changed)
    directory/apacheds/trunk/core-api/   (props changed)
    directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/InterceptorChain.java
    directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java
    directory/apacheds/trunk/interceptors/authn/   (props changed)
    directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
    directory/apacheds/trunk/interceptors/authz/   (props changed)
    directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
    directory/apacheds/trunk/interceptors/collective/   (props changed)
    directory/apacheds/trunk/interceptors/collective/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java

Propchange: directory/apacheds/trunk/core/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Nov  4 17:41:47 2011
@@ -5,5 +5,5 @@
 /directory/apacheds/branches/apacheds-jdbm/core:1160768-1164072
 /directory/apacheds/branches/apacheds-kerberos-codec-2.0/core:1040956-1043765
 /directory/apacheds/branches/milestones/core:1072812-1075328
-/directory/apacheds/trunk/core:1066126-1067785,1068026-1072718,1072800-1075329
+/directory/apacheds/trunk/core:1066126-1067785,1068026-1072718,1072800-1075329,1197588-1197681
 /directory/studio/trunk/core:1067786-1067997

Propchange: directory/apacheds/trunk/core-api/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Nov  4 17:41:47 2011
@@ -3,7 +3,7 @@
 /directory/apacheds/branches/apacheds-dnfactory-experiment/core-api:980138-980934
 /directory/apacheds/branches/apacheds-jdbm/core-api:1160768-1164073
 /directory/apacheds/branches/apacheds-kerberos-codec-2.0/core-api:1040956-1043765
-/directory/apacheds/branches/apacheds-osgi/core-api:1185681-1197579
+/directory/apacheds/branches/apacheds-osgi/core-api:1185681-1197680
 /directory/apacheds/branches/milestones/core-api:1072812-1075328
 /directory/apacheds/trunk/core-api:1066126-1067785,1068026-1072718,1072800-1075329
 /directory/studio/trunk/core-api:1067786-1067997

Modified: directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/InterceptorChain.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/InterceptorChain.java?rev=1197688&r1=1197687&r2=1197688&view=diff
==============================================================================
--- directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/InterceptorChain.java
(original)
+++ directory/apacheds/trunk/core-api/src/main/java/org/apache/directory/server/core/api/interceptor/InterceptorChain.java
Fri Nov  4 17:41:47 2011
@@ -46,7 +46,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.api.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.UnbindOperationContext;
 import org.apache.directory.server.core.api.invocation.InvocationStack;
-import org.apache.directory.server.core.api.partition.ByPassConstants;
 import org.apache.directory.server.core.api.partition.PartitionNexus;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
@@ -482,11 +481,6 @@ public class InterceptorChain
             return head;
         }
 
-        if ( opContext.isBypassed( ByPassConstants.BYPASS_ALL ) )
-        {
-            return tail;
-        }
-
         Element next = head;
 
         while ( next != tail )

Modified: directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java?rev=1197688&r1=1197687&r2=1197688&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java
(original)
+++ directory/apacheds/trunk/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java
Fri Nov  4 17:41:47 2011
@@ -35,7 +35,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.api.interceptor.InterceptorChain;
 import org.apache.directory.server.core.api.interceptor.context.LookupOperationContext;
 import org.apache.directory.server.core.api.invocation.InvocationStack;
-import org.apache.directory.server.core.api.partition.ByPassConstants;
 import org.apache.directory.server.core.shared.DefaultCoreSession;
 import org.apache.directory.shared.ldap.model.constants.AuthenticationLevel;
 import org.apache.directory.shared.ldap.model.name.Dn;
@@ -228,27 +227,4 @@ public class InterceptorChainTest
         assertEquals( "2", interceptors.get( 1 ).getName() );
         assertEquals( "4", interceptors.get( 2 ).getName() );
     }
-
-
-    @Test
-    public void testCompleteBypass() throws Exception
-    {
-        Dn dn = new Dn( schemaManager, "ou=system" );
-        DirectoryService ds = new MockDirectoryService( 0 );
-        DefaultCoreSession session = new DefaultCoreSession( new LdapPrincipal( schemaManager,
new Dn( schemaManager ), AuthenticationLevel.STRONG ),
-            ds );
-        LookupOperationContext lookupContext = new LookupOperationContext( session, dn );
-        lookupContext.setByPassed( ByPassConstants.BYPASS_ALL_COLLECTION );
-        InvocationStack.getInstance().push( lookupContext );
-
-        try
-        {
-            chain.lookup( lookupContext );
-        }
-        catch ( Exception e )
-        {
-        }
-
-        assertEquals( 0, interceptors.size() );
-    }
 }

Propchange: directory/apacheds/trunk/interceptors/authn/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Nov  4 17:41:47 2011
@@ -1 +1 @@
-/directory/apacheds/branches/apacheds-osgi/interceptors/authn:1185681-1197579
+/directory/apacheds/branches/apacheds-osgi/interceptors/authn:1185681-1197684

Modified: directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java?rev=1197688&r1=1197687&r2=1197688&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
(original)
+++ directory/apacheds/trunk/interceptors/authn/src/main/java/org/apache/directory/server/core/authn/AuthenticationInterceptor.java
Fri Nov  4 17:41:47 2011
@@ -43,11 +43,10 @@ import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import org.apache.directory.server.core.shared.DefaultCoreSession;
 import org.apache.directory.server.core.api.CoreSession;
 import org.apache.directory.server.core.api.DirectoryService;
 import org.apache.directory.server.core.api.LdapPrincipal;
-import org.apache.directory.server.core.api.authn.ppolicy.PasswordPolicyConfiguration;
-import org.apache.directory.server.core.api.authn.ppolicy.PasswordPolicyException;
 import org.apache.directory.server.core.api.filtering.EntryFilteringCursor;
 import org.apache.directory.server.core.api.interceptor.BaseInterceptor;
 import org.apache.directory.server.core.api.interceptor.Interceptor;
@@ -67,8 +66,9 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.api.interceptor.context.RenameOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.UnbindOperationContext;
+import org.apache.directory.server.core.api.authn.ppolicy.PasswordPolicyConfiguration;
+import org.apache.directory.server.core.api.authn.ppolicy.PasswordPolicyException;
 import org.apache.directory.server.core.authn.ppolicy.PpolicyConfigContainer;
-import org.apache.directory.server.core.shared.DefaultCoreSession;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.extras.controls.ppolicy.PasswordPolicy;
 import org.apache.directory.shared.ldap.extras.controls.ppolicy.PasswordPolicyErrorEnum;
@@ -146,30 +146,6 @@ public class AuthenticationInterceptor e
 
 
     /**
-     * the set of interceptors we should *not* go through when pwdpolicy state information
is being updated
-     */
-    private static final Collection<String> BYPASS_INTERCEPTORS;
-
-    static
-    {
-        Set<String> c = new HashSet<String>();
-        c.add( "NormalizationInterceptor" );
-        c.add( "AuthenticationInterceptor" );
-        c.add( "AciAuthorizationInterceptor" );
-        c.add( "DefaultAuthorizationInterceptor" );
-        c.add( "AdministrativePointInterceptor" );
-        c.add( "ExceptionInterceptor" );
-        c.add( "OperationalAttributeInterceptor" );
-        c.add( "SchemaInterceptor" );
-        c.add( "CollectiveAttributeInterceptor" );
-        c.add( "SubentryInterceptor" );
-        c.add( "EventInterceptor" );
-        c.add( "TriggerInterceptor" );
-        BYPASS_INTERCEPTORS = Collections.unmodifiableCollection( c );
-    }
-
-
-    /**
      * Creates an authentication service interceptor.
      */
     public AuthenticationInterceptor()
@@ -1020,10 +996,9 @@ public class AuthenticationInterceptor e
 
                 //adminSession.modify( dn, Collections.singletonList( pwdFailTimeMod ) );
                 ModifyOperationContext bindModCtx = new ModifyOperationContext( adminSession
);
-                bindModCtx.setByPassed( BYPASS_INTERCEPTORS );
                 bindModCtx.setDn( dn );
                 bindModCtx.setModItems( mods );
-                directoryService.getOperationManager().modify( bindModCtx );
+                directoryService.getPartitionNexus().modify( bindModCtx );
             }
 
             String upDn = ( dn == null ? "" : dn.getName() );
@@ -1093,10 +1068,9 @@ public class AuthenticationInterceptor e
             {
                 //adminSession.modify( dn, mods );
                 ModifyOperationContext bindModCtx = new ModifyOperationContext( adminSession
);
-                bindModCtx.setByPassed( BYPASS_INTERCEPTORS );
                 bindModCtx.setDn( dn );
                 bindModCtx.setModItems( mods );
-                directoryService.getOperationManager().modify( bindModCtx );
+                directoryService.getPartitionNexus().modify( bindModCtx );
             }
 
             if ( isPPolicyReqCtrlPresent )

Propchange: directory/apacheds/trunk/interceptors/authz/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Nov  4 17:41:47 2011
@@ -1 +1 @@
-/directory/apacheds/branches/apacheds-osgi/interceptors/authz:1185681-1197579
+/directory/apacheds/branches/apacheds-osgi/interceptors/authz:1185681-1197685

Modified: directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java?rev=1197688&r1=1197687&r2=1197688&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
(original)
+++ directory/apacheds/trunk/interceptors/authz/src/main/java/org/apache/directory/server/core/authz/AciAuthorizationInterceptor.java
Fri Nov  4 17:41:47 2011
@@ -31,6 +31,8 @@ import java.util.Set;
 import javax.naming.directory.SearchControls;
 
 import org.apache.directory.server.constants.ServerDNConstants;
+import org.apache.directory.server.core.shared.DefaultCoreSession;
+import org.apache.directory.server.core.api.subtree.SubentryUtils;
 import org.apache.directory.server.core.api.CoreSession;
 import org.apache.directory.server.core.api.DirectoryService;
 import org.apache.directory.server.core.api.LdapPrincipal;
@@ -54,10 +56,8 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.api.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.SearchingOperationContext;
 import org.apache.directory.server.core.api.partition.PartitionNexus;
-import org.apache.directory.server.core.api.subtree.SubentryUtils;
 import org.apache.directory.server.core.authz.support.ACDFEngine;
 import org.apache.directory.server.core.authz.support.AciContext;
-import org.apache.directory.server.core.shared.DefaultCoreSession;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.aci.ACIItem;
 import org.apache.directory.shared.ldap.aci.ACIItemParser;
@@ -1029,10 +1029,11 @@ public class AciAuthorizationInterceptor
         throws LdapException
     {
         Dn oldDn = moveAndRenameContext.getDn();
+        CoreSession session = moveAndRenameContext.getSession();
 
         Entry entry = moveAndRenameContext.getOriginalEntry();
 
-        LdapPrincipal principal = moveAndRenameContext.getSession().getEffectivePrincipal();
+        LdapPrincipal principal = session.getEffectivePrincipal();
         Dn principalDn = principal.getDn();
         Dn newDn = moveAndRenameContext.getNewDn();
 
@@ -1078,7 +1079,6 @@ public class AciAuthorizationInterceptor
         // This will certainly be fixed by the SubentryInterceptor,
         // but after this service.
 
-        CoreSession session = moveAndRenameContext.getSession();
         LookupOperationContext lookupContext = new LookupOperationContext( session, oldDn,
SchemaConstants.ALL_USER_ATTRIBUTES_ARRAY );
         Entry importedEntry = directoryService.getPartitionNexus().lookup( lookupContext
);
 

Propchange: directory/apacheds/trunk/interceptors/collective/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Fri Nov  4 17:41:47 2011
@@ -0,0 +1 @@
+/directory/apacheds/branches/apacheds-osgi/interceptors/collective:1185681-1197680

Modified: directory/apacheds/trunk/interceptors/collective/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/interceptors/collective/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java?rev=1197688&r1=1197687&r2=1197688&view=diff
==============================================================================
--- directory/apacheds/trunk/interceptors/collective/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
(original)
+++ directory/apacheds/trunk/interceptors/collective/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeInterceptor.java
Fri Nov  4 17:41:47 2011
@@ -24,6 +24,7 @@ import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
 
+import org.apache.directory.server.core.api.CoreSession;
 import org.apache.directory.server.core.api.DirectoryService;
 import org.apache.directory.server.core.api.entry.ClonedServerEntry;
 import org.apache.directory.server.core.api.filtering.EntryFilter;
@@ -37,7 +38,6 @@ import org.apache.directory.server.core.
 import org.apache.directory.server.core.api.interceptor.context.OperationContext;
 import org.apache.directory.server.core.api.interceptor.context.SearchOperationContext;
 import org.apache.directory.server.core.api.interceptor.context.SearchingOperationContext;
-import org.apache.directory.server.core.api.partition.ByPassConstants;
 import org.apache.directory.server.i18n.I18n;
 import org.apache.directory.shared.ldap.model.constants.SchemaConstants;
 import org.apache.directory.shared.ldap.model.entry.Attribute;
@@ -406,7 +406,9 @@ public class CollectiveAttributeIntercep
              * time looking up this sub-entry. 
              */
 
-            Entry subentry = opContext.lookup( subentryDn, ByPassConstants.LOOKUP_COLLECTIVE_BYPASS,
SchemaConstants.ALL_ATTRIBUTES_ARRAY );
+            CoreSession session = opContext.getSession();
+            LookupOperationContext lookupContext = new LookupOperationContext( session, subentryDn,
SchemaConstants.ALL_ATTRIBUTES_ARRAY );
+            Entry subentry = session.getDirectoryService().getPartitionNexus().lookup( lookupContext
);
 
             for ( Attribute attribute : subentry.getAttributes() )
             {



Mime
View raw message