mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Created AuthenticationService-specific config for audit tests
- Makes for a clearer demonstration of API-based auditing git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@17693 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -178,8 +178,6 @@ public interface AuditComponent
|
||||
* @return Returns the values that were actually persisted, keyed by their full path.
|
||||
* @throws IllegalStateException if there is not a writable transaction present
|
||||
*
|
||||
* @see #startAuditSession()
|
||||
*
|
||||
* @since 3.2
|
||||
*/
|
||||
Map<String, Serializable> recordAuditValues(String rootPath, Map<String, Serializable> values);
|
||||
|
@@ -72,7 +72,7 @@ public class AuditComponentTest extends TestCase
|
||||
{
|
||||
private static final String APPLICATION_TEST = "Alfresco Test";
|
||||
private static final String APPLICATION_ACTIONS_TEST = "Actions Test";
|
||||
private static final String APPLICATION_API_TEST = "API Test";
|
||||
private static final String APPLICATION_API_TEST = "Test AuthenticationService";
|
||||
|
||||
private static final Log logger = LogFactory.getLog(AuditComponentTest.class);
|
||||
|
||||
@@ -454,12 +454,10 @@ public class AuditComponentTest extends TestCase
|
||||
|
||||
public void testAuditAuthenticationService() throws Exception
|
||||
{
|
||||
final Map<String, Serializable> expected = new HashMap<String, Serializable>();
|
||||
expected.put("/actions-test/actions/user", AuthenticationUtil.getFullyAuthenticatedUser());
|
||||
expected.put("/actions-test/actions/context-node/noderef", nodeRef);
|
||||
expected.put("/actions-test/actions/action-01/params/A/value", null);
|
||||
expected.put("/actions-test/actions/action-01/params/B/value", null);
|
||||
expected.put("/actions-test/actions/action-01/params/C/value", null);
|
||||
// Load in the config for this specific test: alfresco-audit-test-authenticationservice.xml
|
||||
URL testModelUrl = ResourceUtils.getURL("classpath:alfresco/audit/alfresco-audit-test-authenticationservice.xml");
|
||||
auditModelRegistry.registerModel(testModelUrl);
|
||||
auditModelRegistry.loadAuditModels();
|
||||
|
||||
final List<Map<String, Serializable>> results = new ArrayList<Map<String,Serializable>>();
|
||||
final StringBuilder sb = new StringBuilder();
|
||||
|
@@ -0,0 +1,36 @@
|
||||
<?xml version='1.0' encoding='UTF-8'?>
|
||||
|
||||
<!-- Default Audit Configuration -->
|
||||
|
||||
<Audit
|
||||
xmlns="http://www.alfresco.org/repo/audit/model/3.2"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://www.alfresco.org/repo/audit/model/3.2 alfresco-audit-3.2.xsd"
|
||||
>
|
||||
|
||||
<DataExtractors>
|
||||
<DataExtractor name="simpleValue" registeredName="auditModel.extractor.simpleValue"/>
|
||||
</DataExtractors>
|
||||
|
||||
<PathMappings>
|
||||
<PathMap source="/alfresco-api" target="/test-authenticationservice"/>
|
||||
</PathMappings>
|
||||
|
||||
<Application name="Test AuthenticationService" key="test-authenticationservice">
|
||||
<AuditPath key="post">
|
||||
<AuditPath key="AuthenticationService">
|
||||
<AuditPath key="authenticate">
|
||||
<AuditPath key="args">
|
||||
<AuditPath key="userName">
|
||||
<RecordValue key="value" dataExtractor="simpleValue"/>
|
||||
</AuditPath>
|
||||
</AuditPath>
|
||||
<AuditPath key="error">
|
||||
<RecordValue key="value" dataExtractor="simpleValue"/>
|
||||
</AuditPath>
|
||||
</AuditPath>
|
||||
</AuditPath>
|
||||
</AuditPath>
|
||||
</Application>
|
||||
|
||||
</Audit>
|
@@ -24,7 +24,6 @@
|
||||
<PathMap source="/test/one.one/two.two" target="/test/1.1/2.2"/>
|
||||
<PathMap source="/actions-test" target="/actions-test"/>
|
||||
<PathMap source="/actions-test/actions/action-01-mapped" target="/actions-test/actions/action-01"/>
|
||||
<PathMap source="/alfresco-api" target="/api-test"/>
|
||||
</PathMappings>
|
||||
|
||||
<Application name="Alfresco Test" key="test">
|
||||
@@ -96,21 +95,4 @@
|
||||
</AuditPath>
|
||||
</Application>
|
||||
|
||||
<Application name="API Test" key="api-test">
|
||||
<AuditPath key="post">
|
||||
<AuditPath key="AuthenticationService">
|
||||
<AuditPath key="authenticate">
|
||||
<AuditPath key="args">
|
||||
<AuditPath key="userName">
|
||||
<RecordValue key="value" dataExtractor="simpleValue"/>
|
||||
</AuditPath>
|
||||
</AuditPath>
|
||||
<AuditPath key="error">
|
||||
<RecordValue key="value" dataExtractor="simpleValue"/>
|
||||
</AuditPath>
|
||||
</AuditPath>
|
||||
</AuditPath>
|
||||
</AuditPath>
|
||||
</Application>
|
||||
|
||||
</Audit>
|
Reference in New Issue
Block a user