opendj-server-legacy/src/main/java/org/opends/server/core/SchemaHandler.java
@@ -46,7 +46,9 @@ import org.opends.server.api.AlertGenerator; import org.opends.server.replication.plugin.HistoricalCsnOrderingMatchingRuleImpl; import org.opends.server.schema.AciSyntax; import org.opends.server.schema.AuthPasswordEqualityMatchingRule; import org.opends.server.schema.SubtreeSpecificationSyntax; import org.opends.server.schema.UserPasswordEqualityMatchingRule; import org.forgerock.i18n.LocalizableMessage; import org.forgerock.i18n.slf4j.LocalizedLogger; import org.forgerock.opendj.adapter.server3x.Converters; @@ -204,10 +206,15 @@ try { // Add server specific syntaxes and matching rules not provided by the SDK // Add server specific syntaxes not provided by the SDK AciSyntax.addAciSyntax(schemaBuilder); SubtreeSpecificationSyntax.addSubtreeSpecificationSyntax(schemaBuilder); // Add server specific matching rules not provided by the SDK HistoricalCsnOrderingMatchingRuleImpl.addHistoricalCsnOrderingMatchingRule(schemaBuilder); AuthPasswordEqualityMatchingRule.addAuthPasswordEqualityMatchingRule(schemaBuilder); UserPasswordEqualityMatchingRule.addUserPasswordEqualityMatchingRule(schemaBuilder); } catch (ConflictingSchemaElementException e) { opendj-server-legacy/src/main/java/org/opends/server/schema/AuthPasswordEqualityMatchingRule.java
@@ -16,15 +16,18 @@ */ package org.opends.server.schema; import static org.opends.server.schema.SchemaConstants.*; import static org.opends.server.core.DirectoryServer.*; import org.forgerock.i18n.slf4j.LocalizedLogger; import org.forgerock.opendj.ldap.ByteSequence; import org.forgerock.opendj.ldap.ConditionResult; import org.forgerock.opendj.ldap.schema.SchemaBuilder; import org.opends.server.api.PasswordStorageScheme; /** This class implements the authPasswordMatch matching rule defined in RFC 3112. */ class AuthPasswordEqualityMatchingRule extends AbstractPasswordEqualityMatchingRuleImpl public class AuthPasswordEqualityMatchingRule extends AbstractPasswordEqualityMatchingRuleImpl { private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); @@ -55,4 +58,19 @@ return ConditionResult.valueOf(storageScheme.authPasswordMatches( assertionValue, authPWComponents[1], authPWComponents[2])); } /** * Adds the auth password equality matching rule to the provided schema builder. * * @param builder * where to add the matching rule */ public static void addAuthPasswordEqualityMatchingRule(SchemaBuilder builder) { builder.buildMatchingRule(EMR_AUTH_PASSWORD_OID) .names(EMR_AUTH_PASSWORD_NAME) .syntaxOID(SYNTAX_AUTH_PASSWORD_OID).description(EMR_AUTH_PASSWORD_DESCRIPTION) .implementation(new AuthPasswordEqualityMatchingRule()) .addToSchema(); } } opendj-server-legacy/src/main/java/org/opends/server/schema/UserPasswordEqualityMatchingRule.java
@@ -16,10 +16,13 @@ */ package org.opends.server.schema; import static org.opends.server.schema.SchemaConstants.*; import org.forgerock.i18n.slf4j.LocalizedLogger; import org.forgerock.opendj.ldap.ByteSequence; import org.forgerock.opendj.ldap.ByteString; import org.forgerock.opendj.ldap.ConditionResult; import org.forgerock.opendj.ldap.schema.SchemaBuilder; import org.opends.server.api.PasswordStorageScheme; import static org.opends.server.core.DirectoryServer.*; @@ -31,7 +34,7 @@ * This matching rule serves a similar purpose to the equivalent * AuthPasswordEqualityMatchingRule defined in RFC 3112 (http://tools.ietf.org/html/rfc3112). */ class UserPasswordEqualityMatchingRule extends AbstractPasswordEqualityMatchingRuleImpl public class UserPasswordEqualityMatchingRule extends AbstractPasswordEqualityMatchingRuleImpl { private static final LocalizedLogger logger = LocalizedLogger.getLoggerForThisClass(); @@ -66,4 +69,19 @@ storageScheme.passwordMatches(assertionValue, ByteString.valueOfUtf8(userPWComponents[1]))); } /** * Adds the user password equality matching rule to the provided schema builder. * * @param builder * where to add the matching rule */ public static void addUserPasswordEqualityMatchingRule(SchemaBuilder builder) { builder.buildMatchingRule(EMR_USER_PASSWORD_OID) .names(EMR_USER_PASSWORD_NAME) .syntaxOID(SYNTAX_OCTET_STRING_OID).description(EMR_USER_PASSWORD_DESCRIPTION) .implementation(new UserPasswordEqualityMatchingRule()) .addToSchema(); } }