Yair Zaslavsky has uploaded a new change for review.

Change subject: core: Split UPN in case of open ldap "get user by upn" query
......................................................................

core: Split UPN in case of open ldap "get user by upn" query

Open Ldap does not have UPN support by nature (when
installed).
In order to support the "GetUserByPrincipalName" query the
user principal name must be split to user and domain, and only
the user part should be used in the LDAP query filter.
This patch immitates RHDS behavior which handles the same issue, and uses 
existing code that
was RHDS specific (before refactor) to solve this issue
for open ldap as well

Change-Id: I1c566ac48136487f9ff4203ca0b9a4dd3bb8b37e
Bug-Url: https://bugzilla.redhat.com/991800
Signed-off-by: Yair Zaslavsky <[email protected]>
---
M 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/adbroker/LdapQueryMetadataFactoryImpl.java
R 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/adbroker/UpnLdapQueryExecutionFormatter.java
2 files changed, 4 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/31/17631/1

diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/adbroker/LdapQueryMetadataFactoryImpl.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/adbroker/LdapQueryMetadataFactoryImpl.java
index 0409bda..e895e74 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/adbroker/LdapQueryMetadataFactoryImpl.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/adbroker/LdapQueryMetadataFactoryImpl.java
@@ -321,7 +321,7 @@
                         new RHDSUserContextMapper(),
                         SearchControls.SUBTREE_SCOPE,
                         RHDSUserContextMapper.USERS_ATTRIBUTE_FILTER,
-                        new RHDSUPNLdapQueryExecutionFormatter(),
+                new UpnLdapQueryExecutionFormatter(),
                         RHDSLdapGuidEncoder.getInstance()));
         dsHashMap.put(LdapQueryType.rootDSE, new LdapQueryMetadataImpl(
                         "(objectClass=*)",
@@ -509,7 +509,7 @@
                         new OpenLdapUserContextMapper(),
                         SearchControls.SUBTREE_SCOPE,
                         OpenLdapUserContextMapper.USERS_ATTRIBUTE_FILTER,
-                        new SimpleLdapQueryExecutionFormatter(),
+                new UpnLdapQueryExecutionFormatter(),
                         new DefaultGuidEncoder()));
         openLdapHashMap.put(LdapQueryType.getUserByName, new 
LdapQueryMetadataImpl(
                         "(uid=%1$s)",
diff --git 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/adbroker/RHDSUPNLdapQueryExecutionFormatter.java
 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/adbroker/UpnLdapQueryExecutionFormatter.java
similarity index 86%
rename from 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/adbroker/RHDSUPNLdapQueryExecutionFormatter.java
rename to 
backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/adbroker/UpnLdapQueryExecutionFormatter.java
index cdb2134..7a6c789 100644
--- 
a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/adbroker/RHDSUPNLdapQueryExecutionFormatter.java
+++ 
b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/adbroker/UpnLdapQueryExecutionFormatter.java
@@ -1,9 +1,9 @@
 package org.ovirt.engine.core.bll.adbroker;
 
 /**
- * RHDS doesn't have a UPN, so this formatter practically adjusts the query to 
search by user name instead of UPN
+ * Some providers do not have UPN, so this formatter practically adjusts the 
query to search by user name instead of UPN
  */
-public class RHDSUPNLdapQueryExecutionFormatter extends 
SimpleLdapQueryExecutionFormatter {
+public class UpnLdapQueryExecutionFormatter extends 
SimpleLdapQueryExecutionFormatter {
 
     /**
      * Put the user name instead of the UPN in the filter


-- 
To view, visit http://gerrit.ovirt.org/17631
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I1c566ac48136487f9ff4203ca0b9a4dd3bb8b37e
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-engine
Gerrit-Branch: master
Gerrit-Owner: Yair Zaslavsky <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to