From ab699353a0afa06febb55658e6d495d2cd59cdb3 Mon Sep 17 00:00:00 2001 From: TatoniMatteo Date: Fri, 11 Sep 2026 09:32:50 +0200 Subject: [PATCH 1/3] [SYNCOPE-1997] - Fix connectivity check and improve topology UI to prevent scrolling --- .../main/resources/META-INF/resources/css/topology.scss | 2 +- .../apache/syncope/client/console/topology/Topology.html | 2 +- .../java/org/apache/syncope/core/logic/ResourceLogic.java | 7 +++++-- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/client/idm/console/src/main/resources/META-INF/resources/css/topology.scss b/client/idm/console/src/main/resources/META-INF/resources/css/topology.scss index 52674d114b..de890ca91c 100644 --- a/client/idm/console/src/main/resources/META-INF/resources/css/topology.scss +++ b/client/idm/console/src/main/resources/META-INF/resources/css/topology.scss @@ -32,7 +32,7 @@ #topology { position: relative; border: 0; - height: 780px; + height: calc(100vh - 175px); overflow: hidden; cursor: grab; } diff --git a/client/idm/console/src/main/resources/org/apache/syncope/client/console/topology/Topology.html b/client/idm/console/src/main/resources/org/apache/syncope/client/console/topology/Topology.html index 17ccca0022..d2ec3c78a5 100644 --- a/client/idm/console/src/main/resources/org/apache/syncope/client/console/topology/Topology.html +++ b/client/idm/console/src/main/resources/org/apache/syncope/client/console/topology/Topology.html @@ -40,7 +40,7 @@ -
+
[Actions]
diff --git a/core/idm/logic/src/main/java/org/apache/syncope/core/logic/ResourceLogic.java b/core/idm/logic/src/main/java/org/apache/syncope/core/logic/ResourceLogic.java index c0f6177c21..3c1375534a 100644 --- a/core/idm/logic/src/main/java/org/apache/syncope/core/logic/ResourceLogic.java +++ b/core/idm/logic/src/main/java/org/apache/syncope/core/logic/ResourceLogic.java @@ -423,11 +423,14 @@ public void check(final ResourceTO resourceTO) { ConnInstance connInstance = connInstanceDAO.findById(resourceTO.getConnector()). orElseThrow(() -> new NotFoundException("Connector " + resourceTO.getConnector())); + ExternalResource externalResource = Optional.ofNullable(resourceTO.getKey()).flatMap(resourceDAO::findById). + orElseThrow(() -> new NotFoundException("Resource " + resourceTO.getKey())); + connectorManager.createConnector( connectorManager.buildConnInstanceOverride( connInstance, - resourceTO.getConfOverride(), - resourceTO.getCapabilitiesOverride())). + externalResource.getConfOverride(), + externalResource.getCapabilitiesOverride())). test(); } From 4662a7559f37e37cb5b478a904b52fb94265a41a Mon Sep 17 00:00:00 2001 From: TatoniMatteo Date: Fri, 11 Sep 2026 12:05:16 +0200 Subject: [PATCH 2/3] [SYNCOPE-1997] - Fix connectivity check --- .../syncope/core/logic/ResourceLogic.java | 6 ++- .../api/data/ResourceDataBinder.java | 49 +++++++++++++++++++ 2 files changed, 54 insertions(+), 1 deletion(-) diff --git a/core/idm/logic/src/main/java/org/apache/syncope/core/logic/ResourceLogic.java b/core/idm/logic/src/main/java/org/apache/syncope/core/logic/ResourceLogic.java index 3c1375534a..8e74436164 100644 --- a/core/idm/logic/src/main/java/org/apache/syncope/core/logic/ResourceLogic.java +++ b/core/idm/logic/src/main/java/org/apache/syncope/core/logic/ResourceLogic.java @@ -33,6 +33,7 @@ import org.apache.syncope.common.lib.to.Provision; import org.apache.syncope.common.lib.to.ResourceTO; import org.apache.syncope.common.lib.types.ClientExceptionType; +import org.apache.syncope.common.lib.types.ConnConfProperty; import org.apache.syncope.common.lib.types.IdMEntitlement; import org.apache.syncope.core.persistence.api.dao.AnyTypeDAO; import org.apache.syncope.core.persistence.api.dao.ConnInstanceDAO; @@ -426,10 +427,13 @@ public void check(final ResourceTO resourceTO) { ExternalResource externalResource = Optional.ofNullable(resourceTO.getKey()).flatMap(resourceDAO::findById). orElseThrow(() -> new NotFoundException("Resource " + resourceTO.getKey())); + Optional> newConfOverride = + ResourceDataBinder.newConf(externalResource.getConfOverride(), resourceTO.getConfOverride()); + connectorManager.createConnector( connectorManager.buildConnInstanceOverride( connInstance, - externalResource.getConfOverride(), + newConfOverride, externalResource.getCapabilitiesOverride())). test(); } diff --git a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/ResourceDataBinder.java b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/ResourceDataBinder.java index eb72ae70a6..e45cbaf2cd 100644 --- a/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/ResourceDataBinder.java +++ b/core/provisioning-api/src/main/java/org/apache/syncope/core/provisioning/api/data/ResourceDataBinder.java @@ -18,8 +18,13 @@ */ package org.apache.syncope.core.provisioning.api.data; +import java.util.ArrayList; +import java.util.List; +import java.util.Optional; import org.apache.syncope.common.lib.to.ResourceTO; +import org.apache.syncope.common.lib.types.ConnConfProperty; import org.apache.syncope.core.persistence.api.entity.ExternalResource; +import org.identityconnectors.common.security.GuardedString; public interface ResourceDataBinder { @@ -28,4 +33,48 @@ public interface ResourceDataBinder { ExternalResource create(ResourceTO resourceTO); ExternalResource update(ExternalResource resource, ResourceTO resourceTO); + + static Optional> newConf( + final Optional> previousConfOverride, + final Optional> toConfOverride) { + + if (toConfOverride.isEmpty()) { + return Optional.empty(); + } + + if (previousConfOverride.isEmpty()) { + return toConfOverride; + } + + List newConf = new ArrayList<>(); + + toConfOverride.get().forEach(property -> { + if (property.getSchema().isConfidential() + || GuardedString.class.getName().equals(property.getSchema().getType())) { + + if (property.getValues().isEmpty()) { + // no values provided, keep existing + previousConfOverride.get().stream(). + filter(p -> p.getSchema().getName().equals(property.getSchema().getName())). + findFirst().ifPresent(newConf::add); + } else { + // translate confidential properties' cleartext values into GuardedStrings + ConnConfProperty newProperty = new ConnConfProperty(); + newProperty.setSchema(property.getSchema()); + newProperty.setOverridable(property.isOverridable()); + property.getValues().forEach(value -> { + if (value instanceof String string) { + newProperty.getValues().add(new GuardedString(string.toCharArray())); + } else { + newProperty.getValues().add(value); + } + }); + } + } + + newConf.add(property); + }); + + return Optional.of(newConf); + } } From 1debaff280d51f1f842133fe16ff916dd7e465ce Mon Sep 17 00:00:00 2001 From: TatoniMatteo Date: Fri, 11 Sep 2026 12:35:05 +0200 Subject: [PATCH 3/3] [SYNCOPE-1997] - Fix connectivity check --- .../apache/syncope/core/logic/ResourceLogic.java | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/core/idm/logic/src/main/java/org/apache/syncope/core/logic/ResourceLogic.java b/core/idm/logic/src/main/java/org/apache/syncope/core/logic/ResourceLogic.java index 8e74436164..4678327172 100644 --- a/core/idm/logic/src/main/java/org/apache/syncope/core/logic/ResourceLogic.java +++ b/core/idm/logic/src/main/java/org/apache/syncope/core/logic/ResourceLogic.java @@ -424,17 +424,19 @@ public void check(final ResourceTO resourceTO) { ConnInstance connInstance = connInstanceDAO.findById(resourceTO.getConnector()). orElseThrow(() -> new NotFoundException("Connector " + resourceTO.getConnector())); - ExternalResource externalResource = Optional.ofNullable(resourceTO.getKey()).flatMap(resourceDAO::findById). - orElseThrow(() -> new NotFoundException("Resource " + resourceTO.getKey())); - - Optional> newConfOverride = - ResourceDataBinder.newConf(externalResource.getConfOverride(), resourceTO.getConfOverride()); + Optional.ofNullable(resourceTO.getKey()).flatMap(resourceDAO::findById). + ifPresent(externalResource -> { + Optional> newConfOverride = + ResourceDataBinder.newConf(externalResource.getConfOverride(), + resourceTO.getConfOverride()); + resourceTO.setConfOverride(newConfOverride); + }); connectorManager.createConnector( connectorManager.buildConnInstanceOverride( connInstance, - newConfOverride, - externalResource.getCapabilitiesOverride())). + resourceTO.getConfOverride(), + resourceTO.getCapabilitiesOverride())). test(); }