handavid commented on code in PR #1504:
URL: https://github.com/apache/knox/pull/1504#discussion_r4594780139


##########
gateway-server/src/main/java/org/apache/knox/gateway/services/ldap/KnoxLDAPServerManager.java:
##########
@@ -527,10 +528,11 @@ private void createBaseEntriesForDn(SchemaManager 
schemaManager, String dn) thro
         if (!directoryService.getAdminSession().exists(baseDnName)) {
             Entry baseDnEntry = new DefaultEntry(schemaManager);
             baseDnEntry.setDn(baseDnName);
-            baseDnEntry.add("objectClass", "top", "domain");
-            // Extract dc value from baseDn (e.g., "dc=proxy,dc=com" -> 
"proxy")
-            String dcValue = dn.split(",")[0].split("=")[1];
-            baseDnEntry.add("dc", dcValue);
+            String type = baseDnName.getRdn().getType();
+            String name = baseDnName.getRdn().getName();
+            String objectClass = getConventionalObjectClassFromType(type);
+            baseDnEntry.add("objectClass", "top", objectClass, 
"extensibleObject");
+            baseDnEntry.add(type, name);

Review Comment:
   you are correct! I've removed the unnecessary add since the rdn will be 
added automatically.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to