Return-Path: Delivered-To: apmail-directory-commits-archive@www.apache.org Received: (qmail 15973 invoked from network); 31 Jul 2006 16:29:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (209.237.227.199) by minotaur.apache.org with SMTP; 31 Jul 2006 16:29:18 -0000 Received: (qmail 98962 invoked by uid 500); 31 Jul 2006 16:29:17 -0000 Delivered-To: apmail-directory-commits-archive@directory.apache.org Received: (qmail 98857 invoked by uid 500); 31 Jul 2006 16:29:17 -0000 Mailing-List: contact commits-help@directory.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@directory.apache.org Delivered-To: mailing list commits@directory.apache.org Received: (qmail 98810 invoked by uid 99); 31 Jul 2006 16:29:16 -0000 Received: from asf.osuosl.org (HELO asf.osuosl.org) (140.211.166.49) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Jul 2006 09:29:16 -0700 X-ASF-Spam-Status: No, hits=-9.4 required=10.0 tests=ALL_TRUSTED,NO_REAL_NAME X-Spam-Check-By: apache.org Received-SPF: pass (asf.osuosl.org: local policy) Received: from [140.211.166.113] (HELO eris.apache.org) (140.211.166.113) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 31 Jul 2006 09:29:10 -0700 Received: by eris.apache.org (Postfix, from userid 65534) id B75431A981A; Mon, 31 Jul 2006 09:28:49 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r427156 [1/5] - in /directory/branches/apacheds/1.0: benchmarks/ benchmarks/src/ benchmarks/src/main/ benchmarks/src/main/java/ benchmarks/src/main/java/org/ benchmarks/src/main/java/org/apache/ benchmarks/src/main/java/org/apache/directory... Date: Mon, 31 Jul 2006 16:28:07 -0000 To: commits@directory.apache.org From: akarasulu@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20060731162849.B75431A981A@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org X-Spam-Rating: minotaur.apache.org 1.6.2 0/1000/N Author: akarasulu Date: Mon Jul 31 09:27:52 2006 New Revision: 427156 URL: http://svn.apache.org/viewvc?rev=427156&view=rev Log: Merging back changes from the optimization branch into the 1.0 apacheds branch. Here's the svn command used for the merge: svn merge -r 414085:427153 \ https://svn.apache.org/repos/asf/directory/branches/apacheds/optimization . Added: directory/branches/apacheds/1.0/benchmarks/ (props changed) - copied from r427153, directory/branches/apacheds/optimization/benchmarks/ directory/branches/apacheds/1.0/benchmarks/pom.xml - copied unchanged from r427153, directory/branches/apacheds/optimization/benchmarks/pom.xml directory/branches/apacheds/1.0/benchmarks/src/ - copied from r427153, directory/branches/apacheds/optimization/benchmarks/src/ directory/branches/apacheds/1.0/benchmarks/src/main/ - copied from r427153, directory/branches/apacheds/optimization/benchmarks/src/main/ directory/branches/apacheds/1.0/benchmarks/src/main/java/ - copied from r427153, directory/branches/apacheds/optimization/benchmarks/src/main/java/ directory/branches/apacheds/1.0/benchmarks/src/main/java/org/ - copied from r427153, directory/branches/apacheds/optimization/benchmarks/src/main/java/org/ directory/branches/apacheds/1.0/benchmarks/src/main/java/org/apache/ - copied from r427153, directory/branches/apacheds/optimization/benchmarks/src/main/java/org/apache/ directory/branches/apacheds/1.0/benchmarks/src/main/java/org/apache/directory/ - copied from r427153, directory/branches/apacheds/optimization/benchmarks/src/main/java/org/apache/directory/ directory/branches/apacheds/1.0/benchmarks/src/main/java/org/apache/directory/server/ - copied from r427153, directory/branches/apacheds/optimization/benchmarks/src/main/java/org/apache/directory/server/ directory/branches/apacheds/1.0/benchmarks/src/main/java/org/apache/directory/server/benchmarks/ - copied from r427153, directory/branches/apacheds/optimization/benchmarks/src/main/java/org/apache/directory/server/benchmarks/ directory/branches/apacheds/1.0/benchmarks/src/main/java/org/apache/directory/server/benchmarks/BindBenchmark.java - copied unchanged from r427153, directory/branches/apacheds/optimization/benchmarks/src/main/java/org/apache/directory/server/benchmarks/BindBenchmark.java directory/branches/apacheds/1.0/benchmarks/src/main/java/org/apache/directory/server/benchmarks/BogusBenchmark.java - copied unchanged from r427153, directory/branches/apacheds/optimization/benchmarks/src/main/java/org/apache/directory/server/benchmarks/BogusBenchmark.java directory/branches/apacheds/1.0/benchmarks/src/test/ - copied from r427153, directory/branches/apacheds/optimization/benchmarks/src/test/ directory/branches/apacheds/1.0/benchmarks/src/test/java/ - copied from r427153, directory/branches/apacheds/optimization/benchmarks/src/test/java/ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/configuration/AddPartitionConfiguration.java - copied unchanged from r427153, directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/configuration/AddPartitionConfiguration.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/configuration/MutablePartitionConfiguration.java - copied unchanged from r427153, directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/configuration/MutablePartitionConfiguration.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/configuration/PartitionConfiguration.java - copied unchanged from r427153, directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/configuration/PartitionConfiguration.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/configuration/RemovePartitionConfiguration.java - copied unchanged from r427153, directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/configuration/RemovePartitionConfiguration.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/jndi/PropertyKeys.java - copied unchanged from r427153, directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/jndi/PropertyKeys.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java - copied unchanged from r427153, directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/AbstractPartition.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java - copied unchanged from r427153, directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/DefaultPartitionNexus.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/Partition.java - copied unchanged from r427153, directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/Partition.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java - copied unchanged from r427153, directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexus.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java - copied unchanged from r427153, directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/PartitionNexusProxy.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java - copied unchanged from r427153, directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartition.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartitionConfiguration.java - copied unchanged from r427153, directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreePartitionConfiguration.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexConfiguration.java - copied unchanged from r427153, directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/IndexConfiguration.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/MutableBTreePartitionConfiguration.java - copied unchanged from r427153, directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/MutableBTreePartitionConfiguration.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/MutableIndexConfiguration.java - copied unchanged from r427153, directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/MutableIndexConfiguration.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/NoOpOptimizer.java - copied unchanged from r427153, directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/NoOpOptimizer.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/AttributeSerializer.java - copied unchanged from r427153, directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/AttributeSerializer.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/AttributesSerializer.java - copied unchanged from r427153, directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/AttributesSerializer.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/BigIntegerSerializer.java - copied unchanged from r427153, directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/BigIntegerSerializer.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java - copied unchanged from r427153, directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmPartition.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/StringSerializer.java - copied unchanged from r427153, directory/branches/apacheds/optimization/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/StringSerializer.java directory/branches/apacheds/1.0/core/src/test/java/org/apache/directory/server/core/partition/ - copied from r427153, directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/partition/ directory/branches/apacheds/1.0/core/src/test/java/org/apache/directory/server/core/partition/impl/ - copied from r427153, directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/partition/impl/ directory/branches/apacheds/1.0/core/src/test/java/org/apache/directory/server/core/partition/impl/btree/ - copied from r427153, directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/partition/impl/btree/ directory/branches/apacheds/1.0/core/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ - copied from r427153, directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/ directory/branches/apacheds/1.0/core/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/AttributeSerializerTest.java - copied unchanged from r427153, directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/AttributeSerializerTest.java directory/branches/apacheds/1.0/core/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/AttributesSerializerTest.java - copied unchanged from r427153, directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/AttributesSerializerTest.java directory/branches/apacheds/1.0/core/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/StringSerializerTest.java - copied unchanged from r427153, directory/branches/apacheds/optimization/core/src/test/java/org/apache/directory/server/core/partition/impl/btree/jdbm/StringSerializerTest.java directory/branches/apacheds/1.0/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/LdapMessageHandler.java - copied unchanged from r427153, directory/branches/apacheds/optimization/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/LdapMessageHandler.java directory/branches/apacheds/1.0/server-installers/src/main/java/Dummy.java - copied unchanged from r427153, directory/branches/apacheds/optimization/server-installers/src/main/java/Dummy.java Removed: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/configuration/AddDirectoryPartitionConfiguration.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/configuration/DirectoryPartitionConfiguration.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/configuration/MutableDirectoryPartitionConfiguration.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/configuration/RemoveDirectoryPartitionConfiguration.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/AbstractDirectoryPartition.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/DefaultDirectoryPartitionNexus.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartition.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexus.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/DirectoryPartitionNexusProxy.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeDirectoryPartition.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmDirectoryPartition.java Modified: directory/branches/apacheds/1.0/core-unit/src/main/java/org/apache/directory/server/core/unit/AbstractPerformanceTest.java directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationITest.java directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/authz/AbstractAuthorizationITest.java directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/configuration/DirectoryPartitionConfigurationITest.java directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/jndi/MixedCaseITest.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryServiceConfiguration.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/DirectoryService.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/DirectoryServiceConfiguration.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/AnonymousAuthenticator.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationService.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/Authenticator.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/LdapPrincipal.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authz/AuthorizationService.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authz/DefaultAuthorizationService.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authz/GroupCache.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authz/TupleCache.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authz/support/ACDFEngine.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authz/support/ACITupleFilter.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authz/support/HighestPrecedenceFilter.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authz/support/MaxImmSubFilter.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authz/support/MaxValueCountFilter.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authz/support/MicroOperationFilter.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificProtectedItemFilter.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authz/support/MostSpecificUserClassFilter.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedProtectedItemFilter.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authz/support/RelatedUserClassFilter.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authz/support/RestrictedByFilter.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/collective/CollectiveAttributeService.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/configuration/MutableStartupConfiguration.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/configuration/StartupConfiguration.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/enumeration/ReferralHandlingEnumeration.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/enumeration/SearchResultFilteringEnumeration.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/event/EventService.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/exception/ExceptionService.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/interceptor/BaseInterceptor.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/interceptor/Interceptor.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/interceptor/InterceptorChain.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/interceptor/NextInterceptor.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/invocation/Invocation.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/jndi/AbstractContextFactory.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/jndi/LdapJndiProperties.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/jndi/ServerContext.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/jndi/ServerDirContext.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/normalization/NormalizationService.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/operational/OperationalAttributeService.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/BTreeSearchResultEnumeration.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultOptimizer.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/DefaultSearchEngine.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEnumerator.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ExpressionEvaluator.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/LeafEvaluator.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ScopeEnumerator.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/ScopeEvaluator.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEnumerator.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/SubstringEvaluator.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/EntryNode.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/IndexDialog.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionFrame.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/gui/PartitionViewer.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmIndex.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/partition/impl/btree/jdbm/JdbmTable.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/referral/ReferralService.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/schema/DnComparator.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/schema/DnNormalizer.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/schema/GlobalOidRegistry.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/schema/SchemaService.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/schema/bootstrap/BootstrapOidRegistry.java directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/subtree/SubentryService.java directory/branches/apacheds/1.0/core/src/main/schema/system.schema directory/branches/apacheds/1.0/core/src/test/java/org/apache/directory/server/core/authz/support/MaxImmSubFilterTest.java directory/branches/apacheds/1.0/core/src/test/java/org/apache/directory/server/core/interceptor/InterceptorChainTest.java directory/branches/apacheds/1.0/core/src/test/java/org/apache/directory/server/core/jndi/RootDSETest.java directory/branches/apacheds/1.0/core/src/test/java/org/apache/directory/server/core/prefs/PreferencesUtilsTest.java directory/branches/apacheds/1.0/protocol-ldap/src/main/java/org/apache/directory/server/ldap/LdapProtocolProvider.java directory/branches/apacheds/1.0/protocol-ldap/src/main/java/org/apache/directory/server/ldap/SessionRegistry.java directory/branches/apacheds/1.0/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/OutstandingRequestsDialog.java directory/branches/apacheds/1.0/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/OutstandingRequestsModel.java directory/branches/apacheds/1.0/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/SessionsFrame.java directory/branches/apacheds/1.0/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/SessionsModel.java directory/branches/apacheds/1.0/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/ShutdownDialog.java directory/branches/apacheds/1.0/protocol-ldap/src/main/java/org/apache/directory/server/ldap/gui/ShutdownProgress.java directory/branches/apacheds/1.0/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/AbandonHandler.java directory/branches/apacheds/1.0/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/AddHandler.java directory/branches/apacheds/1.0/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/BindHandler.java directory/branches/apacheds/1.0/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/CompareHandler.java directory/branches/apacheds/1.0/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/DeleteHandler.java directory/branches/apacheds/1.0/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ExtendedHandler.java directory/branches/apacheds/1.0/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyDnHandler.java directory/branches/apacheds/1.0/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/ModifyHandler.java directory/branches/apacheds/1.0/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/PersistentSearchListener.java directory/branches/apacheds/1.0/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchHandler.java directory/branches/apacheds/1.0/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/SearchResponseIterator.java directory/branches/apacheds/1.0/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/UnbindHandler.java directory/branches/apacheds/1.0/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/GracefulShutdownHandler.java directory/branches/apacheds/1.0/protocol-ldap/src/main/java/org/apache/directory/server/ldap/support/extended/LaunchDiagnosticUiHandler.java directory/branches/apacheds/1.0/protocol-ldap/src/test/java/org/apache/directory/server/ldap/LdapProtocolProviderTest.java directory/branches/apacheds/1.0/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/AbstractBackingStoreTest.java directory/branches/apacheds/1.0/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/store/Krb5KdcEntryFilter.java directory/branches/apacheds/1.0/protocol-shared/src/main/java/org/apache/directory/server/protocol/shared/store/LdifLoadFilter.java directory/branches/apacheds/1.0/server-installers/README.txt directory/branches/apacheds/1.0/server-installers/pom.xml directory/branches/apacheds/1.0/server-installers/src/main/installers/server.xml directory/branches/apacheds/1.0/server-jndi/src/main/java/org/apache/directory/server/configuration/MutableServerStartupConfiguration.java directory/branches/apacheds/1.0/server-jndi/src/main/java/org/apache/directory/server/configuration/ServerStartupConfiguration.java directory/branches/apacheds/1.0/server-jndi/src/main/java/org/apache/directory/server/jndi/ServerContextFactory.java directory/branches/apacheds/1.0/server-main/pom.xml directory/branches/apacheds/1.0/server-main/server.xml directory/branches/apacheds/1.0/server-main/src/main/java/org/apache/directory/server/Service.java directory/branches/apacheds/1.0/server-sar/src/main/java/org/apache/directory/server/sar/DirectoryService.java directory/branches/apacheds/1.0/server-tools/src/main/java/org/apache/directory/server/tools/ApachedsTools.java directory/branches/apacheds/1.0/server-tools/src/main/java/org/apache/directory/server/tools/DumpCommand.java directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/BadDnTest.java directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/MatchingRuleCompareTest.java directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/MiscTest.java directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/ModifyAddTest.java directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/ModifyRemoveTest.java directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/PersistentSearchTest.java directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/SearchTest.java directory/branches/apacheds/1.0/server-unit/src/test/java/org/apache/directory/server/jndi/ServerContextFactoryTest.java Propchange: directory/branches/apacheds/1.0/benchmarks/ ------------------------------------------------------------------------------ --- svn:ignore (added) +++ svn:ignore Mon Jul 31 09:27:52 2006 @@ -0,0 +1,13 @@ +*.iws +*.ipr +*.iml +.wtpmodules +.settings +.deployables +.classpath +.project +*.iml +*.log +target +nbproject + Modified: directory/branches/apacheds/1.0/core-unit/src/main/java/org/apache/directory/server/core/unit/AbstractPerformanceTest.java URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core-unit/src/main/java/org/apache/directory/server/core/unit/AbstractPerformanceTest.java?rev=427156&r1=427155&r2=427156&view=diff ============================================================================== --- directory/branches/apacheds/1.0/core-unit/src/main/java/org/apache/directory/server/core/unit/AbstractPerformanceTest.java (original) +++ directory/branches/apacheds/1.0/core-unit/src/main/java/org/apache/directory/server/core/unit/AbstractPerformanceTest.java Mon Jul 31 09:27:52 2006 @@ -34,8 +34,8 @@ import javax.naming.ldap.InitialLdapContext; import javax.naming.ldap.LdapContext; -import org.apache.directory.server.core.configuration.MutableDirectoryPartitionConfiguration; -import org.apache.directory.server.core.partition.DirectoryPartitionNexus; +import org.apache.directory.server.core.configuration.MutablePartitionConfiguration; +import org.apache.directory.server.core.partition.PartitionNexus; import org.apache.directory.shared.ldap.ldif.Entry; import org.apache.directory.shared.ldap.ldif.LdifReader; import org.apache.directory.shared.ldap.name.LdapDN; @@ -111,7 +111,7 @@ */ protected AbstractPerformanceTest( Class subclass ) throws IOException { - super( DirectoryPartitionNexus.ADMIN_PRINCIPAL, "secret" ); + super( PartitionNexus.ADMIN_PRINCIPAL, "secret" ); this.subclass = subclass; // Setup the statistics output writer @@ -144,7 +144,7 @@ attributes.put( "ou", "test" ); // Add apache.org paritition since all work will be done here - MutableDirectoryPartitionConfiguration partConfig = new MutableDirectoryPartitionConfiguration(); + MutablePartitionConfiguration partConfig = new MutablePartitionConfiguration(); partConfig.setIndexedAttributes( indexedAttributes ); partConfig.setName( "test" ); partConfig.setSuffix( "ou=test" ); Modified: directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationITest.java URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationITest.java?rev=427156&r1=427155&r2=427156&view=diff ============================================================================== --- directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationITest.java (original) +++ directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/authn/SimpleAuthenticationITest.java Mon Jul 31 09:27:52 2006 @@ -29,11 +29,13 @@ import javax.naming.directory.Attributes; import javax.naming.directory.DirContext; import javax.naming.directory.InitialDirContext; +import javax.naming.directory.ModificationItem; import javax.naming.ldap.InitialLdapContext; import org.apache.directory.server.core.unit.AbstractAdminTestCase; import org.apache.directory.shared.ldap.exception.LdapConfigurationException; import org.apache.directory.shared.ldap.exception.LdapNoPermissionException; +import org.apache.directory.shared.ldap.message.LockableAttributeImpl; import org.apache.directory.shared.ldap.util.ArrayUtils; @@ -308,5 +310,80 @@ env.put( Context.SECURITY_AUTHENTICATION, "simple" ); env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.directory.server.core.jndi.CoreContextFactory" ); assertNotNull( new InitialContext( env ) ); + } + + + public void test11InvalidateCredentialCache() throws NamingException + { + Hashtable env = new Hashtable( configuration.toJndiEnvironment() ); + env.put( Context.PROVIDER_URL, "ou=system" ); + env.put( Context.SECURITY_PRINCIPAL, "uid=akarasulu,ou=users,ou=system" ); + env.put( Context.SECURITY_CREDENTIALS, "test" ); + env.put( Context.SECURITY_AUTHENTICATION, "simple" ); + env.put( Context.INITIAL_CONTEXT_FACTORY, "org.apache.directory.server.core.jndi.CoreContextFactory" ); + InitialDirContext ic = new InitialDirContext( env ); + Attributes attrs = ic.getAttributes( "uid=akarasulu,ou=users" ); + Attribute ou = attrs.get( "ou" ); + assertTrue( ou.contains( "Engineering" ) ); + assertTrue( ou.contains( "People" ) ); + + Attribute objectClass = attrs.get( "objectClass" ); + assertTrue( objectClass.contains( "top" ) ); + assertTrue( objectClass.contains( "person" ) ); + assertTrue( objectClass.contains( "organizationalPerson" ) ); + assertTrue( objectClass.contains( "inetOrgPerson" ) ); + + assertTrue( attrs.get( "telephonenumber" ).contains( "+1 408 555 4798" ) ); + assertTrue( attrs.get( "uid" ).contains( "akarasulu" ) ); + assertTrue( attrs.get( "givenname" ).contains( "Alex" ) ); + assertTrue( attrs.get( "mail" ).contains( "akarasulu@apache.org" ) ); + assertTrue( attrs.get( "l" ).contains( "Bogusville" ) ); + assertTrue( attrs.get( "sn" ).contains( "Karasulu" ) ); + assertTrue( attrs.get( "cn" ).contains( "Alex Karasulu" ) ); + assertTrue( attrs.get( "facsimiletelephonenumber" ).contains( "+1 408 555 9751" ) ); + assertTrue( attrs.get( "roomnumber" ).contains( "4612" ) ); + + // now modify the password for akarasulu + LockableAttributeImpl userPasswordAttribute = new LockableAttributeImpl( "userPassword", "newpwd" ); + ic.modifyAttributes( "uid=akarasulu,ou=users", new ModificationItem[] { + new ModificationItem( DirContext.REPLACE_ATTRIBUTE, userPasswordAttribute ) } ); + + // close and try with old password (should fail) + ic.close(); + env.put( Context.SECURITY_CREDENTIALS, "test" ); + try + { + ic = new InitialDirContext( env ); + fail( "Authentication with old password should fail" ); + } + catch ( NamingException e ) + { + // we should fail + } + + // close and try again now with new password (should fail) + ic.close(); + env.put( Context.SECURITY_CREDENTIALS, "newpwd" ); + ic = new InitialDirContext( env ); + attrs = ic.getAttributes( "uid=akarasulu,ou=users" ); + ou = attrs.get( "ou" ); + assertTrue( ou.contains( "Engineering" ) ); + assertTrue( ou.contains( "People" ) ); + + objectClass = attrs.get( "objectClass" ); + assertTrue( objectClass.contains( "top" ) ); + assertTrue( objectClass.contains( "person" ) ); + assertTrue( objectClass.contains( "organizationalPerson" ) ); + assertTrue( objectClass.contains( "inetOrgPerson" ) ); + + assertTrue( attrs.get( "telephonenumber" ).contains( "+1 408 555 4798" ) ); + assertTrue( attrs.get( "uid" ).contains( "akarasulu" ) ); + assertTrue( attrs.get( "givenname" ).contains( "Alex" ) ); + assertTrue( attrs.get( "mail" ).contains( "akarasulu@apache.org" ) ); + assertTrue( attrs.get( "l" ).contains( "Bogusville" ) ); + assertTrue( attrs.get( "sn" ).contains( "Karasulu" ) ); + assertTrue( attrs.get( "cn" ).contains( "Alex Karasulu" ) ); + assertTrue( attrs.get( "facsimiletelephonenumber" ).contains( "+1 408 555 9751" ) ); + assertTrue( attrs.get( "roomnumber" ).contains( "4612" ) ); } } Modified: directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/authz/AbstractAuthorizationITest.java URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/authz/AbstractAuthorizationITest.java?rev=427156&r1=427155&r2=427156&view=diff ============================================================================== --- directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/authz/AbstractAuthorizationITest.java (original) +++ directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/authz/AbstractAuthorizationITest.java Mon Jul 31 09:27:52 2006 @@ -17,7 +17,7 @@ package org.apache.directory.server.core.authz; -import org.apache.directory.server.core.partition.DirectoryPartitionNexus; +import org.apache.directory.server.core.partition.PartitionNexus; import org.apache.directory.server.core.subtree.SubentryService; import org.apache.directory.server.core.unit.AbstractTestCase; import org.apache.directory.shared.ldap.name.LdapDN; @@ -47,7 +47,7 @@ */ public AbstractAuthorizationITest() { - super( DirectoryPartitionNexus.ADMIN_PRINCIPAL, "secret" ); + super( PartitionNexus.ADMIN_PRINCIPAL, "secret" ); super.configuration.setAccessControlEnabled( true ); } @@ -64,7 +64,7 @@ */ public DirContext getContextAsAdmin() throws NamingException { - return getContextAsAdmin( DirectoryPartitionNexus.SYSTEM_PARTITION_SUFFIX ); + return getContextAsAdmin( PartitionNexus.SYSTEM_PARTITION_SUFFIX ); } @@ -82,7 +82,7 @@ Hashtable env = ( Hashtable ) sysRoot.getEnvironment().clone(); env.put( DirContext.PROVIDER_URL, dn ); env.put( DirContext.SECURITY_AUTHENTICATION, "simple" ); - env.put( DirContext.SECURITY_PRINCIPAL, DirectoryPartitionNexus.ADMIN_PRINCIPAL ); + env.put( DirContext.SECURITY_PRINCIPAL, PartitionNexus.ADMIN_PRINCIPAL ); env.put( DirContext.SECURITY_CREDENTIALS, "secret" ); return new InitialDirContext( env ); } @@ -195,7 +195,7 @@ */ public DirContext getContextAs( Name user, String password ) throws NamingException { - return getContextAs( user, password, DirectoryPartitionNexus.SYSTEM_PARTITION_SUFFIX ); + return getContextAs( user, password, PartitionNexus.SYSTEM_PARTITION_SUFFIX ); } Modified: directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/configuration/DirectoryPartitionConfigurationITest.java URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/configuration/DirectoryPartitionConfigurationITest.java?rev=427156&r1=427155&r2=427156&view=diff ============================================================================== --- directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/configuration/DirectoryPartitionConfigurationITest.java (original) +++ directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/configuration/DirectoryPartitionConfigurationITest.java Mon Jul 31 09:27:52 2006 @@ -27,17 +27,17 @@ import junit.framework.Assert; -import org.apache.directory.server.core.configuration.AddDirectoryPartitionConfiguration; -import org.apache.directory.server.core.configuration.MutableDirectoryPartitionConfiguration; -import org.apache.directory.server.core.configuration.RemoveDirectoryPartitionConfiguration; +import org.apache.directory.server.core.configuration.AddPartitionConfiguration; +import org.apache.directory.server.core.configuration.MutablePartitionConfiguration; +import org.apache.directory.server.core.configuration.RemovePartitionConfiguration; import org.apache.directory.server.core.jndi.CoreContextFactory; -import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmDirectoryPartition; +import org.apache.directory.server.core.partition.impl.btree.jdbm.JdbmPartition; import org.apache.directory.server.core.unit.AbstractAdminTestCase; /** - * Tests {@link AddDirectoryPartitionConfiguration} and - * {@link RemoveDirectoryPartitionConfiguration} works correctly. + * Tests {@link AddPartitionConfiguration} and + * {@link RemovePartitionConfiguration} works correctly. * * @author Apache Directory Project * @version $Rev$ @@ -51,17 +51,17 @@ public void testAddAndRemove() throws Exception { - MutableDirectoryPartitionConfiguration partitionCfg = new MutableDirectoryPartitionConfiguration(); + MutablePartitionConfiguration partitionCfg = new MutablePartitionConfiguration(); partitionCfg.setName( "removable" ); partitionCfg.setSuffix( "ou=removable" ); Attributes ctxEntry = new BasicAttributes( true ); ctxEntry.put( "objectClass", "top" ); ctxEntry.put( "ou", "removable" ); partitionCfg.setContextEntry( ctxEntry ); - partitionCfg.setContextPartition( new JdbmDirectoryPartition() ); + partitionCfg.setContextPartition( new JdbmPartition() ); // Test AddContextPartition - AddDirectoryPartitionConfiguration addCfg = new AddDirectoryPartitionConfiguration( partitionCfg ); + AddPartitionConfiguration addCfg = new AddPartitionConfiguration( partitionCfg ); Hashtable env = new Hashtable(); env.put( Context.INITIAL_CONTEXT_FACTORY, CoreContextFactory.class.getName() ); @@ -71,7 +71,7 @@ Assert.assertNotNull( ctx.lookup( "ou=removable" ) ); // Test removeContextPartition - RemoveDirectoryPartitionConfiguration removeCfg = new RemoveDirectoryPartitionConfiguration( "ou=removable" ); + RemovePartitionConfiguration removeCfg = new RemovePartitionConfiguration( "ou=removable" ); env.putAll( removeCfg.toJndiEnvironment() ); ctx = new InitialContext( env ); Modified: directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/jndi/MixedCaseITest.java URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/jndi/MixedCaseITest.java?rev=427156&r1=427155&r2=427156&view=diff ============================================================================== --- directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/jndi/MixedCaseITest.java (original) +++ directory/branches/apacheds/1.0/core-unit/src/test/java/org/apache/directory/server/core/jndi/MixedCaseITest.java Mon Jul 31 09:27:52 2006 @@ -22,7 +22,7 @@ import javax.naming.NamingEnumeration; import javax.naming.directory.*; -import org.apache.directory.server.core.configuration.MutableDirectoryPartitionConfiguration; +import org.apache.directory.server.core.configuration.MutablePartitionConfiguration; import org.apache.directory.server.core.unit.AbstractAdminTestCase; import org.apache.directory.shared.ldap.exception.LdapNameNotFoundException; @@ -44,7 +44,7 @@ public void setUp() throws Exception { - MutableDirectoryPartitionConfiguration partition = new MutableDirectoryPartitionConfiguration(); + MutablePartitionConfiguration partition = new MutablePartitionConfiguration(); partition.setName( "apache" ); partition.setSuffix( suffix ); Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java?rev=427156&r1=427155&r2=427156&view=diff ============================================================================== --- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java (original) +++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryService.java Mon Jul 31 09:27:52 2006 @@ -19,6 +19,7 @@ import java.util.Hashtable; import java.util.Iterator; +import java.util.Map; import java.util.Set; import java.util.HashSet; @@ -34,9 +35,10 @@ import org.apache.directory.server.core.interceptor.InterceptorChain; import org.apache.directory.server.core.jndi.AbstractContextFactory; import org.apache.directory.server.core.jndi.DeadContext; +import org.apache.directory.server.core.jndi.PropertyKeys; import org.apache.directory.server.core.jndi.ServerLdapContext; -import org.apache.directory.server.core.partition.DefaultDirectoryPartitionNexus; -import org.apache.directory.server.core.partition.DirectoryPartitionNexus; +import org.apache.directory.server.core.partition.DefaultPartitionNexus; +import org.apache.directory.server.core.partition.PartitionNexus; import org.apache.directory.server.core.schema.AttributeTypeRegistry; import org.apache.directory.server.core.schema.GlobalRegistries; import org.apache.directory.server.core.schema.bootstrap.BootstrapRegistries; @@ -83,7 +85,7 @@ private GlobalRegistries globalRegistries; /** the root nexus */ - private DefaultDirectoryPartitionNexus partitionNexus; + private DefaultPartitionNexus partitionNexus; /** whether or not server is started for the first time */ private boolean firstStart; @@ -118,12 +120,12 @@ public Context getJndiContext( String rootDN ) throws NamingException { - return this.getJndiContext( null, null, "none", rootDN ); + return this.getJndiContext( null, null, null, "none", rootDN ); } - public synchronized Context getJndiContext( String principal, byte[] credential, String authentication, - String rootDN ) throws NamingException + public synchronized Context getJndiContext( LdapDN principalDn, String principal, byte[] credential, + String authentication, String rootDN ) throws NamingException { checkSecuritySettings( principal, credential, authentication ); @@ -157,7 +159,11 @@ rootDN = ""; } environment.put( Context.PROVIDER_URL, rootDN ); - + + if ( principalDn != null ) + { + environment.put( PropertyKeys.PARSED_BIND_DN, principalDn ); + } return new ServerLdapContext( this, environment ); } @@ -310,7 +316,7 @@ } - public DirectoryPartitionNexus getPartitionNexus() + public PartitionNexus getPartitionNexus() { return partitionNexus; } @@ -419,7 +425,7 @@ /* * If the admin entry is there, then the database was already created */ - if ( !partitionNexus.hasEntry( DirectoryPartitionNexus.getAdminName() ) ) + if ( !partitionNexus.hasEntry( PartitionNexus.getAdminName() ) ) { firstStart = true; @@ -431,16 +437,16 @@ objectClass.add( "inetOrgPerson" ); attributes.put( objectClass ); - attributes.put( "uid", DirectoryPartitionNexus.ADMIN_UID ); - attributes.put( "userPassword", DirectoryPartitionNexus.ADMIN_PASSWORD ); + attributes.put( "uid", PartitionNexus.ADMIN_UID ); + attributes.put( "userPassword", PartitionNexus.ADMIN_PASSWORD ); attributes.put( "displayName", "Directory Superuser" ); attributes.put( "cn", "system administrator" ); attributes.put( "sn", "administrator" ); - attributes.put( "creatorsName", DirectoryPartitionNexus.ADMIN_PRINCIPAL ); + attributes.put( "creatorsName", PartitionNexus.ADMIN_PRINCIPAL ); attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() ); attributes.put( "displayName", "Directory Superuser" ); - partitionNexus.add(DirectoryPartitionNexus.getAdminName(), + partitionNexus.add(PartitionNexus.getAdminName(), attributes ); } @@ -448,8 +454,9 @@ // create system users area // ------------------------------------------------------------------- + Map oidsMap = configuration.getGlobalRegistries().getAttributeTypeRegistry().getNormalizerMapping(); LdapDN userDn = new LdapDN( "ou=users,ou=system" ); - userDn.normalize(); + userDn.normalize( oidsMap ); if ( !partitionNexus.hasEntry( userDn ) ) { @@ -462,7 +469,7 @@ attributes.put( objectClass ); attributes.put( "ou", "users" ); - attributes.put( "creatorsName", DirectoryPartitionNexus.ADMIN_PRINCIPAL ); + attributes.put( "creatorsName", PartitionNexus.ADMIN_PRINCIPAL ); attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() ); partitionNexus.add( userDn, attributes ); @@ -473,7 +480,7 @@ // ------------------------------------------------------------------- LdapDN groupDn = new LdapDN( "ou=groups,ou=system" ); - groupDn.normalize(); + groupDn.normalize( oidsMap ); if ( !partitionNexus.hasEntry( groupDn ) ) { @@ -486,7 +493,7 @@ attributes.put( objectClass ); attributes.put( "ou", "groups" ); - attributes.put( "creatorsName", DirectoryPartitionNexus.ADMIN_PRINCIPAL ); + attributes.put( "creatorsName", PartitionNexus.ADMIN_PRINCIPAL ); attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() ); partitionNexus.add( groupDn, attributes ); @@ -498,7 +505,7 @@ String upName = "cn=Administrators,ou=groups,ou=system"; LdapDN normName = new LdapDN( "cn=administrators,ou=groups,ou=system" ); - normName.normalize(); + normName.normalize( oidsMap ); if ( !partitionNexus.hasEntry( normName ) ) { @@ -510,8 +517,8 @@ objectClass.add( "groupOfUniqueNames" ); attributes.put( objectClass ); attributes.put( "cn", "Administrators" ); - attributes.put( "uniqueMember", DirectoryPartitionNexus.ADMIN_PRINCIPAL ); - attributes.put( "creatorsName", DirectoryPartitionNexus.ADMIN_PRINCIPAL ); + attributes.put( "uniqueMember", PartitionNexus.ADMIN_PRINCIPAL ); + attributes.put( "creatorsName", PartitionNexus.ADMIN_PRINCIPAL ); attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() ); partitionNexus.add(normName, attributes ); @@ -524,7 +531,7 @@ // ------------------------------------------------------------------- LdapDN configurationDn = new LdapDN( "ou=configuration,ou=system" ); - configurationDn.normalize(); + configurationDn.normalize( oidsMap ); if ( !partitionNexus.hasEntry( configurationDn ) ) { @@ -537,7 +544,7 @@ attributes.put( objectClass ); attributes.put( "ou", "configuration" ); - attributes.put( "creatorsName", DirectoryPartitionNexus.ADMIN_PRINCIPAL ); + attributes.put( "creatorsName", PartitionNexus.ADMIN_PRINCIPAL ); attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() ); partitionNexus.add( configurationDn, attributes ); @@ -548,7 +555,7 @@ // ------------------------------------------------------------------- LdapDN partitionsDn = new LdapDN( "ou=partitions,ou=configuration,ou=system" ); - partitionsDn.normalize(); + partitionsDn.normalize( oidsMap ); if ( !partitionNexus.hasEntry( partitionsDn ) ) { @@ -561,7 +568,7 @@ attributes.put( objectClass ); attributes.put( "ou", "partitions" ); - attributes.put( "creatorsName", DirectoryPartitionNexus.ADMIN_PRINCIPAL ); + attributes.put( "creatorsName", PartitionNexus.ADMIN_PRINCIPAL ); attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() ); partitionNexus.add( partitionsDn, attributes ); @@ -572,7 +579,7 @@ // ------------------------------------------------------------------- LdapDN servicesDn = new LdapDN( "ou=services,ou=configuration,ou=system" ); - servicesDn.normalize(); + servicesDn.normalize( oidsMap ); if ( !partitionNexus.hasEntry( servicesDn ) ) { @@ -585,7 +592,7 @@ attributes.put( objectClass ); attributes.put( "ou", "services" ); - attributes.put( "creatorsName", DirectoryPartitionNexus.ADMIN_PRINCIPAL ); + attributes.put( "creatorsName", PartitionNexus.ADMIN_PRINCIPAL ); attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() ); partitionNexus.add( servicesDn, attributes ); @@ -596,7 +603,7 @@ // ------------------------------------------------------------------- LdapDN interceptorsDn = new LdapDN( "ou=interceptors,ou=configuration,ou=system" ); - interceptorsDn.normalize(); + interceptorsDn.normalize( oidsMap ); if ( !partitionNexus.hasEntry( interceptorsDn ) ) { @@ -609,7 +616,7 @@ attributes.put( objectClass ); attributes.put( "ou", "interceptors" ); - attributes.put( "creatorsName", DirectoryPartitionNexus.ADMIN_PRINCIPAL ); + attributes.put( "creatorsName", PartitionNexus.ADMIN_PRINCIPAL ); attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() ); partitionNexus.add( interceptorsDn, attributes ); @@ -620,7 +627,7 @@ // ------------------------------------------------------------------- LdapDN sysPrefRootDn = new LdapDN( "prefNodeName=sysPrefRoot,ou=system"); - sysPrefRootDn.normalize(); + sysPrefRootDn.normalize( oidsMap ); if ( !partitionNexus.hasEntry( sysPrefRootDn ) ) { @@ -634,7 +641,7 @@ attributes.put( "objectClass", "extensibleObject" ); attributes.put( "prefNodeName", "sysPrefRoot" ); - attributes.put( "creatorsName", DirectoryPartitionNexus.ADMIN_PRINCIPAL ); + attributes.put( "creatorsName", PartitionNexus.ADMIN_PRINCIPAL ); attributes.put( "createTimestamp", DateUtils.getGeneralizedTime() ); partitionNexus.add( sysPrefRootDn, attributes ); @@ -652,19 +659,19 @@ // Warn if the default password is not changed. boolean needToChangeAdminPassword = false; - LdapDN adminDn = new LdapDN( DirectoryPartitionNexus.ADMIN_PRINCIPAL ); - adminDn.normalize(); + LdapDN adminDn = new LdapDN( PartitionNexus.ADMIN_PRINCIPAL ); + adminDn.normalize( configuration.getGlobalRegistries().getAttributeTypeRegistry().getNormalizerMapping() ); Attributes adminEntry = partitionNexus.lookup( adminDn ); Object userPassword = adminEntry.get( "userPassword" ).get(); if ( userPassword instanceof byte[] ) { - needToChangeAdminPassword = DirectoryPartitionNexus.ADMIN_PASSWORD.equals( new String( + needToChangeAdminPassword = PartitionNexus.ADMIN_PASSWORD.equals( new String( ( byte[] ) userPassword ) ); } - else if ( userPassword.toString().equals( DirectoryPartitionNexus.ADMIN_PASSWORD ) ) + else if ( userPassword.toString().equals( PartitionNexus.ADMIN_PASSWORD ) ) { - needToChangeAdminPassword = DirectoryPartitionNexus.ADMIN_PASSWORD.equals( userPassword.toString() ); + needToChangeAdminPassword = PartitionNexus.ADMIN_PASSWORD.equals( userPassword.toString() ); } if ( needToChangeAdminPassword ) @@ -680,7 +687,10 @@ String principal = AbstractContextFactory.getPrincipal( env ); byte[] credential = AbstractContextFactory.getCredential( env ); String authentication = AbstractContextFactory.getAuthentication( env ); - ServerLdapContext ctx = ( ServerLdapContext ) getJndiContext( principal, credential, authentication, "" ); + + LdapDN principalDn = ( LdapDN ) env.get( PropertyKeys.PARSED_BIND_DN ); + ServerLdapContext ctx = ( ServerLdapContext ) + getJndiContext( principalDn, principal, credential, authentication, "" ); Iterator i = startupConfiguration.getTestEntries().iterator(); while ( i.hasNext() ) @@ -802,7 +812,7 @@ log.debug( "binary ids used: " + binaries ); } - partitionNexus = new DefaultDirectoryPartitionNexus( new LockableAttributesImpl() ); + partitionNexus = new DefaultPartitionNexus( new LockableAttributesImpl() ); partitionNexus.init( configuration, null ); interceptorChain = new InterceptorChain(); Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryServiceConfiguration.java URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryServiceConfiguration.java?rev=427156&r1=427155&r2=427156&view=diff ============================================================================== --- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryServiceConfiguration.java (original) +++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/DefaultDirectoryServiceConfiguration.java Mon Jul 31 09:27:52 2006 @@ -24,8 +24,9 @@ import org.apache.directory.server.core.configuration.StartupConfiguration; import org.apache.directory.server.core.interceptor.InterceptorChain; -import org.apache.directory.server.core.partition.DirectoryPartitionNexus; +import org.apache.directory.server.core.partition.PartitionNexus; import org.apache.directory.server.core.schema.GlobalRegistries; +import org.apache.directory.shared.ldap.name.LdapDN; /** @@ -81,7 +82,7 @@ } - public DirectoryPartitionNexus getPartitionNexus() + public PartitionNexus getPartitionNexus() { return parent.getPartitionNexus(); } @@ -105,9 +106,9 @@ } - public Context getJndiContext( String principal, byte[] credential, String authentication, String baseName ) - throws NamingException + public Context getJndiContext( LdapDN principalDn, String principal, byte[] credential, + String authentication, String baseName ) throws NamingException { - return parent.getJndiContext( principal, credential, authentication, baseName ); + return parent.getJndiContext( principalDn, principal, credential, authentication, baseName ); } } Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/DirectoryService.java URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/DirectoryService.java?rev=427156&r1=427155&r2=427156&view=diff ============================================================================== --- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/DirectoryService.java (original) +++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/DirectoryService.java Mon Jul 31 09:27:52 2006 @@ -29,7 +29,8 @@ import org.apache.directory.server.core.configuration.Configuration; import org.apache.directory.server.core.jndi.AbstractContextFactory; -import org.apache.directory.server.core.partition.DirectoryPartition; +import org.apache.directory.server.core.partition.Partition; +import org.apache.directory.shared.ldap.name.LdapDN; /** @@ -99,7 +100,7 @@ /** - * Calls {@link DirectoryPartition#sync()} for all registered {@link DirectoryPartition}s. + * Calls {@link Partition#sync()} for all registered {@link Partition}s. * @throws NamingException if synchronization failed */ public abstract void sync() throws NamingException; @@ -134,6 +135,6 @@ * @param authentication {@link Context#SECURITY_AUTHENTICATION} value * @throws NamingException if failed to create a context */ - public abstract Context getJndiContext( String principal, byte[] credential, String authentication, String baseName ) - throws NamingException; + public abstract Context getJndiContext( LdapDN principalDn, String principal, byte[] credential, + String authentication, String baseName ) throws NamingException; } Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/DirectoryServiceConfiguration.java URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/DirectoryServiceConfiguration.java?rev=427156&r1=427155&r2=427156&view=diff ============================================================================== --- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/DirectoryServiceConfiguration.java (original) +++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/DirectoryServiceConfiguration.java Mon Jul 31 09:27:52 2006 @@ -23,7 +23,7 @@ import org.apache.directory.server.core.configuration.StartupConfiguration; import org.apache.directory.server.core.interceptor.InterceptorChain; -import org.apache.directory.server.core.partition.DirectoryPartitionNexus; +import org.apache.directory.server.core.partition.PartitionNexus; import org.apache.directory.server.core.schema.GlobalRegistries; @@ -73,10 +73,10 @@ /** - * Returns the {@link DirectoryPartitionNexus} of the {@link DirectoryService} + * Returns the {@link PartitionNexus} of the {@link DirectoryService} * which bypasses the interceptor chain. */ - DirectoryPartitionNexus getPartitionNexus(); + PartitionNexus getPartitionNexus(); /** Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java?rev=427156&r1=427155&r2=427156&view=diff ============================================================================== --- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java (original) +++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/AbstractAuthenticator.java Mon Jul 31 09:27:52 2006 @@ -127,8 +127,16 @@ } - public abstract LdapPrincipal authenticate( ServerContext ctx ) throws NamingException; + public abstract LdapPrincipal authenticate( LdapDN bindDn, ServerContext ctx ) throws NamingException; + + /** + * Does nothing leaving it so subclasses can override. + */ + public void invalidateCache( LdapDN bindDn ) + { + } + /** * Returns a new {@link LdapPrincipal} instance whose value is the specified Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/AnonymousAuthenticator.java URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/AnonymousAuthenticator.java?rev=427156&r1=427155&r2=427156&view=diff ============================================================================== --- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/AnonymousAuthenticator.java (original) +++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/AnonymousAuthenticator.java Mon Jul 31 09:27:52 2006 @@ -21,6 +21,7 @@ import org.apache.directory.server.core.jndi.ServerContext; import org.apache.directory.shared.ldap.exception.LdapNoPermissionException; +import org.apache.directory.shared.ldap.name.LdapDN; /** @@ -44,7 +45,7 @@ * If the context is not configured to allow anonymous connections, * this method throws a {@link javax.naming.NoPermissionException}. */ - public LdapPrincipal authenticate( ServerContext ctx ) throws NamingException + public LdapPrincipal authenticate( LdapDN bindDn, ServerContext ctx ) throws NamingException { if ( getFactoryConfiguration().getStartupConfiguration().isAllowAnonymousAccess() ) { Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationService.java URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationService.java?rev=427156&r1=427155&r2=427156&view=diff ============================================================================== --- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationService.java (original) +++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/AuthenticationService.java Mon Jul 31 09:27:52 2006 @@ -60,13 +60,15 @@ public class AuthenticationService extends BaseInterceptor { private static final Logger log = LoggerFactory.getLogger( AuthenticationService.class ); + + /** Speedup for logs */ + private static final boolean IS_DEBUG = log.isDebugEnabled(); /** authenticators **/ public Map authenticators = new HashMap(); private DirectoryServiceConfiguration factoryCfg; - /** * Creates an authentication service interceptor. */ @@ -184,10 +186,10 @@ public void add( NextInterceptor next, LdapDN normName, Attributes entry ) throws NamingException { - if ( log.isDebugEnabled() ) + if ( IS_DEBUG ) { log.debug( "Adding the entry " + AttributeUtils.toString( entry ) + " for DN = '" - + normName.toUpName() + "'" ); + + normName.getUpName() + "'" ); } checkAuthenticated(); @@ -197,19 +199,20 @@ public void delete( NextInterceptor next, LdapDN name ) throws NamingException { - if ( log.isDebugEnabled() ) + if ( IS_DEBUG ) { log.debug( "Deleting name = '" + name.toString() + "'" ); } checkAuthenticated(); next.delete( name ); + invalidateAuthenticatorCaches( name ); } public LdapDN getMatchedName ( NextInterceptor next, LdapDN dn ) throws NamingException { - if ( log.isDebugEnabled() ) + if ( IS_DEBUG ) { log.debug( "Matching name = '" + dn.toString() + "'" ); } @@ -221,7 +224,7 @@ public Attributes getRootDSE( NextInterceptor next ) throws NamingException { - if ( log.isDebugEnabled() ) + if ( IS_DEBUG ) { log.debug( "Getting root DSE" ); } @@ -233,7 +236,7 @@ public LdapDN getSuffix ( NextInterceptor next, LdapDN dn ) throws NamingException { - if ( log.isDebugEnabled() ) + if ( IS_DEBUG ) { log.debug( "Getting suffix for name = '" + dn.toString() + "'" ); } @@ -245,7 +248,7 @@ public boolean hasEntry( NextInterceptor next, LdapDN name ) throws NamingException { - if ( log.isDebugEnabled() ) + if ( IS_DEBUG ) { log.debug( "Testing if entry name = '" + name.toString() + "' exists" ); } @@ -257,7 +260,7 @@ public boolean isSuffix( NextInterceptor next, LdapDN name ) throws NamingException { - if ( log.isDebugEnabled() ) + if ( IS_DEBUG ) { log.debug( "Testing suffix for name = '" + name.toString() + "'" ); } @@ -269,7 +272,7 @@ public NamingEnumeration list( NextInterceptor next, LdapDN base ) throws NamingException { - if ( log.isDebugEnabled() ) + if ( IS_DEBUG ) { log.debug( "Listing base = '" + base.toString() + "'" ); } @@ -281,7 +284,7 @@ public Iterator listSuffixes ( NextInterceptor next ) throws NamingException { - if ( log.isDebugEnabled() ) + if ( IS_DEBUG ) { log.debug( "Listing suffixes" ); } @@ -293,7 +296,7 @@ public Attributes lookup( NextInterceptor next, LdapDN dn, String[] attrIds ) throws NamingException { - if ( log.isDebugEnabled() ) + if ( IS_DEBUG ) { log.debug( "Lookup name = '" + dn.toString() + "', attributes = " + attrIds ); } @@ -305,7 +308,7 @@ public Attributes lookup( NextInterceptor next, LdapDN name ) throws NamingException { - if ( log.isDebugEnabled() ) + if ( IS_DEBUG ) { log.debug( "Lookup name = '" + name.toString() + "'" ); } @@ -315,33 +318,53 @@ } + private void invalidateAuthenticatorCaches( LdapDN principalDn ) + { + for ( Iterator jj = this.authenticators.keySet().iterator(); jj.hasNext(); /**/ ) + { + String authMech = ( String ) jj.next(); + + Collection authenticators = getAuthenticators( authMech ); + + // try each authenticator + for ( Iterator ii = authenticators.iterator(); ii.hasNext(); /**/ ) + { + Authenticator authenticator = ( Authenticator ) ii.next(); + authenticator.invalidateCache( getPrincipal().getJndiName() ); + } + } + } + + public void modify( NextInterceptor next, LdapDN name, int modOp, Attributes mods ) throws NamingException { - if ( log.isDebugEnabled() ) + if ( IS_DEBUG ) { log.debug( "Modifying name = '" + name.toString() + "', modifs = " + AttributeUtils.toString( mods ) ); } checkAuthenticated(); next.modify( name, modOp, mods ); + invalidateAuthenticatorCaches( name ); } - + public void modify( NextInterceptor next, LdapDN name, ModificationItem[] mods ) throws NamingException { - if ( log.isDebugEnabled() ) + if ( IS_DEBUG ) { log.debug( "Modifying name = '" + name.toString() + "'" ); } checkAuthenticated(); next.modify( name, mods ); + invalidateAuthenticatorCaches( name ); } public void modifyRn( NextInterceptor next, LdapDN name, String newRn, boolean deleteOldRn ) throws NamingException { - if ( log.isDebugEnabled() ) + if ( IS_DEBUG ) { log.debug( "Modifying name = '" + name.toString() + "', new RDN = '" + newRn + "', oldRDN = '" + deleteOldRn + "'" ); @@ -349,13 +372,14 @@ checkAuthenticated(); next.modifyRn( name, newRn, deleteOldRn ); + invalidateAuthenticatorCaches( name ); } public void move( NextInterceptor next, LdapDN oriChildName, LdapDN newParentName, String newRn, boolean deleteOldRn ) throws NamingException { - if ( log.isDebugEnabled() ) + if ( IS_DEBUG ) { log.debug( "Moving name = '" + oriChildName.toString() + "' to name = '" + newParentName + "', new RDN = '" + newRn + "', oldRDN = '" + deleteOldRn + "'" ); @@ -363,25 +387,27 @@ checkAuthenticated(); next.move( oriChildName, newParentName, newRn, deleteOldRn ); + invalidateAuthenticatorCaches( oriChildName ); } public void move( NextInterceptor next, LdapDN oriChildName, LdapDN newParentName ) throws NamingException { - if ( log.isDebugEnabled() ) + if ( IS_DEBUG ) { log.debug( "Moving name = '" + oriChildName.toString() + " to name = '" + newParentName + "'" ); } checkAuthenticated(); next.move( oriChildName, newParentName ); + invalidateAuthenticatorCaches( oriChildName ); } public NamingEnumeration search( NextInterceptor next, LdapDN base, Map env, ExprNode filter, SearchControls searchCtls ) throws NamingException { - if ( log.isDebugEnabled() ) + if ( IS_DEBUG ) { log.debug( "Search for base = '" + base.toString() + "'" ); } @@ -450,6 +476,7 @@ return; } + // TODO : we should refactor that. // try each authenticators for ( Iterator i = authenticators.iterator(); i.hasNext(); ) { @@ -457,7 +484,7 @@ try { // perform the authentication - LdapPrincipal authorizationId = authenticator.authenticate( ctx ); + LdapPrincipal authorizationId = authenticator.authenticate( bindDn, ctx ); // authentication was successful ctx.setPrincipal( new TrustedPrincipalWrapper( authorizationId ) ); // remove creds so there is no security risk Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/Authenticator.java URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/Authenticator.java?rev=427156&r1=427155&r2=427156&view=diff ============================================================================== --- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/Authenticator.java (original) +++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/Authenticator.java Mon Jul 31 09:27:52 2006 @@ -23,11 +23,12 @@ import org.apache.directory.server.core.DirectoryServiceConfiguration; import org.apache.directory.server.core.configuration.AuthenticatorConfiguration; import org.apache.directory.server.core.jndi.ServerContext; -import org.apache.directory.server.core.partition.DirectoryPartitionNexus; +import org.apache.directory.server.core.partition.PartitionNexus; +import org.apache.directory.shared.ldap.name.LdapDN; /** - * Authenticates users who access {@link DirectoryPartitionNexus}. + * Authenticates users who access {@link PartitionNexus}. *

