logging-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From rgo...@apache.org
Subject logging-log4j-audit git commit: Fix various issues
Date Sun, 12 Nov 2017 06:33:51 GMT
Repository: logging-log4j-audit
Updated Branches:
  refs/heads/master daf7287f8 -> f68980546


Fix various issues


Project: http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/repo
Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/commit/f6898054
Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/tree/f6898054
Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/diff/f6898054

Branch: refs/heads/master
Commit: f68980546adf4f1ddd74f0e69ec5cd6928fb8f56
Parents: daf7287
Author: Ralph Goers <rgoers@apache.org>
Authored: Sat Nov 11 23:33:45 2017 -0700
Committer: Ralph Goers <rgoers@apache.org>
Committed: Sat Nov 11 23:33:45 2017 -0700

----------------------------------------------------------------------
 .../audit/catalog/StringCatalogReader.java      |  5 +++
 .../logging/log4j/audit/service/Versions.java   | 26 ------------
 .../audit/service/config/WebMvcAppContext.java  |  8 +++-
 .../service/controller/AuditController.java     |  2 +-
 .../service/controller/CatalogController.java   |  2 +-
 .../log4j/audit/service/CatalogTest.java        | 42 +++++++++++++++++++-
 .../apache/logging/log4j/catalog/api/Event.java | 12 ++++--
 .../logging/log4j/catalog/api/Versions.java     | 16 +++++++-
 .../catalog/api/util/CatalogEventFilter.java    | 20 ++++++++++
 .../log4j/catalog/git/dao/GitCatalogDao.java    |  5 +++
 .../log4j/catalog/config/WebMvcAppContext.java  |  8 +++-
 pom.xml                                         |  2 +-
 12 files changed, 110 insertions(+), 38 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f6898054/log4j-audit/log4j-audit-api/src/test/java/org/apache/logging/log4j/audit/catalog/StringCatalogReader.java
----------------------------------------------------------------------
diff --git a/log4j-audit/log4j-audit-api/src/test/java/org/apache/logging/log4j/audit/catalog/StringCatalogReader.java
b/log4j-audit/log4j-audit-api/src/test/java/org/apache/logging/log4j/audit/catalog/StringCatalogReader.java
index cb45645..0ab2654 100644
--- a/log4j-audit/log4j-audit-api/src/test/java/org/apache/logging/log4j/audit/catalog/StringCatalogReader.java
+++ b/log4j-audit/log4j-audit-api/src/test/java/org/apache/logging/log4j/audit/catalog/StringCatalogReader.java
@@ -30,6 +30,7 @@ import java.util.Set;
 import com.fasterxml.jackson.core.JsonFactory;
 import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;
 import org.apache.logging.log4j.catalog.api.Attribute;
 import org.apache.logging.log4j.catalog.api.CatalogData;
 import org.apache.logging.log4j.catalog.api.Category;
@@ -41,6 +42,7 @@ import org.apache.logging.log4j.catalog.api.Product;
 import org.apache.logging.log4j.catalog.api.CatalogReader;
 import org.apache.logging.log4j.catalog.api.plugins.MinValueConstraint;
 import org.apache.logging.log4j.catalog.api.plugins.PatternConstraint;
