Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/fit_WA_OpenFGA.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ jobs:
- name: Build
run: mvn -U -T 1C -P 'skipTests,all,use-apache-snapshots'
- name: 'Unit Tests: OpenFGA'
run: mvn -f ext/openfga/client-openfga/pom.xml -P openfga -Dinvoker.streamLogs=true -Dmodernizer.skip=true -Dianal.phase=none -Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true
run: mvn -f ext/openfga/ -P openfga -Dinvoker.streamLogs=true -Dmodernizer.skip=true -Dianal.phase=none -Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true
- name: 'WA / OpenFGA'
run: mvn -f fit/wa-reference/pom.xml verify -Dinvoker.streamLogs=true -Dmodernizer.skip=true -Drat.skip=true -Dcheckstyle.skip=true -Djacoco.skip=true -Dit.test=OpenFGAUIITCase
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,4 @@ maven-eclipse.xml
.vscode
node_modules
**/checkstyle.cache
ENV.md
572 changes: 572 additions & 0 deletions AGENTS.md

Large diffs are not rendered by default.

9 changes: 4 additions & 5 deletions SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,10 @@ under the License.

| Version | Supported |
| ------- | ------------------ |
| 3.0.x | :white_check_mark: |
| 2.1.x | :white_check_mark: |
| 2.0.x | :x: |
| 1.2.x | :x: |
| 1.1.x | :x: |
| 4.2.x | :white_check_mark: |
| 4.1.x | :white_check_mark: |
| 4.0.x | :x: |
| 3.0.x | :x: |

## Reporting a Vulnerability

Expand Down
12 changes: 12 additions & 0 deletions client/am/console/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ under the License.
<artifactId>syncope-client-am-lib</artifactId>
<version>${project.version}</version>
</dependency>

<!-- TEST -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.syncope.client.console.commons;

import static org.junit.jupiter.api.Assertions.assertEquals;

import org.junit.jupiter.api.Test;

class AMConstantsTest {

@Test
void constants() {
assertEquals("gatewayroute.paginator.rows", AMConstants.PREF_GATEWAYROUTE_PAGINATOR_ROWS);
assertEquals("waconfig.paginator.rows", AMConstants.PREF_WACONFIG_PAGINATOR_ROWS);
assertEquals("wasession.paginator.rows", AMConstants.PREF_WASESSION_PAGINATOR_ROWS);
assertEquals("authmodule.paginator.rows", AMConstants.PREF_AUTHMODULE_PAGINATOR_ROWS);
assertEquals("clientapp.paginator.rows", AMConstants.PREF_CLIENTAPP_PAGINATOR_ROWS);
assertEquals("clientapp.properties.paginator.rows",
AMConstants.PREF_CLIENTAPP_PROPERTIES_PAGINATOR_ROWS);
assertEquals("accesspolicy.conf.attrs.paginator.rows",
AMConstants.PREF_ACCESS_POLICY_CONF_ATTRS_PAGINATOR_ROWS);
assertEquals("saml2idpentity.properties.paginator.rows",
AMConstants.PREF_SAML2_IDP_ENTITY_PAGINATOR_ROWS);
assertEquals("authprofile.paginator.rows", AMConstants.PREF_AUTHPROFILE_PAGINATOR_ROWS);
assertEquals("authprofile.impersonated.paginator.rows",
AMConstants.PREF_AUTHPROFILE_IMPERSONATED_PAGINATOR_ROWS);
assertEquals("authprofile.googlemfaauthtokens.paginator.rows",
AMConstants.PREF_AUTHPROFILE_GOOGLEMFAAUTHTOKENS_PAGINATOR_ROWS);
assertEquals("authprofile.googlemfaauthaccounts.paginator.rows",
AMConstants.PREF_AUTHPROFILE_GOOGLEMFAAUTHACCOUNTS_PAGINATOR_ROWS);
assertEquals("authprofile.mfaTrustedDevices.paginator.rows",
AMConstants.PREF_AUTHPROFILE_MFA_TRUSTED_FDEVICES_PAGINATOR_ROWS);
assertEquals("authprofile.webAuthnDeviceCredentials.paginator.rows",
AMConstants.PREF_AUTHPROFILE_WEBAUTHNDEVICECREDENTIALS_PAGINATOR_ROWS);
assertEquals("authprofile.consentDecisions.paginator.rows",
AMConstants.PREF_AUTHPROFILE_CONSENT_DECISION_PAGINATOR_ROWS);
assertEquals("oidc.customScopes.paginator.rows", AMConstants.PREF_OIDC_CUSTOMSCOPES_PAGINATOR_ROWS);
}
}
12 changes: 12 additions & 0 deletions client/idm/console/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,18 @@ under the License.
<artifactId>syncope-client-idm-lib</artifactId>
<version>${project.version}</version>
</dependency>

<!-- TEST -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

<build>
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.syncope.client.console.commons;

import static org.junit.jupiter.api.Assertions.assertEquals;

import org.junit.jupiter.api.Test;

