mirror of https://github.com/OpenIdentityPlatform/OpenDJ.git

Nicolas Capponi
16.27.2016 86115f857f2a72cc6ee2e6cc8b630cae0437da59
OPENDJ-3089 OPENDJ-1237 Add missing options to CoreSchemaProvider and CoreSchemaConfiguration.xml
4 files modified
100 ■■■■■ changed files
opendj-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/CoreSchemaConfiguration.xml 84 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/core/CoreConfigManager.java 3 ●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/core/DirectoryServer.java 3 ●●●●● patch | view | raw | blame | history
opendj-server-legacy/src/main/java/org/opends/server/schema/CoreSchemaProvider.java 10 ●●●● patch | view | raw | blame | history
opendj-maven-plugin/src/main/resources/config/xml/org/forgerock/opendj/server/config/CoreSchemaConfiguration.xml
@@ -176,4 +176,88 @@
      </ldap:attribute>
    </adm:profile>
  </adm:property>
    <adm:property name="strict-format-jpeg-photos" advanced="true">
    <adm:synopsis>
      Indicates whether to require JPEG values to strictly
      comply with the standard definition for this syntax.
    </adm:synopsis>
    <adm:default-behavior>
      <adm:defined>
        <adm:value>false</adm:value>
      </adm:defined>
    </adm:default-behavior>
    <adm:syntax>
      <adm:boolean />
    </adm:syntax>
    <adm:profile name="ldap">
      <ldap:attribute>
        <ldap:name>ds-cfg-strict-format-jpeg-photos</ldap:name>
      </ldap:attribute>
    </adm:profile>
  </adm:property>
    <adm:property name="strict-format-certificates" advanced="true">
    <adm:synopsis>
      Indicates whether X.509 Certificate values are required to
      strictly comply with the standard definition for this syntax.
    </adm:synopsis>
    <adm:description>
      When set to false, certificates will not be validated and, as a result
      any sequence of bytes will be acceptable.
    </adm:description>
    <adm:default-behavior>
      <adm:defined>
        <adm:value>true</adm:value>
      </adm:defined>
    </adm:default-behavior>
    <adm:syntax>
      <adm:boolean />
    </adm:syntax>
    <adm:profile name="ldap">
      <ldap:attribute>
        <ldap:name>ds-cfg-strict-format-certificates</ldap:name>
      </ldap:attribute>
    </adm:profile>
  </adm:property>
    <adm:property name="strict-format-telephone-numbers" advanced="true">
    <adm:synopsis>
      Indicates whether to require telephone number values to strictly
      comply with the standard definition for this syntax.
    </adm:synopsis>
    <adm:default-behavior>
      <adm:defined>
        <adm:value>false</adm:value>
      </adm:defined>
    </adm:default-behavior>
    <adm:syntax>
      <adm:boolean />
    </adm:syntax>
    <adm:profile name="ldap">
      <ldap:attribute>
        <ldap:name>ds-cfg-strict-format-telephone-numbers</ldap:name>
      </ldap:attribute>
    </adm:profile>
  </adm:property>
  <adm:property name="allow-attribute-types-with-no-sup-or-syntax" advanced="true">
    <adm:synopsis>
      Indicates whether the schema should allow attribute type definitions
      that do not declare a superior attribute type or syntax
    </adm:synopsis>
    <adm:description>
      When set to true, invalid attribute type definitions will
      use the default syntax.
    </adm:description>
    <adm:default-behavior>
      <adm:defined>
        <adm:value>true</adm:value>
      </adm:defined>
    </adm:default-behavior>
    <adm:syntax>
      <adm:boolean />
    </adm:syntax>
    <adm:profile name="ldap">
      <ldap:attribute>
        <ldap:name>ds-cfg-allow-attribute-types-with-no-sup-or-syntax</ldap:name>
      </ldap:attribute>
    </adm:profile>
  </adm:property>
</adm:managed-object>
opendj-server-legacy/src/main/java/org/opends/server/core/CoreConfigManager.java
@@ -23,6 +23,7 @@
import org.forgerock.opendj.config.server.ConfigException;
import org.forgerock.opendj.ldap.DN;
import org.forgerock.opendj.ldap.ResultCode;
import org.forgerock.opendj.ldap.schema.SchemaOptions;
import org.forgerock.opendj.config.server.ConfigurationChangeListener;
import org.forgerock.opendj.server.config.meta.GlobalCfgDefn;
import org.forgerock.opendj.server.config.meta.GlobalCfgDefn.DisabledPrivilege;
@@ -142,7 +143,7 @@
      commonAudit.setTrustTransactionIds(globalConfig.isTrustTransactionIds());
    }
    // Update the "new" schema with configuration changes if necessary
    // Update the schema with configuration changes if necessary
    try
    {
      final boolean allowMalformedNames = globalConfig.isAllowAttributeNameExceptions();
opendj-server-legacy/src/main/java/org/opends/server/core/DirectoryServer.java
@@ -3365,7 +3365,10 @@
   *
   * @return  <CODE>true</CODE> if the server should use a more flexible
   *          syntax for attribute names, or <CODE>false</CODE> if not.
   * @deprecated The schema option SchemaOptions.ALLOW_MALFORMED_NAMES_AND_OPTIONS from the
   *  schema should be used instead
   */
  @Deprecated
  public static boolean allowAttributeNameExceptions()
  {
    return directoryServer.allowAttributeNameExceptions;
opendj-server-legacy/src/main/java/org/opends/server/schema/CoreSchemaProvider.java
@@ -67,11 +67,11 @@
      .setOption(ALLOW_ZERO_LENGTH_DIRECTORY_STRINGS, configuration.isAllowZeroLengthValuesDirectoryString())
      .setOption(STRICT_FORMAT_FOR_COUNTRY_STRINGS, configuration.isStrictFormatCountryString())
      .setOption(STRIP_UPPER_BOUND_FOR_ATTRIBUTE_TYPE,
          configuration.isStripSyntaxMinUpperBoundAttributeTypeDescription());
    // TODO : add the missing methods in schema builder for those properties
    // schemaBuilder.allowMalformedJPEGPhotos(configuration.)
    // schemaBuilder.allowMalformedNamesAndOptions(configuration.)
    // ...
          configuration.isStripSyntaxMinUpperBoundAttributeTypeDescription())
      .setOption(ALLOW_MALFORMED_JPEG_PHOTOS, !configuration.isStrictFormatJPEGPhotos())
      .setOption(ALLOW_MALFORMED_CERTIFICATES, !configuration.isStrictFormatCertificates())
      .setOption(ALLOW_NON_STANDARD_TELEPHONE_NUMBERS, !configuration.isStrictFormatTelephoneNumbers())
      .setOption(ALLOW_ATTRIBUTE_TYPES_WITH_NO_SUP_OR_SYNTAX, configuration.isAllowAttributeTypesWithNoSupOrSyntax());
    for (final String oid : configuration.getDisabledMatchingRule())
    {