+import org.apache.logging.log4j.catalog.api.util.CatalogEventFilter;
 import static org.junit.Assert.assertNotNull;
 
 /**
@@ -59,6 +61,9 @@ public class StringCatalogReader implements CatalogReader {
         JsonFactory factory = new JsonFactory();
         factory.enable(JsonParser.Feature.ALLOW_COMMENTS);
         ObjectMapper mapper = new ObjectMapper(factory);
+        SimpleFilterProvider filterProvider = new SimpleFilterProvider();
+        filterProvider.addFilter("catalogEvent", new CatalogEventFilter());
+        mapper.setFilterProvider(filterProvider);
         catalogData = createCatalogData();
         json = mapper.writerWithDefaultPrettyPrinter().writeValueAsString(catalogData);
         assertNotNull("No json catalog created", json);

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f6898054/log4j-audit/log4j-audit-war/src/main/java/org/apache/logging/log4j/audit/service/Versions.java
----------------------------------------------------------------------
diff --git a/log4j-audit/log4j-audit-war/src/main/java/org/apache/logging/log4j/audit/service/Versions.java
b/log4j-audit/log4j-audit-war/src/main/java/org/apache/logging/log4j/audit/service/Versions.java
deleted file mode 100644
index cdb4527..0000000
--- a/log4j-audit/log4j-audit-war/src/main/java/org/apache/logging/log4j/audit/service/Versions.java
+++ /dev/null
@@ -1,26 +0,0 @@
-/*
- * 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.logging.log4j.audit.service;
-
-import org.springframework.http.MediaType;
-
-public final class Versions {
-    public static final MediaType V1_0 = new MediaType("application", "vnd.apache.logging.log4j.audit-v1.0+json");
-    public static final String V1_0_VALUE = "application/vnd.apache.logging.log4j.audit-v1.0+json";
-
-    private Versions() { }
-}

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f6898054/log4j-audit/log4j-audit-war/src/main/java/org/apache/logging/log4j/audit/service/config/WebMvcAppContext.java
----------------------------------------------------------------------
diff --git a/log4j-audit/log4j-audit-war/src/main/java/org/apache/logging/log4j/audit/service/config/WebMvcAppContext.java
b/log4j-audit/log4j-audit-war/src/main/java/org/apache/logging/log4j/audit/service/config/WebMvcAppContext.java
index 332b744..7300ebd 100644
--- a/log4j-audit/log4j-audit-war/src/main/java/org/apache/logging/log4j/audit/service/config/WebMvcAppContext.java
+++ b/log4j-audit/log4j-audit-war/src/main/java/org/apache/logging/log4j/audit/service/config/WebMvcAppContext.java
@@ -22,6 +22,7 @@ import java.util.List;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
 
+import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.audit.AuditLogger;
@@ -32,6 +33,7 @@ import org.apache.logging.log4j.audit.util.JsonObjectMapperFactory;
 import org.apache.logging.log4j.catalog.api.dao.CatalogDao;
 import org.apache.logging.log4j.catalog.api.CatalogReader;
 import org.apache.logging.log4j.catalog.api.dao.ClassPathCatalogReader;
+import org.apache.logging.log4j.catalog.api.util.CatalogEventFilter;
 import org.apache.logging.log4j.catalog.git.dao.GitCatalogDao;
 import org.eclipse.jgit.transport.CredentialsProvider;
 import org.eclipse.jgit.transport.UsernamePasswordCredentialsProvider;
@@ -128,7 +130,11 @@ public class WebMvcAppContext extends WebMvcConfigurerAdapter {
 
     @Bean
     public ObjectMapper objectMapper() {
-        return JsonObjectMapperFactory.createMapper();
+        ObjectMapper mapper = JsonObjectMapperFactory.createMapper();
+        SimpleFilterProvider filterProvider = new SimpleFilterProvider();
+        filterProvider.addFilter("catalogEvent", new CatalogEventFilter());
+        mapper.setFilterProvider(filterProvider);
+        return mapper;
     }
 
     @Bean

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f6898054/log4j-audit/log4j-audit-war/src/main/java/org/apache/logging/log4j/audit/service/controller/AuditController.java
----------------------------------------------------------------------
diff --git a/log4j-audit/log4j-audit-war/src/main/java/org/apache/logging/log4j/audit/service/controller/AuditController.java
b/log4j-audit/log4j-audit-war/src/main/java/org/apache/logging/log4j/audit/service/controller/AuditController.java
index b005956..ccd7b73 100644
--- a/log4j-audit/log4j-audit-war/src/main/java/org/apache/logging/log4j/audit/service/controller/AuditController.java
+++ b/log4j-audit/log4j-audit-war/src/main/java/org/apache/logging/log4j/audit/service/controller/AuditController.java
@@ -24,8 +24,8 @@ import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.ThreadContext;
 import org.apache.logging.log4j.audit.AuditLogger;
-import org.apache.logging.log4j.audit.service.Versions;
 import org.apache.logging.log4j.audit.dto.AuditDto;
+import org.apache.logging.log4j.catalog.api.Versions;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.http.HttpStatus;
 import org.springframework.web.bind.annotation.PostMapping;

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f6898054/log4j-audit/log4j-audit-war/src/main/java/org/apache/logging/log4j/audit/service/controller/CatalogController.java
----------------------------------------------------------------------
diff --git a/log4j-audit/log4j-audit-war/src/main/java/org/apache/logging/log4j/audit/service/controller/CatalogController.java
b/log4j-audit/log4j-audit-war/src/main/java/org/apache/logging/log4j/audit/service/controller/CatalogController.java
index 48251be..0459d2f 100644
--- a/log4j-audit/log4j-audit-war/src/main/java/org/apache/logging/log4j/audit/service/controller/CatalogController.java
+++ b/log4j-audit/log4j-audit-war/src/main/java/org/apache/logging/log4j/audit/service/controller/CatalogController.java
@@ -137,7 +137,7 @@ public class CatalogController {
     }
 
     @ApiImplicitParams( {@ApiImplicitParam(dataType = "String", name = "Authorization", paramType
= "header")})
-    @ApiOperation(value = "Create a catalog Attribute", notes = "Creates a catalog attribute",
tags = {"Catalog"})
+    @ApiOperation(value = "Create a catalog Attribute", notes = "Returns a catalog attribute",
tags = {"Catalog"})
     @GetMapping(value = "{catalogId}/attribute/{name}")
     public ResponseEntity<Attribute> getAttribute(@ApiParam(value = "catalog id", required
= true) @PathVariable String catalogId,
                                                          @ApiParam(value = "attribute name",
required = true) @PathVariable String name) {

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f6898054/log4j-audit/log4j-audit-war/src/test/java/org/apache/logging/log4j/audit/service/CatalogTest.java
----------------------------------------------------------------------
diff --git a/log4j-audit/log4j-audit-war/src/test/java/org/apache/logging/log4j/audit/service/CatalogTest.java
b/log4j-audit/log4j-audit-war/src/test/java/org/apache/logging/log4j/audit/service/CatalogTest.java
index 4902aba..3ba26fb 100644
--- a/log4j-audit/log4j-audit-war/src/test/java/org/apache/logging/log4j/audit/service/CatalogTest.java
+++ b/log4j-audit/log4j-audit-war/src/test/java/org/apache/logging/log4j/audit/service/CatalogTest.java
@@ -1,12 +1,18 @@
 package org.apache.logging.log4j.audit.service;
 
+import java.util.ArrayList;
 import java.util.List;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
+import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;
 import com.fasterxml.jackson.databind.type.CollectionType;
 import com.fasterxml.jackson.databind.type.TypeFactory;
 import org.apache.logging.log4j.audit.service.config.WebMvcAppContext;
 import org.apache.logging.log4j.catalog.api.Attribute;
+import org.apache.logging.log4j.catalog.api.Event;
+import org.apache.logging.log4j.catalog.api.EventAttribute;
+import org.apache.logging.log4j.catalog.api.Versions;
+import org.apache.logging.log4j.catalog.api.util.CatalogEventFilter;
 import org.junit.Before;
 import org.junit.Test;
 import org.junit.runner.RunWith;
@@ -21,6 +27,7 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders;
 import org.springframework.web.context.WebApplicationContext;
 
 import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.get;
+import static org.springframework.test.web.servlet.request.MockMvcRequestBuilders.post;
 import static org.springframework.test.web.servlet.result.MockMvcResultMatchers.status;
 import static org.junit.Assert.*;
 
@@ -40,7 +47,7 @@ public class CatalogTest {
     }
 
     @Test
-    public void testCreationOfANewProjectSucceeds() throws Exception {
+    public void testCatalogAPI() throws Exception {
 
         String result = mockMvc.perform(
                 get("/catalog/TEST/attributes")
@@ -64,5 +71,38 @@ public class CatalogTest {
         attributes = objectMapper.readValue(result, typeReference);
         assertNotNull("Result is not a list", attributes);
         assertEquals("Incorrect number of attributes in list", 10, attributes.size());
+        result = mockMvc.perform( get("/catalog/DEFAULT/events").accept(Versions.V1_0))
+                .andExpect(status().is(HttpStatus.OK.value()))
+                .andReturn().getResponse().getContentAsString();
+        assertNotNull("No result returned for DEFAULT catalog", result);
+        typeReference = TypeFactory.defaultInstance().constructCollectionType(List.class,
Event.class);
+        List<Event> events = objectMapper.readValue(result, typeReference);
+        assertNotNull("Result is not a list", events);
+        assertEquals("Incorrect number of events in list", 4, events.size());
+        Event event = new Event();
+        event.setName("createUser");
+        event.setDescription("Create a User");
+        event.setCatalogId("TEST");
+        event.setDisplayName("Create User");
+        List<EventAttribute> eventAttributes = new ArrayList<>();
+        EventAttribute eventAttribute = new EventAttribute();
+        eventAttribute.setName("loginId");
+        eventAttribute.setRequired(true);
+        eventAttributes.add(eventAttribute);
+        eventAttribute = new EventAttribute();
+        eventAttribute.setName("userId");
+        eventAttribute.setRequired(true);
+        eventAttributes.add(eventAttribute);
+        event.setAttributes(eventAttributes);
+        ObjectMapper mapper = new ObjectMapper();
+        SimpleFilterProvider filterProvider = new SimpleFilterProvider();
+        filterProvider.addFilter("catalogEvent", new CatalogEventFilter());
+        mapper.setFilterProvider(filterProvider);
+        String json = mapper.writeValueAsString(event);
+        result = mockMvc.perform(post("/catalog/event").content(json).accept(Versions.V1_0).contentType(Versions.V1_0))
+                .andExpect(status().is(HttpStatus.CREATED.value()))
+                .andReturn().getResponse().getContentAsString();
+        assertNotNull("No content returned from create user", result);
+        assertTrue("Missing catalog id", result.contains("\"catalogId\":\"TEST\""));
     }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f6898054/log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/Event.java
----------------------------------------------------------------------
diff --git a/log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/Event.java
b/log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/Event.java
index 0809312..8328791 100644
--- a/log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/Event.java
+++ b/log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/Event.java
@@ -20,13 +20,15 @@ import java.io.Serializable;
 import java.util.List;
 import java.util.Set;
 
-import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonFilter;
+import com.fasterxml.jackson.annotation.JsonProperty;
 
 import static org.apache.logging.log4j.catalog.api.constant.Constants.DEFAULT_CATALOG;
 
 /**
  * Basic attributes common to all events.
  */
