[ACS-3006] Revert changes made to implement a validation logic (#1139)

* Revert "ACS-2744 Private action validation logic (#1051)"

This reverts commit 64998b5c53.

* Revert "[ACS-2747] Prevent private action execution from the V1 HTTP API. Added end-to-end test method. (#1108)"

This reverts commit 8edfd4bdce.
This commit is contained in:
Kacper Magdziarz
2022-05-30 13:18:44 +02:00
committed by GitHub
parent e1b6203cdc
commit b7bd6aa215
11 changed files with 17 additions and 534 deletions

View File

@@ -11,7 +11,6 @@ import org.alfresco.rest.model.RestActionDefinitionModelsCollection;
import org.alfresco.rest.model.RestNodeModel;
import org.alfresco.utility.Utility;
import org.alfresco.utility.model.FileModel;
import org.alfresco.utility.model.FolderModel;
import org.alfresco.utility.model.SiteModel;
import org.alfresco.utility.model.TestGroup;
import org.alfresco.utility.model.UserModel;
@@ -22,14 +21,10 @@ import org.springframework.http.HttpStatus;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;
import java.util.Properties;
public class ActionsTests extends RestTest
{
private UserModel adminUser;
private FileModel document;
private FolderModel folder;
private FileModel randomFile;
private SiteModel publicSite;
@BeforeClass(alwaysRun = true)
@@ -38,8 +33,6 @@ public class ActionsTests extends RestTest
adminUser = dataUser.getAdminUser();
publicSite = dataSite.createPublicRandomSite();
document = dataContent.usingSite(publicSite).usingUser(adminUser).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
folder = dataContent.usingUser(adminUser).createFolder();
randomFile = dataContent.usingUser(adminUser).usingResource(folder).createContent(CMISUtil.DocumentType.TEXT_PLAIN);
}
@TestRail(section = { TestGroup.REST_API,TestGroup.ACTIONS }, executionType = ExecutionType.SANITY,
@@ -113,22 +106,6 @@ public class ActionsTests extends RestTest
});
}
@TestRail(section = { TestGroup.REST_API,TestGroup.ACTIONS }, executionType = ExecutionType.SANITY,
description = "Test for private action execution from POST api/-default-/public/alfresco/versions/1/action-executions, should not be possible to execute private action using V1 REST API")
@Test(groups = { TestGroup.REST_API, TestGroup.ACTIONS, TestGroup.SANITY})
public void executePrivateActionV1RESTAPI() throws Exception
{
// 'count-children' action is expected to be private (not exposed) by default
String actionDefinitionId = "count-children";
JSONObject response = restClient.authenticateUser(adminUser)
.withCoreAPI()
.usingActions()
.executeAction(actionDefinitionId, folder);
restClient.assertStatusCodeIs(HttpStatus.FORBIDDEN);
restClient.assertLastError().containsSummary("Action '" + actionDefinitionId + "' is not exposed within 'http-v1' execution source.");
}
@TestRail (section = { TestGroup.REST_API, TestGroup.ACTIONS }, executionType = ExecutionType.SANITY,
description = "Sanity test for POST /action-executions")
@Test (groups = { TestGroup.REST_API, TestGroup.ACTIONS, TestGroup.SANITY })
@@ -164,7 +141,7 @@ public class ActionsTests extends RestTest
withCoreAPI().
usingActions().
getActionDefinitionById("add-features");
restClient.assertStatusCodeIs(HttpStatus.OK);
assertFalse(restActionDefinition.getId().isEmpty());
restActionDefinition.getId().equals("add-features");