From 39ee9286999c0faf5e78ab2a68d69d10c7600ff9 Mon Sep 17 00:00:00 2001
From: neil_a_wilson <neil_a_wilson@localhost>
Date: Sun, 26 Aug 2007 00:14:04 +0000
Subject: [PATCH] Update configuration definitions to make a few different types of changes:

---
 opends/src/server/org/opends/server/extensions/ExternalSASLMechanismHandler.java |   52 ++++++++--------------------------------------------
 1 files changed, 8 insertions(+), 44 deletions(-)

diff --git a/opends/src/server/org/opends/server/extensions/ExternalSASLMechanismHandler.java b/opends/src/server/org/opends/server/extensions/ExternalSASLMechanismHandler.java
index 826e558..d166374 100644
--- a/opends/src/server/org/opends/server/extensions/ExternalSASLMechanismHandler.java
+++ b/opends/src/server/org/opends/server/extensions/ExternalSASLMechanismHandler.java
@@ -143,18 +143,12 @@
 
     // Get the attribute type to use for validating the certificates.  If none
     // is provided, then default to the userCertificate type.
-    String attrTypeName = configuration.getCertificateAttribute();
-    if (attrTypeName == null)
-    {
-      attrTypeName = DEFAULT_VALIDATION_CERT_ATTRIBUTE;
-    }
-    certificateAttributeType =
-         DirectoryServer.getAttributeType(toLowerCase(attrTypeName), false);
+    certificateAttributeType = configuration.getCertificateAttribute();
     if (certificateAttributeType == null)
     {
-      Message message = ERR_SASLEXTERNAL_UNKNOWN_CERT_ATTR.get(
-          String.valueOf(attrTypeName), String.valueOf(configEntryDN));
-      throw new ConfigException(message);
+      certificateAttributeType =
+           DirectoryServer.getAttributeType(DEFAULT_VALIDATION_CERT_ATTRIBUTE,
+                                            true);
     }
 
 
@@ -478,24 +472,6 @@
     boolean configAcceptable = true;
     DN cfgEntryDN = configuration.dn();
 
-    // Get the attribute type to use for validating the certificates.  If none
-    // is provided, then default to the userCertificate type.
-    String attrTypeName = configuration.getCertificateAttribute();
-    if (attrTypeName != null)
-    {
-      attrTypeName = DEFAULT_VALIDATION_CERT_ATTRIBUTE;
-    }
-    AttributeType newCertificateType =
-         DirectoryServer.getAttributeType(toLowerCase(attrTypeName), false);
-    if (newCertificateType == null)
-    {
-      unacceptableReasons.add(ERR_SASLEXTERNAL_UNKNOWN_CERT_ATTR.get(
-              String.valueOf(attrTypeName),
-              String.valueOf(cfgEntryDN)));
-      configAcceptable = false;
-    }
-
-
     // Make sure that the configured certificate mapper is valid.
     CertificateMapper certificateMapper =
          DirectoryServer.getCertificateMapper(
@@ -545,24 +521,12 @@
 
     // Get the attribute type to use for validating the certificates.  If none
     // is provided, then default to the userCertificate type.
-    String attrTypeName = configuration.getCertificateAttribute();
-    if (attrTypeName == null)
-    {
-      attrTypeName = DEFAULT_VALIDATION_CERT_ATTRIBUTE;
-    }
-    AttributeType newCertificateType =
-         DirectoryServer.getAttributeType(toLowerCase(attrTypeName), false);
+    AttributeType newCertificateType = configuration.getCertificateAttribute();
     if (newCertificateType == null)
     {
-      if (resultCode == ResultCode.SUCCESS)
-      {
-        resultCode = ResultCode.NO_SUCH_ATTRIBUTE;
-      }
-
-
-      messages.add(ERR_SASLEXTERNAL_UNKNOWN_CERT_ATTR.get(
-              String.valueOf(attrTypeName),
-              String.valueOf(configEntryDN)));
+      newCertificateType =
+           DirectoryServer.getAttributeType(DEFAULT_VALIDATION_CERT_ATTRIBUTE,
+                                            true);
     }
 
 

--
Gitblit v1.10.0