+@JsonFilter("catalogEvent")
 public class Event implements Serializable {
 
     private static final long serialVersionUID = 1512172827909901054L;
@@ -35,7 +37,6 @@ public class Event implements Serializable {
     private String displayName;
     private String description;
     private Set<String> aliases;
-    @JsonIgnore
     private String catalogId;
     private List<EventAttribute> attributes;
 
@@ -128,8 +129,11 @@ public class Event implements Serializable {
      * Set the catalog id this Event is associated with.
      * @param catalogId The catalog id or null.
      */
-    public void setCatalogId(String catalogId) {
-        this.catalogId = catalogId;
+    public Event setCatalogId(String catalogId) {
+        if (catalogId != null) {
+            this.catalogId = catalogId;
+        }
+        return this;
     }
 
     /**

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f6898054/log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/Versions.java
----------------------------------------------------------------------
diff --git a/log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/Versions.java
b/log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/Versions.java
index 6d824f1..78f07f0 100644
--- a/log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/Versions.java
+++ b/log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/Versions.java
@@ -16,11 +16,23 @@
  */
 package org.apache.logging.log4j.catalog.api;
 
+import java.util.HashMap;
+import java.util.Map;
+
 import org.springframework.http.MediaType;
 
 public final class Versions {
-    public static final MediaType V1_0 = new MediaType("application", "vnd.nextiva.license-v1.0+json");
-    public static final String V1_0_VALUE = "application/vnd.nextiva.license-v1.0+json";
+
+    private static final String type = "application";
+    private static final String subType = "vnd.apache.logging.log4j.audit+json";
+    private static final String versionKey = "version";
+    private static final String version1 = "1.0";
+    private static final Map<String, String> V1Parameters = new HashMap<>();
+    static {
+        V1Parameters.put(versionKey, version1);
+    }
+    public static final MediaType V1_0 = new MediaType(type, subType, V1Parameters);
+    public static final String V1_0_VALUE = type + "/" + subType + "; " + versionKey + "=\""
+ version1 +"\"";
 
     private Versions() { }
 }

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f6898054/log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/util/CatalogEventFilter.java
----------------------------------------------------------------------
diff --git a/log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/util/CatalogEventFilter.java
b/log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/util/CatalogEventFilter.java
new file mode 100644
index 0000000..fb8b1e9
--- /dev/null
+++ b/log4j-catalog/log4j-catalog-api/src/main/java/org/apache/logging/log4j/catalog/api/util/CatalogEventFilter.java
@@ -0,0 +1,20 @@
+package org.apache.logging.log4j.catalog.api.util;
+
+import com.fasterxml.jackson.core.JsonGenerator;
+import com.fasterxml.jackson.databind.SerializerProvider;
+import com.fasterxml.jackson.databind.ser.PropertyWriter;
+import com.fasterxml.jackson.databind.ser.impl.SimpleBeanPropertyFilter;
+import org.apache.logging.log4j.catalog.api.Event;
+
+import static org.apache.logging.log4j.catalog.api.constant.Constants.DEFAULT_CATALOG;
+
+public class CatalogEventFilter extends SimpleBeanPropertyFilter {
+
+    @Override
+    public void serializeAsField(Object pojo, JsonGenerator jgen, SerializerProvider provider,
PropertyWriter writer) throws Exception {
+        if (writer.getName().equals("catalogId") && DEFAULT_CATALOG.equals(((Event)pojo).getCatalogId()))
{
+            return;
+        }
+        super.serializeAsField(pojo, jgen, provider, writer);
+    }
+}

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f6898054/log4j-catalog/log4j-catalog-git/src/main/java/org/apache/logging/log4j/catalog/git/dao/GitCatalogDao.java
----------------------------------------------------------------------
diff --git a/log4j-catalog/log4j-catalog-git/src/main/java/org/apache/logging/log4j/catalog/git/dao/GitCatalogDao.java
b/log4j-catalog/log4j-catalog-git/src/main/java/org/apache/logging/log4j/catalog/git/dao/GitCatalogDao.java
index 601a93b..d2691dd 100644
--- a/log4j-catalog/log4j-catalog-git/src/main/java/org/apache/logging/log4j/catalog/git/dao/GitCatalogDao.java
+++ b/log4j-catalog/log4j-catalog-git/src/main/java/org/apache/logging/log4j/catalog/git/dao/GitCatalogDao.java
@@ -27,6 +27,7 @@ import com.fasterxml.jackson.core.JsonFactory;
 import com.fasterxml.jackson.core.JsonParser;
 import com.fasterxml.jackson.databind.ObjectMapper;
 import com.fasterxml.jackson.databind.SerializationFeature;
+import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;
 import org.apache.logging.log4j.LogManager;
 import org.apache.logging.log4j.Logger;
 import org.apache.logging.log4j.catalog.api.CatalogData;
@@ -35,6 +36,7 @@ import org.apache.logging.log4j.catalog.api.dao.CatalogDao;
 import org.apache.logging.log4j.catalog.api.exception.CatalogModificationException;
 import org.apache.logging.log4j.catalog.api.exception.CatalogReadException;
 import org.apache.logging.log4j.catalog.api.exception.CatalogNotFoundException;
+import org.apache.logging.log4j.catalog.api.util.CatalogEventFilter;
 import org.eclipse.jgit.api.CloneCommand;
 import org.eclipse.jgit.api.Git;
 import org.eclipse.jgit.api.PullCommand;
@@ -65,6 +67,9 @@ public class GitCatalogDao extends AbstractCatalogReader implements CatalogDao
{
         JsonFactory factory = new JsonFactory();
         factory.enable(JsonParser.Feature.ALLOW_COMMENTS);
         mapper = new ObjectMapper(factory).enable(SerializationFeature.INDENT_OUTPUT);
+        SimpleFilterProvider filterProvider = new SimpleFilterProvider();
+        filterProvider.addFilter("catalogEvent", new CatalogEventFilter());
+        mapper.setFilterProvider(filterProvider);
     }
 
     public CredentialsProvider getCredentialsProvider() {

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f6898054/log4j-catalog/log4j-catalog-war/src/main/java/org/apache/logging/log4j/catalog/config/WebMvcAppContext.java
----------------------------------------------------------------------
diff --git a/log4j-catalog/log4j-catalog-war/src/main/java/org/apache/logging/log4j/catalog/config/WebMvcAppContext.java
b/log4j-catalog/log4j-catalog-war/src/main/java/org/apache/logging/log4j/catalog/config/WebMvcAppContext.java
index e441057..242fb79 100644
--- a/log4j-catalog/log4j-catalog-war/src/main/java/org/apache/logging/log4j/catalog/config/WebMvcAppContext.java
+++ b/log4j-catalog/log4j-catalog-war/src/main/java/org/apache/logging/log4j/catalog/config/WebMvcAppContext.java
@@ -22,11 +22,13 @@ import java.util.List;
 
 import com.fasterxml.jackson.databind.ObjectMapper;
 
+import com.fasterxml.jackson.databind.ser.impl.SimpleFilterProvider;
 import com.jcraft.jsch.JSch;
 import com.jcraft.jsch.JSchException;
 import com.jcraft.jsch.Session;
 import com.jcraft.jsch.UserInfo;
 import org.apache.logging.log4j.catalog.api.dao.CatalogDao;
+import org.apache.logging.log4j.catalog.api.util.CatalogEventFilter;
 import org.apache.logging.log4j.catalog.git.dao.GitCatalogDao;
 import org.apache.logging.log4j.catalog.security.LocalAuthorizationInterceptor;
 import org.eclipse.jgit.api.TransportConfigCallback;
@@ -160,7 +162,11 @@ public class WebMvcAppContext extends WebMvcConfigurerAdapter implements
Applica
 
     @Bean
     public ObjectMapper objectMapper() {
-        return JsonObjectMapperFactory.createMapper();
+        ObjectMapper mapper = JsonObjectMapperFactory.createMapper();
+        SimpleFilterProvider filterProvider = new SimpleFilterProvider();
+        filterProvider.addFilter("catalogEvent", new CatalogEventFilter());
+        mapper.setFilterProvider(filterProvider);
+        return mapper;
     }
 
     @Bean

http://git-wip-us.apache.org/repos/asf/logging-log4j-audit/blob/f6898054/pom.xml
----------------------------------------------------------------------
diff --git a/pom.xml b/pom.xml
index 9e02912..e778018 100644
--- a/pom.xml
+++ b/pom.xml
@@ -154,7 +154,7 @@
     <scm.plugin.version>1.9.4</scm.plugin.version>
     <site.plugin.version>3.4</site.plugin.version>
     <slf4j.version>1.8.0-alpha2</slf4j.version>
-    <spring.version>4.3.3.RELEASE</spring.version>
+    <spring.version>4.3.11.RELEASE</spring.version>
     <spring.agent.version>2.5.6</spring.agent.version>
     <spring.data.jpa.version>1.11.1.RELEASE</spring.data.jpa.version>
     <spring.data.redis.version>1.8.3.RELEASE</spring.data.redis.version>


Mime
View raw message