mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-10-08 14:51:49 +00:00
Merged HEAD-BUG-FIX (5.1/Cloud) to HEAD (5.1/Cloud)
107473: Merged 5.0.N (5.0.3) to HEAD-BUG-FIX (5.1/Cloud) 107427: Merged V4.2-BUG-FIX (4.2.5) to 5.0.N (5.0.3) 107196: Merged DEV to V4.2-BUG-FIX (4.2.5) 107066: MNT-14136: Audit filter for alfresco-access/login does not work. - Added extracted audit data validation with a filter. - Added JUnit test. git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@107625 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2005-2014 Alfresco Software Limited.
|
||||
* Copyright (C) 2005-2015 Alfresco Software Limited.
|
||||
*
|
||||
* This file is part of Alfresco
|
||||
*
|
||||
@@ -806,7 +806,20 @@ public class AuditComponentImpl implements AuditComponent
|
||||
Map<String, DataGenerator> generators = application.getDataGenerators(generatorKeys);
|
||||
Map<String, Serializable> auditData = generateData(generators);
|
||||
|
||||
// MNT-8401
|
||||
// Now extract values
|
||||
Map<String, Serializable> extractedData = AuthenticationUtil.runAs(new RunAsWork<Map<String, Serializable>>()
|
||||
{
|
||||
public Map<String, Serializable> doWork() throws Exception
|
||||
{
|
||||
return extractData(application, values);
|
||||
}
|
||||
}, AuthenticationUtil.getSystemUserName());
|
||||
|
||||
// Combine extracted and generated values (extracted data takes precedence)
|
||||
auditData.putAll(extractedData);
|
||||
|
||||
// Filter data
|
||||
// See MNT-14136, MNT-8401
|
||||
for (Map.Entry<String, Serializable> value : auditData.entrySet())
|
||||
{
|
||||
String root = value.getKey();
|
||||
@@ -819,18 +832,6 @@ public class AuditComponentImpl implements AuditComponent
|
||||
}
|
||||
}
|
||||
|
||||
// Now extract values
|
||||
Map<String, Serializable> extractedData = AuthenticationUtil.runAs(new RunAsWork<Map<String, Serializable>>()
|
||||
{
|
||||
public Map<String, Serializable> doWork() throws Exception
|
||||
{
|
||||
return extractData(application, values);
|
||||
}
|
||||
}, AuthenticationUtil.getSystemUserName());
|
||||
|
||||
// Combine extracted and generated values (extracted data takes precedence)
|
||||
auditData.putAll(extractedData);
|
||||
|
||||
// Time and username are intrinsic
|
||||
long time = System.currentTimeMillis();
|
||||
String username = AuthenticationUtil.getFullyAuthenticatedUser();
|
||||
|
Reference in New Issue
Block a user