* {@link Authenticator}s are registered to and configured by * {@link AuthenticationService} interceptor. @@ -64,9 +65,18 @@ */ public void destroy(); + /** + * Callback used to respond to password changes by invalidating a password + * cache if implemented. This is an additional feature of an authenticator + * which need not be implemented: empty implementation is sufficient. This + * is called on every del, modify, and modifyRdn operation. + * + * @param bindDn the already normalized distinguished name of the bind principal + */ + public void invalidateCache( LdapDN bindDn ); /** * Performs authentication and returns the principal if succeeded. */ - public LdapPrincipal authenticate( ServerContext ctx ) throws NamingException; + public LdapPrincipal authenticate( LdapDN bindDn, ServerContext ctx ) throws NamingException; } Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/LdapPrincipal.java URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/LdapPrincipal.java?rev=427156&r1=427155&r2=427156&view=diff ============================================================================== --- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/LdapPrincipal.java (original) +++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/LdapPrincipal.java Mon Jul 31 09:27:52 2006 @@ -55,7 +55,7 @@ * @param name the normalized distinguished name of the principal * @param authenticationLevel */ - LdapPrincipal(Name name, AuthenticationLevel authenticationLevel) + LdapPrincipal( Name name, AuthenticationLevel authenticationLevel ) { this.name = name; this.authenticationLevel = authenticationLevel; @@ -79,9 +79,9 @@ * * @return the normalized distinguished name of the principal as a JNDI {@link Name} */ - public Name getJndiName() + public LdapDN getJndiName() { - return ( Name ) name.clone(); + return ( LdapDN ) name.clone(); } Modified: directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java URL: http://svn.apache.org/viewvc/directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java?rev=427156&r1=427155&r2=427156&view=diff ============================================================================== --- directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java (original) +++ directory/branches/apacheds/1.0/core/src/main/java/org/apache/directory/server/core/authn/SimpleAuthenticator.java Mon Jul 31 09:27:52 2006 @@ -23,6 +23,7 @@ import java.util.Collections; import java.util.HashSet; import java.util.Set; +import java.util.WeakHashMap; import javax.naming.Context; import javax.naming.NamingException; @@ -32,12 +33,13 @@ import org.apache.directory.server.core.invocation.Invocation; import org.apache.directory.server.core.invocation.InvocationStack; import org.apache.directory.server.core.jndi.ServerContext; -import org.apache.directory.server.core.partition.DirectoryPartitionNexusProxy; +import org.apache.directory.server.core.partition.PartitionNexusProxy; import org.apache.directory.shared.ldap.aci.AuthenticationLevel; import org.apache.directory.shared.ldap.exception.LdapAuthenticationException; import org.apache.directory.shared.ldap.name.LdapDN; import org.apache.directory.shared.ldap.util.ArrayUtils; import org.apache.directory.shared.ldap.util.Base64; +import org.apache.directory.shared.ldap.util.StringTools; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -54,12 +56,15 @@ public class SimpleAuthenticator extends AbstractAuthenticator { private static final Logger log = LoggerFactory.getLogger( SimpleAuthenticator.class ); - private static final Collection USERLOOKUP_BYPASS; + private WeakHashMap credentialCache = new WeakHashMap( 1000 ); + static { Set c = new HashSet(); + c.add( "normalizationService" ); + c.add( "collectiveAttributeService" ); c.add( "authenticationService" ); c.add( "authorizationService" ); c.add( "defaultAuthorizationService" ); @@ -79,13 +84,13 @@ super( "simple" ); } - + /** * Looks up userPassword attribute of the entry whose name is the * value of {@link Context#SECURITY_PRINCIPAL} environment variable, and * authenticates a user with the plain-text password. */ - public LdapPrincipal authenticate( ServerContext ctx ) throws NamingException + public LdapPrincipal authenticate( LdapDN principalDn, ServerContext ctx ) throws NamingException { // ---- extract password from JNDI environment @@ -100,29 +105,64 @@ creds = ( ( String ) creds ).getBytes(); } - // ---- extract principal from JNDI environment - - String principal; - - if ( !ctx.getEnvironment().containsKey( Context.SECURITY_PRINCIPAL ) ) + byte[] userPassword = null; + if ( credentialCache.containsKey( principalDn.getNormName() ) ) { - throw new LdapAuthenticationException(); + userPassword = ( byte[] ) credentialCache.get( principalDn.getNormName() ); } else { - principal = ( String ) ctx.getEnvironment().get( Context.SECURITY_PRINCIPAL ); + userPassword = lookupUserPassword( principalDn ); + } - if ( principal == null ) + boolean credentialsMatch = false; + + // Check if password is stored as a message digest, i.e. one-way + // encrypted + if ( this.isPasswordOneWayEncrypted( userPassword ) ) + { + try { - throw new LdapAuthenticationException(); + // create a corresponding digested password from creds + String algorithm = this.getAlgorithmForHashedPassword( userPassword ); + String digestedCredits = this.createDigestedPassword( algorithm, creds ); + + credentialsMatch = ArrayUtils.isEquals( digestedCredits.getBytes(), userPassword ); } + catch ( NoSuchAlgorithmException nsae ) + { + log.warn( "Password stored with unknown algorithm.", nsae ); + } + catch ( IllegalArgumentException e ) + { + log.warn( "Exception during authentication", e ); + } + } + else + { + // password is not stored one-way encrypted + credentialsMatch = ArrayUtils.isEquals( creds, userPassword ); } + if ( credentialsMatch ) + { + LdapPrincipal principal = new LdapPrincipal( principalDn, AuthenticationLevel.SIMPLE ); + credentialCache.put( principalDn.getNormName(), userPassword ); + return principal; + } + else + { + throw new LdapAuthenticationException(); + } + } + + + protected byte[] lookupUserPassword( LdapDN principalDn ) throws NamingException + { // ---- lookup the principal entry's userPassword attribute - LdapDN principalDn = new LdapDN( principal ); Invocation invocation = InvocationStack.getInstance().peek(); - DirectoryPartitionNexusProxy proxy = invocation.getProxy(); + PartitionNexusProxy proxy = invocation.getProxy(); Attributes userEntry; try @@ -132,7 +172,7 @@ if ( userEntry == null ) { - throw new LdapAuthenticationException( "Failed to lookup user for authentication: " + principal ); + throw new LdapAuthenticationException( "Failed to lookup user for authentication: " + principalDn ); } } catch ( Exception cause ) @@ -149,8 +189,6 @@ // ---- assert that credentials match - boolean credentialsMatch = false; - if ( userPasswordAttr == null ) { userPassword = ArrayUtils.EMPTY_BYTE_ARRAY; @@ -161,45 +199,11 @@ if ( userPassword instanceof String ) { - userPassword = ( ( String ) userPassword ).getBytes(); - } - } - - // Check if password is stored as a message digest, i.e. one-way - // encrypted - if ( this.isPasswordOneWayEncrypted( userPassword ) ) - { - try - { - // create a corresponding digested password from creds - String algorithm = this.getAlgorithmForHashedPassword( userPassword ); - String digestedCredits = this.createDigestedPassword( algorithm, creds ); - - credentialsMatch = ArrayUtils.isEquals( digestedCredits.getBytes(), userPassword ); - } - catch ( NoSuchAlgorithmException nsae ) - { - log.warn( "Password stored with unknown algorithm.", nsae ); - } - catch ( IllegalArgumentException e ) - { - log.warn( "Exception during authentication", e ); + userPassword = StringTools.getBytesUtf8( ( String ) userPassword ); } } - else - { - // password is not stored one-way encrypted - credentialsMatch = ArrayUtils.isEquals( creds, userPassword ); - } - - if ( credentialsMatch ) - { - return new LdapPrincipal( principalDn, AuthenticationLevel.SIMPLE ); - } - else - { - throw new LdapAuthenticationException(); - } + + return ( byte[] ) userPassword; } @@ -338,5 +342,11 @@ result.append( encoded ); return result.toString(); + } + + + public void invalidateCache( LdapDN bindDn ) + { + credentialCache.remove( bindDn.getNormName() ); } }