Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[SYNCOPE-1829] Introducing support for Live Sync #915

Merged
merged 37 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from 30 commits
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
f167ed9
[SYNCOPE-1829] Introducing support for Live Sync
ilgrosso Nov 22, 2024
340fe47
Fixing Wildfly tests
ilgrosso Nov 22, 2024
57f55df
Bump io.zonky.test.postgres:embedded-postgres-binaries-bom (#917)
dependabot[bot] Nov 23, 2024
7128685
Upgrading Embedded PostgreSQL
ilgrosso Nov 26, 2024
4135ae1
Merge remote-tracking branch 'upstream/master' into SYNCOPE-1829
ilgrosso Nov 26, 2024
52e3261
Merge remote-tracking branch 'upstream/master' into SYNCOPE-1829
ilgrosso Nov 26, 2024
8fb00be
Merge remote-tracking branch 'upstream/master' into SYNCOPE-1829
ilgrosso Nov 27, 2024
a137cfb
Merge remote-tracking branch 'upstream/master' into SYNCOPE-1829
ilgrosso Nov 27, 2024
ef0940d
Merge remote-tracking branch 'upstream/master' into SYNCOPE-1829
ilgrosso Nov 28, 2024
2893a06
Merge remote-tracking branch 'upstream/master' into SYNCOPE-1829
ilgrosso Nov 29, 2024
78bcd9b
Merge remote-tracking branch 'upstream/master' into SYNCOPE-1829
ilgrosso Nov 29, 2024
b9b4c99
WIP: adding LiveSyncTask
ilgrosso Nov 29, 2024
dbfe19b
Fixes
ilgrosso Nov 29, 2024
6c023ca
Merge remote-tracking branch 'upstream/master' into SYNCOPE-1829
ilgrosso Dec 2, 2024
d52f099
Merge remote-tracking branch 'upstream/master' into SYNCOPE-1829
ilgrosso Dec 3, 2024
0755b4b
Adding Kafka CRUD tests
ilgrosso Dec 3, 2024
7684cd7
Fix TopologyITCase#createNewResurceAndProvisionRules
ilgrosso Dec 4, 2024
bc1902d
[SYNCOPE-1847] added PropagationTaskInfoSerializer to avoid serializa…
andrea-patricelli Dec 5, 2024
f2521c8
Upgrading CAS
ilgrosso Dec 6, 2024
f494737
Fixing after CAS 7.1.3 upgrade
ilgrosso Dec 7, 2024
a86548a
Bump org.webjars:font-awesome from 6.6.0 to 6.7.1 (#931)
dependabot[bot] Dec 8, 2024
79855c4
[SYNCOPE-1846] Multiple Relationships in the same wizard instance (#…
TatoniMatteo Dec 10, 2024
09225cb
Bump org.apache.maven.plugins:maven-javadoc-plugin from 3.11.1 to 3.11.2
dependabot[bot] Dec 9, 2024
1c20bc6
[SYNCOPE-1846] Allow for extensions
ilgrosso Dec 10, 2024
2edb9f8
Upgrading OpenSearch and Swagger JAX-RS
ilgrosso Dec 12, 2024
d2d3e31
Merge remote-tracking branch 'upstream/master' into SYNCOPE-1829
ilgrosso Dec 13, 2024
e74a977
Merge remote-tracking branch 'upstream/master' into SYNCOPE-1829
ilgrosso Dec 16, 2024
bf674b8
Merge remote-tracking branch 'upstream/master' into SYNCOPE-1829
ilgrosso Dec 17, 2024
d775d4b
Merge remote-tracking branch 'upstream/master' into SYNCOPE-1829
ilgrosso Dec 17, 2024
78bc8ca
Integration test with live sync of user and group from Kafka
ilgrosso Dec 18, 2024
aab4114
Merge remote-tracking branch 'upstream/master' into SYNCOPE-1829
ilgrosso Dec 19, 2024
f0383c7
Fix tests
ilgrosso Dec 19, 2024
23c6f11
Merge remote-tracking branch 'upstream/master' into SYNCOPE-1829
ilgrosso Dec 19, 2024
96a250d
Console support
ilgrosso Dec 19, 2024
946d3df
Merge remote-tracking branch 'upstream/master' into SYNCOPE-1829
ilgrosso Dec 22, 2024
a9ccd67
docs
ilgrosso Dec 23, 2024
0ed4ba9
Fix tests
ilgrosso Dec 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,7 @@ under the License.

<profile>
<id>standalone</id>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
</dependencies>


<build>
<plugins>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,14 +169,7 @@ under the License.

<profile>
<id>standalone</id>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
</dependencies>


<build>
<plugins>
<plugin>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,13 +150,6 @@ under the License.
<profile>
<id>standalone</id>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
Expand Down
7 changes: 0 additions & 7 deletions archetype/src/main/resources/archetype-resources/wa/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,13 +114,6 @@ under the License.
<profiles>
<profile>
<id>standalone</id>

<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-undertow</artifactId>
</dependency>
</dependencies>

<build>
<plugins>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
import java.util.stream.Collectors;
import org.apache.syncope.client.console.init.ClassPathScanImplementationLookup;
import org.apache.syncope.client.console.rest.ImplementationRestClient;
import org.apache.syncope.common.lib.policy.PullCorrelationRuleConf;
import org.apache.syncope.common.lib.policy.InboundCorrelationRuleConf;
import org.apache.syncope.common.lib.policy.PushCorrelationRuleConf;
import org.apache.syncope.common.lib.to.ImplementationTO;
import org.apache.syncope.common.lib.types.IdMImplementationType;
Expand All @@ -44,7 +44,7 @@ public IdMImplementationInfoProvider(

@Override
public ViewMode getViewMode(final ImplementationTO implementation) {
return IdMImplementationType.PULL_CORRELATION_RULE.equals(implementation.getType())
return IdMImplementationType.INBOUND_CORRELATION_RULE.equals(implementation.getType())
|| IdMImplementationType.PUSH_CORRELATION_RULE.equals(implementation.getType())
? ViewMode.JSON_BODY
: super.getViewMode(implementation);
Expand All @@ -55,8 +55,8 @@ public List<String> getClasses(final ImplementationTO implementation, final View
List<String> classes = new ArrayList<>();
if (viewMode == ViewMode.JSON_BODY && IdMImplementationType.values().containsKey(implementation.getType())) {
switch (implementation.getType()) {
case IdMImplementationType.PULL_CORRELATION_RULE:
classes = lookup.getClasses(PullCorrelationRuleConf.class).stream().
case IdMImplementationType.INBOUND_CORRELATION_RULE:
classes = lookup.getClasses(InboundCorrelationRuleConf.class).stream().
map(Class::getName).collect(Collectors.toList());
break;

Expand Down Expand Up @@ -88,16 +88,16 @@ public String getGroovyTemplateClassName(final String implementationType) {
templateClassName = "MyPropagationActions";
break;

case IdMImplementationType.PULL_ACTIONS:
templateClassName = "MyPullActions";
case IdMImplementationType.INBOUND_ACTIONS:
templateClassName = "MyInboundActions";
break;

case IdMImplementationType.PUSH_ACTIONS:
templateClassName = "MyPushActions";
break;

case IdMImplementationType.PULL_CORRELATION_RULE:
templateClassName = "MyPullCorrelationRule";
case IdMImplementationType.INBOUND_CORRELATION_RULE:
templateClassName = "MyInboundCorrelationRule";
break;

case IdMImplementationType.PUSH_CORRELATION_RULE:
Expand All @@ -119,8 +119,8 @@ public String getGroovyTemplateClassName(final String implementationType) {
public Class<?> getClass(final String implementationType, final String name) {
Class<?> clazz;
switch (implementationType) {
case IdMImplementationType.PULL_CORRELATION_RULE:
clazz = lookup.getClasses(PullCorrelationRuleConf.class).stream().
case IdMImplementationType.INBOUND_CORRELATION_RULE:
clazz = lookup.getClasses(InboundCorrelationRuleConf.class).stream().
filter(c -> c.getName().equals(name)).findFirst().orElse(null);
break;

Expand Down Expand Up @@ -151,14 +151,14 @@ protected List<String> load() {
}

@Override
public IModel<List<String>> getPullActions() {
public IModel<List<String>> getInboundActions() {
return new LoadableDetachableModel<>() {

private static final long serialVersionUID = 5275935387613157437L;

@Override
protected List<String> load() {
return implementationRestClient.list(IdMImplementationType.PULL_ACTIONS).stream().
return implementationRestClient.list(IdMImplementationType.INBOUND_ACTIONS).stream().
map(ImplementationTO::getKey).sorted().collect(Collectors.toList());
}
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@

import java.util.ArrayList;
import java.util.List;
import org.apache.syncope.client.console.policies.InboundPolicyDirectoryPanel;
import org.apache.syncope.client.console.policies.PropagationPolicyDirectoryPanel;
import org.apache.syncope.client.console.policies.PullPolicyDirectoryPanel;
import org.apache.syncope.client.console.policies.PushPolicyDirectoryPanel;
import org.apache.syncope.client.console.rest.PolicyRestClient;
import org.apache.wicket.PageReference;
Expand Down Expand Up @@ -54,13 +54,13 @@ public Panel getPanel(final String panelId) {
}
});

tabs.add(new AbstractTab(new ResourceModel("policy.pull")) {
tabs.add(new AbstractTab(new ResourceModel("policy.inbound")) {

private static final long serialVersionUID = -6815067322125799251L;

@Override
public Panel getPanel(final String panelId) {
return new PullPolicyDirectoryPanel(panelId, policyRestClient, pageRef);
return new InboundPolicyDirectoryPanel(panelId, policyRestClient, pageRef);
}
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
package org.apache.syncope.client.console.init;

import java.util.Optional;
import org.apache.syncope.common.lib.policy.PullCorrelationRuleConf;
import org.apache.syncope.common.lib.policy.InboundCorrelationRuleConf;
import org.apache.syncope.common.lib.policy.PushCorrelationRuleConf;
import org.springframework.context.annotation.ClassPathScanningCandidateComponentProvider;
import org.springframework.core.type.filter.AssignableTypeFilter;
Expand All @@ -30,14 +30,14 @@ public class IdMClassPathScanImplementationContributor implements ClassPathScanI

@Override
public void extend(final ClassPathScanningCandidateComponentProvider scanner) {
scanner.addIncludeFilter(new AssignableTypeFilter(PullCorrelationRuleConf.class));
scanner.addIncludeFilter(new AssignableTypeFilter(InboundCorrelationRuleConf.class));
scanner.addIncludeFilter(new AssignableTypeFilter(PushCorrelationRuleConf.class));
}

@Override
public Optional<String> getLabel(final Class<?> clazz) {
if (PullCorrelationRuleConf.class.isAssignableFrom(clazz)) {
return Optional.of(PullCorrelationRuleConf.class.getName());
if (InboundCorrelationRuleConf.class.isAssignableFrom(clazz)) {
return Optional.of(InboundCorrelationRuleConf.class.getName());
}
if (PushCorrelationRuleConf.class.isAssignableFrom(clazz)) {
return Optional.of(PushCorrelationRuleConf.class.getName());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
import org.apache.syncope.client.console.rest.PolicyRestClient;
import org.apache.syncope.client.console.wicket.markup.html.form.ActionLink;
import org.apache.syncope.client.console.wicket.markup.html.form.ActionsPanel;
import org.apache.syncope.common.lib.policy.PullPolicyTO;
import org.apache.syncope.common.lib.policy.InboundPolicyTO;
import org.apache.syncope.common.lib.types.IdRepoEntitlement;
import org.apache.syncope.common.lib.types.PolicyType;
import org.apache.wicket.PageReference;
Expand All @@ -37,39 +37,41 @@
/**
* Pull policies page.
*/
public class PullPolicyDirectoryPanel extends PolicyDirectoryPanel<PullPolicyTO> {
public class InboundPolicyDirectoryPanel extends PolicyDirectoryPanel<InboundPolicyTO> {

private static final long serialVersionUID = 4984337552918213290L;

public PullPolicyDirectoryPanel(final String id, final PolicyRestClient restClient, final PageReference pageRef) {
super(id, restClient, PolicyType.PULL, pageRef);
public InboundPolicyDirectoryPanel(
final String id, final PolicyRestClient restClient, final PageReference pageRef) {

this.addNewItemPanelBuilder(
new PolicyModalPanelBuilder<>(PolicyType.PULL, new PullPolicyTO(), modal, restClient, pageRef), true);
super(id, restClient, PolicyType.INBOUND, pageRef);

this.addNewItemPanelBuilder(new PolicyModalPanelBuilder<>(
PolicyType.INBOUND, new InboundPolicyTO(), modal, restClient, pageRef), true);
MetaDataRoleAuthorizationStrategy.authorize(addAjaxLink, RENDER, IdRepoEntitlement.POLICY_CREATE);

initResultTable();
}

@Override
protected void addCustomColumnFields(final List<IColumn<PullPolicyTO, String>> columns) {
protected void addCustomColumnFields(final List<IColumn<InboundPolicyTO, String>> columns) {
columns.add(new PropertyColumn<>(new StringResourceModel(
"conflictResolutionAction", this), "conflictResolutionAction", "conflictResolutionAction"));
}

@Override
protected void addCustomActions(final ActionsPanel<PullPolicyTO> panel, final IModel<PullPolicyTO> model) {
protected void addCustomActions(final ActionsPanel<InboundPolicyTO> panel, final IModel<InboundPolicyTO> model) {
panel.add(new ActionLink<>() {

private static final long serialVersionUID = -3722207913631435501L;

@Override
public void onClick(final AjaxRequestTarget target, final PullPolicyTO ignore) {
public void onClick(final AjaxRequestTarget target, final InboundPolicyTO ignore) {
target.add(policySpecModal.setContent(
new ProvisioningPolicyModalPanel(model.getObject(), policySpecModal, pageRef)));

policySpecModal.header(new StringResourceModel(
"policy.rules", PullPolicyDirectoryPanel.this, Model.of(model.getObject())));
"policy.rules", InboundPolicyDirectoryPanel.this, Model.of(model.getObject())));

MetaDataRoleAuthorizationStrategy.authorize(
policySpecModal.getForm(), ENABLE, IdRepoEntitlement.POLICY_UPDATE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,10 @@
import org.apache.syncope.client.ui.commons.markup.html.form.AjaxPalettePanel;
import org.apache.syncope.client.ui.commons.pages.BaseWebPage;
import org.apache.syncope.common.lib.policy.AbstractCorrelationRuleConf;
import org.apache.syncope.common.lib.policy.DefaultPullCorrelationRuleConf;
import org.apache.syncope.common.lib.policy.DefaultInboundCorrelationRuleConf;
import org.apache.syncope.common.lib.policy.DefaultPushCorrelationRuleConf;
import org.apache.syncope.common.lib.policy.InboundPolicyTO;
import org.apache.syncope.common.lib.policy.ProvisioningPolicyTO;
import org.apache.syncope.common.lib.policy.PullPolicyTO;
import org.apache.syncope.common.lib.to.ImplementationTO;
import org.apache.syncope.common.lib.to.SchemaTO;
import org.apache.syncope.common.lib.types.AnyTypeKind;
Expand Down Expand Up @@ -102,8 +102,8 @@ public ProvisioningPolicyModalPanel(

@Override
protected Map<String, ImplementationTO> load() {
return implementationRestClient.list(policyTO instanceof PullPolicyTO
? IdMImplementationType.PULL_CORRELATION_RULE
return implementationRestClient.list(policyTO instanceof InboundPolicyTO
? IdMImplementationType.INBOUND_CORRELATION_RULE
: IdMImplementationType.PUSH_CORRELATION_RULE).stream().
collect(Collectors.toMap(ImplementationTO::getKey, Function.identity()));
}
Expand All @@ -115,8 +115,8 @@ protected Map<String, ImplementationTO> load() {

private final List<CorrelationRule> rules = policyTO.getCorrelationRules().keySet().stream().
map(anyType -> new CorrelationRule(
policyTO instanceof PullPolicyTO
? DefaultPullCorrelationRuleConf.class
policyTO instanceof InboundPolicyTO
? DefaultInboundCorrelationRuleConf.class
: DefaultPushCorrelationRuleConf.class,
anyType,
implementations.getObject().get(policyTO.getCorrelationRules().get(anyType)))).
Expand All @@ -140,8 +140,8 @@ public void setObject(final List<CorrelationRule> object) {

@Override
protected CorrelationRule newModelObject() {
return new CorrelationRule(policyTO instanceof PullPolicyTO
? DefaultPullCorrelationRuleConf.class
return new CorrelationRule(policyTO instanceof InboundPolicyTO
? DefaultInboundCorrelationRuleConf.class
: DefaultPushCorrelationRuleConf.class);
}

Expand Down Expand Up @@ -172,8 +172,8 @@ public void onSubmit(final AjaxRequestTarget target) {
}
}
});
policyRestClient.update(getItem() instanceof PullPolicyTO
? PolicyType.PULL : PolicyType.PUSH, getItem());
policyRestClient.update(getItem() instanceof InboundPolicyTO
? PolicyType.INBOUND : PolicyType.PUSH, getItem());

SyncopeConsoleSession.get().success(getString(Constants.OPERATION_SUCCEEDED));
this.modal.close(target);
Expand Down Expand Up @@ -216,8 +216,8 @@ protected class CorrelationRulePanel extends Panel {
@Override
public Boolean getObject() {
AbstractCorrelationRuleConf conf = correlationRule.getObject().getDefaultRuleConf();
return conf instanceof DefaultPullCorrelationRuleConf
? DefaultPullCorrelationRuleConf.class.cast(conf).isOrSchemas()
return conf instanceof DefaultInboundCorrelationRuleConf
? DefaultInboundCorrelationRuleConf.class.cast(conf).isOrSchemas()
: conf instanceof DefaultPushCorrelationRuleConf
? DefaultPushCorrelationRuleConf.class.cast(conf).isOrSchemas()
: false;
Expand All @@ -226,8 +226,8 @@ public Boolean getObject() {
@Override
public void setObject(final Boolean object) {
AbstractCorrelationRuleConf conf = correlationRule.getObject().getDefaultRuleConf();
if (conf instanceof DefaultPullCorrelationRuleConf) {
DefaultPullCorrelationRuleConf.class.cast(conf).setOrSchemas(object);
if (conf instanceof DefaultInboundCorrelationRuleConf) {
DefaultInboundCorrelationRuleConf.class.cast(conf).setOrSchemas(object);
} else if (conf instanceof DefaultPushCorrelationRuleConf) {
DefaultPushCorrelationRuleConf.class.cast(conf).setOrSchemas(object);
}
Expand All @@ -244,8 +244,8 @@ public void setObject(final Boolean object) {

private List<String> schemas() {
AbstractCorrelationRuleConf conf = correlationRule.getObject().getDefaultRuleConf();
return conf instanceof DefaultPullCorrelationRuleConf
? DefaultPullCorrelationRuleConf.class.cast(conf).getSchemas()
return conf instanceof DefaultInboundCorrelationRuleConf
? DefaultInboundCorrelationRuleConf.class.cast(conf).getSchemas()
: conf instanceof DefaultPushCorrelationRuleConf
? DefaultPushCorrelationRuleConf.class.cast(conf).getSchemas()
: List.of();
Expand Down
Loading
Loading