You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@syncope.apache.org by an...@apache.org on 2019/11/29 18:09:31 UTC

[syncope] branch master updated: now transformed connObjectKey is taken into account while pulling

This is an automated email from the ASF dual-hosted git repository.

andreapatricelli pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/syncope.git


The following commit(s) were added to refs/heads/master by this push:
     new 5c6c6d2  now transformed connObjectKey is taken into account while pulling
5c6c6d2 is described below

commit 5c6c6d22847ec2c95169632ff8138f5749cdf34a
Author: Andrea Patricelli <an...@apache.org>
AuthorDate: Fri Nov 29 19:09:15 2019 +0100

    now transformed connObjectKey is taken into account while pulling
---
 .../provisioning/java/pushpull/InboundMatcher.java  | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

diff --git a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/InboundMatcher.java b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/InboundMatcher.java
index 870f47d..bb7c880 100644
--- a/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/InboundMatcher.java
+++ b/core/provisioning-java/src/main/java/org/apache/syncope/core/provisioning/java/pushpull/InboundMatcher.java
@@ -235,17 +235,17 @@ public class InboundMatcher {
         if (intAttrName.getField() != null) {
             switch (intAttrName.getField()) {
                 case "key":
-                    Optional.ofNullable(anyUtils.dao().find(connObjectKeyValue)).ifPresent(anys::add);
+                    Optional.ofNullable(anyUtils.dao().find(finalConnObjectKeyValue)).ifPresent(anys::add);
                     break;
 
                 case "username":
                     if (anyTypeKind == AnyTypeKind.USER && ignoreCaseMatch) {
                         AnyCond cond = new AnyCond(AttributeCond.Type.IEQ);
                         cond.setSchema("username");
-                        cond.setExpression(connObjectKeyValue);
+                        cond.setExpression(finalConnObjectKeyValue);
                         anys.addAll(searchDAO.search(SearchCond.getLeafCond(cond), AnyTypeKind.USER));
                     } else {
-                        Optional.ofNullable(userDAO.findByUsername(connObjectKeyValue)).ifPresent(anys::add);
+                        Optional.ofNullable(userDAO.findByUsername(finalConnObjectKeyValue)).ifPresent(anys::add);
                     }
                     break;
 
@@ -253,19 +253,19 @@ public class InboundMatcher {
                     if (anyTypeKind == AnyTypeKind.GROUP && ignoreCaseMatch) {
                         AnyCond cond = new AnyCond(AttributeCond.Type.IEQ);
                         cond.setSchema("name");
-                        cond.setExpression(connObjectKeyValue);
+                        cond.setExpression(finalConnObjectKeyValue);
                         anys.addAll(searchDAO.search(SearchCond.getLeafCond(cond), AnyTypeKind.GROUP));
                     } else {
-                        Optional.ofNullable(groupDAO.findByName(connObjectKeyValue)).ifPresent(anys::add);
+                        Optional.ofNullable(groupDAO.findByName(finalConnObjectKeyValue)).ifPresent(anys::add);
                     }
 
                     if (anyTypeKind == AnyTypeKind.ANY_OBJECT && ignoreCaseMatch) {
                         AnyCond cond = new AnyCond(AttributeCond.Type.IEQ);
                         cond.setSchema("name");
-                        cond.setExpression(connObjectKeyValue);
+                        cond.setExpression(finalConnObjectKeyValue);
                         anys.addAll(searchDAO.search(SearchCond.getLeafCond(cond), AnyTypeKind.ANY_OBJECT));
                     } else {
-                        Optional.ofNullable(anyObjectDAO.findByName(connObjectKeyValue)).ifPresent(anys::add);
+                        Optional.ofNullable(anyObjectDAO.findByName(finalConnObjectKeyValue)).ifPresent(anys::add);
                     }
                     break;
 
@@ -278,10 +278,10 @@ public class InboundMatcher {
                             ? anyUtils.newPlainAttrUniqueValue()
                             : anyUtils.newPlainAttrValue();
                     try {
-                        value.parseValue((PlainSchema) intAttrName.getSchema(), connObjectKeyValue);
+                        value.parseValue((PlainSchema) intAttrName.getSchema(), finalConnObjectKeyValue);
                     } catch (ParsingValidationException e) {
                         LOG.error("While parsing provided {} {}", Uid.NAME, value, e);
-                        value.setStringValue(connObjectKeyValue);
+                        value.setStringValue(finalConnObjectKeyValue);
                     }
 
                     if (intAttrName.getSchema().isUniqueConstraint()) {
@@ -296,7 +296,7 @@ public class InboundMatcher {
 
                 case DERIVED:
                     anys.addAll(anyUtils.dao().findByDerAttrValue((DerSchema) intAttrName.getSchema(),
-                            connObjectKeyValue, ignoreCaseMatch));
+                            finalConnObjectKeyValue, ignoreCaseMatch));
                     break;
 
                 default:
@@ -459,3 +459,4 @@ public class InboundMatcher {
         return result;
     }
 }
+