class IdMConstantsTest {

@Test
void constants() {
assertEquals("connid.locations.paginator.rows", IdMConstants.PREF_CONNID_LOCATIONS_PAGINATOR_ROWS);
assertEquals("reconciliation.paginator.rows", IdMConstants.PREF_RECONCILIATION_PAGINATOR_ROWS);
assertEquals("resource.status.paginator.rows", IdMConstants.PREF_RESOURCE_STATUS_PAGINATOR_ROWS);
assertEquals("resources.paginator.rows", IdMConstants.PREF_RESOURCES_PAGINATOR_ROWS);
assertEquals("remediation.paginator.rows", IdMConstants.PREF_REMEDIATION_PAGINATOR_ROWS);
assertEquals("org.identityconnectors.common.security.GuardedString", IdMConstants.GUARDED_STRING);
assertEquals("org.identityconnectors.common.security.GuardedByteArray", IdMConstants.GUARDED_BYTE_ARRAY);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.syncope.client.console.layout;

import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertSame;

import org.junit.jupiter.api.Test;

class IdMUserFormLayoutInfoTest {

@Test
void defaults() {
IdMUserFormLayoutInfo info = new IdMUserFormLayoutInfo();

assertNotNull(info);
assertNotNull(info.getLinkedAccountFormLayoutInfo());
assertSame(info.getLinkedAccountFormLayoutInfo(), info.getLinkedAccountFormLayoutInfo());
}

@Test
void settersAndGetters() {
IdMUserFormLayoutInfo info = new IdMUserFormLayoutInfo();

LinkedAccountFormLayoutInfo layout = new LinkedAccountFormLayoutInfo();
info.setLinkedAccountFormLayoutInfo(layout);
assertSame(layout, info.getLinkedAccountFormLayoutInfo());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.syncope.client.console.layout;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertTrue;

import java.util.List;
import org.apache.syncope.client.console.wizards.any.LinkedAccountWizardBuilder;
import org.junit.jupiter.api.Test;

class LinkedAccountFormLayoutInfoTest {

@Test
void defaults() {
LinkedAccountFormLayoutInfo info = new LinkedAccountFormLayoutInfo();

assertNotNull(info);
assertEquals(LinkedAccountWizardBuilder.class, info.getFormClass());
assertTrue(info.isPlainAttrs());
assertTrue(info.isCredentials());
assertNotNull(info.getWhichPlainAttrs());
assertTrue(info.getWhichPlainAttrs().isEmpty());
assertNotNull(info.getWhichCredentials());
assertTrue(info.getWhichCredentials().isEmpty());
}

@Test
void settersAndGetters() {
LinkedAccountFormLayoutInfo info = new LinkedAccountFormLayoutInfo();

info.setPlainAttrs(false);
assertFalse(info.isPlainAttrs());

info.setCredentials(false);
assertFalse(info.isCredentials());

List<String> credentials = List.of("cred1", "cred2");
info.getWhichCredentials().addAll(credentials);
assertEquals(credentials, info.getWhichCredentials());

List<String> plainAttrs = List.of("attr1", "attr2");
info.getWhichPlainAttrs().addAll(plainAttrs);
assertEquals(plainAttrs, info.getWhichPlainAttrs());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.syncope.client.console.topology;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertNotNull;

import org.junit.jupiter.api.Test;

class TopologyNodeTest {

@Test
void constructor() {
TopologyNode node = new TopologyNode("key1", "display1", TopologyNode.Kind.RESOURCE);

assertNotNull(node);
assertEquals("key1", node.getKey());
assertEquals("display1", node.getDisplayName());
assertEquals(TopologyNode.Kind.RESOURCE, node.getKind());
}

@Test
void kinds() {
assertEquals(5, TopologyNode.Kind.values().length);
assertEquals(TopologyNode.Kind.RESOURCE, TopologyNode.Kind.valueOf("RESOURCE"));
assertEquals(TopologyNode.Kind.CONNECTOR, TopologyNode.Kind.valueOf("CONNECTOR"));
assertEquals(TopologyNode.Kind.CONNECTOR_SERVER, TopologyNode.Kind.valueOf("CONNECTOR_SERVER"));
assertEquals(TopologyNode.Kind.FS_PATH, TopologyNode.Kind.valueOf("FS_PATH"));
assertEquals(TopologyNode.Kind.SYNCOPE, TopologyNode.Kind.valueOf("SYNCOPE"));
}

@Test
void statuses() {
assertEquals(4, TopologyNode.Status.values().length);
assertEquals(TopologyNode.Status.UNKNOWN, TopologyNode.Status.valueOf("UNKNOWN"));
assertEquals(TopologyNode.Status.REACHABLE, TopologyNode.Status.valueOf("REACHABLE"));
assertEquals(TopologyNode.Status.UNREACHABLE, TopologyNode.Status.valueOf("UNREACHABLE"));
assertEquals(TopologyNode.Status.FAILURE, TopologyNode.Status.valueOf("FAILURE"));
}

@Test
void settersAndGetters() {
TopologyNode node = new TopologyNode("key", "name", TopologyNode.Kind.CONNECTOR);

node.setDisplayName("new name");
assertEquals("new name", node.getDisplayName());

node.setConnectionDisplayName("conn name");
assertEquals("conn name", node.getConnectionDisplayName());

node.setKind(TopologyNode.Kind.FS_PATH);
assertEquals(TopologyNode.Kind.FS_PATH, node.getKind());

node.setHost("host");
assertEquals("host", node.getHost());

node.setPort(1234);
assertEquals(1234, node.getPort());

node.setX(100);
assertEquals(100, node.getX());

node.setY(200);
assertEquals(200, node.getY());
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.syncope.client.console.topology;

import static org.junit.jupiter.api.Assertions.assertEquals;

import org.junit.jupiter.api.Test;

class TopologyTest {

@Test
void sanitizeMarkupId() {
assertEquals("hello_world", Topology.sanitizeMarkupId("hello world"));
assertEquals("hello-world", Topology.sanitizeMarkupId("hello-world"));
assertEquals("hello.world", Topology.sanitizeMarkupId("hello.world"));
assertEquals("clean_id", Topology.sanitizeMarkupId("clean_id"));
assertEquals("", Topology.sanitizeMarkupId(""));
assertEquals("a_b_c", Topology.sanitizeMarkupId("a@b#c"));
assertEquals("connid___example", Topology.sanitizeMarkupId("connid://example"));
}
}
Loading
Loading