mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-09-10 14:11:58 +00:00
Compare commits
23 Commits
25.3.0.17
...
dependabot
Author | SHA1 | Date | |
---|---|---|---|
|
dc8bfdc63d | ||
|
2b00e550a9 | ||
|
f3dca482ff | ||
|
94e957cb73 | ||
|
8868e64a6a | ||
|
f4af65943f | ||
|
6fe1b50741 | ||
|
f300bd6b3a | ||
|
f7195ef16a | ||
|
ef228f0614 | ||
|
6c0f231316 | ||
|
33b521b421 | ||
|
eff4e0738c | ||
|
5685fc3b17 | ||
|
7c22a2598b | ||
|
efe053167d | ||
|
4aae383637 | ||
|
ca1774ffae | ||
|
6206f67bdd | ||
|
82897f449f | ||
|
e6d30cddac | ||
|
0e6b444a25 | ||
|
61dc54bb33 |
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-amps</artifactId>
|
||||
<version>25.3.0.17</version>
|
||||
<version>25.3.0.25-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
||||
<version>25.3.0.17</version>
|
||||
<version>25.3.0.25-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-automation-community-repo</artifactId>
|
||||
<version>25.3.0.17</version>
|
||||
<version>25.3.0.25-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<build>
|
||||
@@ -88,7 +88,7 @@
|
||||
<dependency>
|
||||
<groupId>com.github.docker-java</groupId>
|
||||
<artifactId>docker-java</artifactId>
|
||||
<version>3.4.0</version>
|
||||
<version>3.6.0</version>
|
||||
<exclusions>
|
||||
<exclusion>
|
||||
<groupId>org.bouncycastle</groupId>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-parent</artifactId>
|
||||
<version>25.3.0.17</version>
|
||||
<version>25.3.0.25-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
||||
<version>25.3.0.17</version>
|
||||
<version>25.3.0.25-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -371,12 +371,18 @@ public class ExtendedSecurityServiceImpl extends ServiceBaseImpl
|
||||
{
|
||||
String group = null;
|
||||
|
||||
// If enabled, the authorities are forced to match the correct casing of the usernames in case they were set
|
||||
// with the incorrect casing.
|
||||
// If not, it will just use the authorities as they are.
|
||||
// In normal circumstances, the authorities are in the correct casing, so this is disabled by default.
|
||||
Set<String> authoritySet = normalizeAuthorities(authorities);
|
||||
|
||||
// find group or determine what the next index is if no group exists or there is a clash
|
||||
Pair<String, Integer> groupResult = findIPRGroup(groupPrefix, authorities);
|
||||
Pair<String, Integer> groupResult = findIPRGroup(groupPrefix, authoritySet);
|
||||
|
||||
if (groupResult.getFirst() == null)
|
||||
{
|
||||
group = createIPRGroup(groupPrefix, authorities, groupResult.getSecond());
|
||||
group = createIPRGroup(groupPrefix, authoritySet, groupResult.getSecond());
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -404,13 +410,8 @@ public class ExtendedSecurityServiceImpl extends ServiceBaseImpl
|
||||
boolean hasMoreItems = true;
|
||||
int pageCount = 0;
|
||||
|
||||
// If enabled, the authorities are forced to match the correct casing of the usernames in case they were set with the incorrect casing.
|
||||
// If not, it will just use the authorities as they are.
|
||||
// In normal circumstances, the authorities are in the correct casing, so this is disabled by default.
|
||||
Set<String> authoritySet = normalizeAuthorities(authorities);
|
||||
|
||||
// determine the short name prefix
|
||||
String groupShortNamePrefix = getIPRGroupPrefixShortName(groupPrefix, authoritySet);
|
||||
String groupShortNamePrefix = getIPRGroupPrefixShortName(groupPrefix, authorities);
|
||||
|
||||
// iterate over the authorities to find a match
|
||||
while (hasMoreItems == true)
|
||||
@@ -431,7 +432,7 @@ public class ExtendedSecurityServiceImpl extends ServiceBaseImpl
|
||||
for (String group : results.getPage())
|
||||
{
|
||||
// if exists and matches we have found our group
|
||||
if (isIPRGroupTrueMatch(group, authoritySet))
|
||||
if (isIPRGroupTrueMatch(group, authorities))
|
||||
{
|
||||
return new Pair<String, Integer>(group, nextGroupIndex);
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-governance-services-community-repo-parent</artifactId>
|
||||
<version>25.3.0.17</version>
|
||||
<version>25.3.0.25-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<build>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>25.3.0.17</version>
|
||||
<version>25.3.0.25-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-amps</artifactId>
|
||||
<version>25.3.0.17</version>
|
||||
<version>25.3.0.25-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>25.3.0.17</version>
|
||||
<version>25.3.0.25-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>25.3.0.17</version>
|
||||
<version>25.3.0.25-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>25.3.0.17</version>
|
||||
<version>25.3.0.25-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@@ -9,6 +9,6 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>25.3.0.17</version>
|
||||
<version>25.3.0.25-SNAPSHOT</version>
|
||||
</parent>
|
||||
</project>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>25.3.0.17</version>
|
||||
<version>25.3.0.25-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>25.3.0.17</version>
|
||||
<version>25.3.0.25-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -6,7 +6,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>25.3.0.17</version>
|
||||
<version>25.3.0.25-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<modules>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>25.3.0.17</version>
|
||||
<version>25.3.0.25-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<organization>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>25.3.0.17</version>
|
||||
<version>25.3.0.25-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>25.3.0.17</version>
|
||||
<version>25.3.0.25-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -8,7 +8,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>25.3.0.17</version>
|
||||
<version>25.3.0.25-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
@@ -9,7 +9,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-tests</artifactId>
|
||||
<version>25.3.0.17</version>
|
||||
<version>25.3.0.25-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<developers>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo-packaging</artifactId>
|
||||
<version>25.3.0.17</version>
|
||||
<version>25.3.0.25-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<properties>
|
||||
|
8
pom.xml
8
pom.xml
@@ -2,7 +2,7 @@
|
||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||
<modelVersion>4.0.0</modelVersion>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>25.3.0.17</version>
|
||||
<version>25.3.0.25-SNAPSHOT</version>
|
||||
<packaging>pom</packaging>
|
||||
<name>Alfresco Community Repo Parent</name>
|
||||
|
||||
@@ -51,8 +51,8 @@
|
||||
<dependency.alfresco-server-root.version>7.0.2</dependency.alfresco-server-root.version>
|
||||
<dependency.activiti-engine.version>5.23.0</dependency.activiti-engine.version>
|
||||
<dependency.activiti.version>5.23.0</dependency.activiti.version>
|
||||
<dependency.alfresco-transform-core.version>5.2.0-A.3</dependency.alfresco-transform-core.version>
|
||||
<dependency.alfresco-transform-service.version>4.2.0</dependency.alfresco-transform-service.version>
|
||||
<dependency.alfresco-transform-core.version>5.2.1-A.3</dependency.alfresco-transform-core.version>
|
||||
<dependency.alfresco-transform-service.version>4.2.1-A.4</dependency.alfresco-transform-service.version>
|
||||
<dependency.alfresco-greenmail.version>7.1</dependency.alfresco-greenmail.version>
|
||||
<dependency.acs-event-model.version>1.0.5</dependency.acs-event-model.version>
|
||||
|
||||
@@ -154,7 +154,7 @@
|
||||
<connection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</connection>
|
||||
<developerConnection>scm:git:https://github.com/Alfresco/alfresco-community-repo.git</developerConnection>
|
||||
<url>https://github.com/Alfresco/alfresco-community-repo</url>
|
||||
<tag>25.3.0.17</tag>
|
||||
<tag>HEAD</tag>
|
||||
</scm>
|
||||
|
||||
<distributionManagement>
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>25.3.0.17</version>
|
||||
<version>25.3.0.25-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
@@ -27,7 +27,6 @@ package org.alfresco.rest.framework.resource.parameters;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.extensions.webscripts.WebScriptRequest;
|
||||
|
||||
import org.alfresco.rest.framework.core.exceptions.InvalidArgumentException;
|
||||
@@ -69,7 +68,7 @@ public interface Parameters
|
||||
* @return The Parameter value
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
T getParameter(String parameterName, Class<T> clazz) throws InvalidArgumentException;
|
||||
<T> T getParameter(String parameterName, Class<T> clazz) throws InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* Returns a representation of the Paging of collections of resources, with skip count and max items. See {@link Paging} Specified by the "skipCount" and "maxItems" request parameters.
|
||||
|
@@ -31,7 +31,6 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import org.apache.commons.beanutils.ConvertUtils;
|
||||
import org.apache.poi.ss.formula.functions.T;
|
||||
import org.springframework.extensions.webscripts.WebScriptRequest;
|
||||
|
||||
import org.alfresco.repo.content.MimetypeMap;
|
||||
@@ -231,7 +230,7 @@ public class Params implements Parameters
|
||||
}
|
||||
|
||||
@Override
|
||||
public T getParameter(String parameterName, Class<T> clazz) throws InvalidArgumentException
|
||||
public <T> T getParameter(String parameterName, Class<T> clazz) throws InvalidArgumentException
|
||||
{
|
||||
String param = getParameter(parameterName);
|
||||
if (param == null)
|
||||
@@ -239,7 +238,7 @@ public class Params implements Parameters
|
||||
Object obj = ConvertUtils.convert(param, clazz);
|
||||
if (obj != null && obj.getClass().equals(clazz))
|
||||
{
|
||||
return (T) obj;
|
||||
return clazz.cast(obj);
|
||||
}
|
||||
throw new InvalidArgumentException(InvalidArgumentException.DEFAULT_MESSAGE_ID, new Object[]{parameterName});
|
||||
}
|
||||
|
@@ -25,6 +25,8 @@
|
||||
*/
|
||||
package org.alfresco.rest.api.tests;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import org.alfresco.repo.web.util.JettyComponent;
|
||||
|
||||
public class EnterprisePublicApiTestFixture extends EnterpriseTestFixture
|
||||
@@ -40,32 +42,53 @@ public class EnterprisePublicApiTestFixture extends EnterpriseTestFixture
|
||||
public final static String[] CLASS_LOCATIONS = new String[]{"classpath*:/publicapi/lucene/"};
|
||||
|
||||
private static EnterprisePublicApiTestFixture instance;
|
||||
private String[] customConfigLocations;
|
||||
|
||||
/* Note: synchronized for multi-threaded test access */
|
||||
public synchronized static EnterprisePublicApiTestFixture getInstance(boolean createTestData) throws Exception
|
||||
public synchronized static EnterprisePublicApiTestFixture getInstance(boolean createTestData, String... customConfigLocations)
|
||||
{
|
||||
if (instance == null)
|
||||
{
|
||||
instance = new EnterprisePublicApiTestFixture();
|
||||
instance.setup(createTestData);
|
||||
instance = new EnterprisePublicApiTestFixture(customConfigLocations);
|
||||
try
|
||||
{
|
||||
instance.setup(createTestData);
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
String errorMessage = "Exception was thrown during setup EnterprisePublicApiTestFixture: " + e.getClass() + " - " + e.getMessage();
|
||||
throw new RuntimeException(errorMessage, e);
|
||||
}
|
||||
}
|
||||
return instance;
|
||||
}
|
||||
|
||||
public static EnterprisePublicApiTestFixture getInstance() throws Exception
|
||||
public static EnterprisePublicApiTestFixture getInstance(String... customConfigLocations)
|
||||
{
|
||||
return getInstance(true);
|
||||
return getInstance(true, customConfigLocations);
|
||||
}
|
||||
|
||||
private EnterprisePublicApiTestFixture()
|
||||
public static EnterprisePublicApiTestFixture getInstance()
|
||||
{
|
||||
return getInstance(true, null);
|
||||
}
|
||||
|
||||
public static EnterprisePublicApiTestFixture getInstance(boolean createTestData)
|
||||
{
|
||||
return getInstance(createTestData, null);
|
||||
}
|
||||
|
||||
private EnterprisePublicApiTestFixture(String... customConfigLocations)
|
||||
{
|
||||
super(CONFIG_LOCATIONS, CLASS_LOCATIONS, PORT, CONTEXT_PATH, PUBLIC_API_SERVLET_NAME, DEFAULT_NUM_MEMBERS_PER_SITE, false);
|
||||
this.customConfigLocations = customConfigLocations;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected JettyComponent makeJettyComponent()
|
||||
{
|
||||
JettyComponent jettyComponent = new EnterpriseJettyComponent(getPort(), getContextPath(), getConfigLocations(), getClassLocations());
|
||||
String[] configLocations = mergeLocations(getConfigLocations(), this.customConfigLocations);
|
||||
JettyComponent jettyComponent = new EnterpriseJettyComponent(getPort(), getContextPath(), configLocations, getClassLocations());
|
||||
return jettyComponent;
|
||||
}
|
||||
|
||||
@@ -74,4 +97,19 @@ public class EnterprisePublicApiTestFixture extends EnterpriseTestFixture
|
||||
{
|
||||
return new RepoService(applicationContext);
|
||||
}
|
||||
|
||||
private String[] mergeLocations(String[]... locations)
|
||||
{
|
||||
String[] mergedLocations = new String[0];
|
||||
for (String[] location : locations)
|
||||
{
|
||||
if (location == null || location.length == 0)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
mergedLocations = Arrays.copyOf(mergedLocations, mergedLocations.length + location.length);
|
||||
System.arraycopy(location, 0, mergedLocations, mergedLocations.length - location.length, location.length);
|
||||
}
|
||||
return mergedLocations;
|
||||
}
|
||||
}
|
||||
|
@@ -36,15 +36,21 @@ public class EnterpriseTestApi extends AbstractTestApi
|
||||
getTestFixture().getRandomNetwork();
|
||||
}
|
||||
|
||||
protected String[] getCustomConfigLocations()
|
||||
{
|
||||
return new String[]{};
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TestFixture getTestFixture() throws Exception
|
||||
{
|
||||
return EnterprisePublicApiTestFixture.getInstance();
|
||||
return EnterprisePublicApiTestFixture.getInstance(getCustomConfigLocations());
|
||||
}
|
||||
|
||||
@Override
|
||||
protected TestFixture getTestFixture(boolean createTestData) throws Exception
|
||||
{
|
||||
return EnterprisePublicApiTestFixture.getInstance(createTestData);
|
||||
return EnterprisePublicApiTestFixture.getInstance(createTestData, getCustomConfigLocations());
|
||||
}
|
||||
|
||||
}
|
||||
|
@@ -7,7 +7,7 @@
|
||||
<parent>
|
||||
<groupId>org.alfresco</groupId>
|
||||
<artifactId>alfresco-community-repo</artifactId>
|
||||
<version>25.3.0.17</version>
|
||||
<version>25.3.0.25-SNAPSHOT</version>
|
||||
</parent>
|
||||
|
||||
<dependencies>
|
||||
|
Reference in New Issue
Block a user