Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| caea64a9bf | |||
| 90369a4cd1 | |||
| e29228a84b | |||
| cd13fb8e15 | |||
| 915034315c |
36
pom.xml
36
pom.xml
@@ -6,7 +6,7 @@
|
|||||||
<groupId>com.mattrixwv.cipherstream</groupId>
|
<groupId>com.mattrixwv.cipherstream</groupId>
|
||||||
<artifactId>cipherstream-api</artifactId>
|
<artifactId>cipherstream-api</artifactId>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<version>1.1.7</version>
|
<version>1.1.9</version>
|
||||||
<name>CipherStream API</name>
|
<name>CipherStream API</name>
|
||||||
<url>https://api.cipherstream.mattrixwv.com</url>
|
<url>https://api.cipherstream.mattrixwv.com</url>
|
||||||
|
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
<parent>
|
<parent>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
<artifactId>spring-boot-starter-parent</artifactId>
|
<artifactId>spring-boot-starter-parent</artifactId>
|
||||||
<version>3.4.2</version>
|
<version>3.5.4</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
@@ -56,7 +56,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
<version>1.18.36</version>
|
<version>1.18.38</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
@@ -64,7 +64,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
<version>2.0.16</version>
|
<version>2.0.17</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.springframework.boot</groupId>
|
<groupId>org.springframework.boot</groupId>
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.apache.logging.log4j</groupId>
|
<groupId>org.apache.logging.log4j</groupId>
|
||||||
<artifactId>log4j-layout-template-json</artifactId>
|
<artifactId>log4j-layout-template-json</artifactId>
|
||||||
<version>2.24.3</version>
|
<version>2.25.1</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.lmax</groupId>
|
<groupId>com.lmax</groupId>
|
||||||
@@ -85,14 +85,14 @@
|
|||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.aspectj</groupId>
|
<groupId>org.aspectj</groupId>
|
||||||
<artifactId>aspectjweaver</artifactId>
|
<artifactId>aspectjweaver</artifactId>
|
||||||
<version>1.9.22.1</version>
|
<version>1.9.24</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--My libraries-->
|
<!--My libraries-->
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.mattrixwv</groupId>
|
<groupId>com.mattrixwv</groupId>
|
||||||
<artifactId>cipher-stream-java</artifactId>
|
<artifactId>cipher-stream-java</artifactId>
|
||||||
<version>1.3.7</version>
|
<version>1.3.8</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<!--Tests-->
|
<!--Tests-->
|
||||||
@@ -125,7 +125,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-enforcer-plugin</artifactId>
|
<artifactId>maven-enforcer-plugin</artifactId>
|
||||||
<version>3.5.0</version>
|
<version>3.6.1</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<id>enforce-maven</id>
|
<id>enforce-maven</id>
|
||||||
@@ -145,7 +145,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-clean-plugin</artifactId>
|
<artifactId>maven-clean-plugin</artifactId>
|
||||||
<version>3.4.0</version>
|
<version>3.5.0</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
@@ -155,7 +155,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-compiler-plugin</artifactId>
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
<version>3.13.0</version>
|
<version>3.14.0</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<compilerArgs>
|
<compilerArgs>
|
||||||
<arg>-Xlint:all</arg>
|
<arg>-Xlint:all</arg>
|
||||||
@@ -167,7 +167,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-surefire-plugin</artifactId>
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
<version>3.5.2</version>
|
<version>3.5.3</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<skipTests>${skip.unit.tests}</skipTests>
|
<skipTests>${skip.unit.tests}</skipTests>
|
||||||
<excludes>
|
<excludes>
|
||||||
@@ -186,17 +186,17 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-install-plugin</artifactId>
|
<artifactId>maven-install-plugin</artifactId>
|
||||||
<version>3.1.3</version>
|
<version>3.1.4</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-deploy-plugin</artifactId>
|
<artifactId>maven-deploy-plugin</artifactId>
|
||||||
<version>3.1.3</version>
|
<version>3.1.4</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-failsafe-plugin</artifactId>
|
<artifactId>maven-failsafe-plugin</artifactId>
|
||||||
<version>3.5.2</version>
|
<version>3.5.3</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<configuration>
|
<configuration>
|
||||||
@@ -219,7 +219,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-project-info-reports-plugin</artifactId>
|
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||||
<version>3.8.0</version>
|
<version>3.9.0</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.codehaus.mojo</groupId>
|
<groupId>org.codehaus.mojo</groupId>
|
||||||
@@ -233,12 +233,12 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.sonarsource.scanner.maven</groupId>
|
<groupId>org.sonarsource.scanner.maven</groupId>
|
||||||
<artifactId>sonar-maven-plugin</artifactId>
|
<artifactId>sonar-maven-plugin</artifactId>
|
||||||
<version>5.0.0.4389</version>
|
<version>5.1.0.4751</version>
|
||||||
</plugin>
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.jacoco</groupId>
|
<groupId>org.jacoco</groupId>
|
||||||
<artifactId>jacoco-maven-plugin</artifactId>
|
<artifactId>jacoco-maven-plugin</artifactId>
|
||||||
<version>0.8.12</version>
|
<version>0.8.13</version>
|
||||||
<configuration>
|
<configuration>
|
||||||
<excludes>
|
<excludes>
|
||||||
<exclude>**/CipherStreamAPI*</exclude>
|
<exclude>**/CipherStreamAPI*</exclude>
|
||||||
@@ -264,7 +264,7 @@
|
|||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.owasp</groupId>
|
<groupId>org.owasp</groupId>
|
||||||
<artifactId>dependency-check-maven</artifactId>
|
<artifactId>dependency-check-maven</artifactId>
|
||||||
<version>12.1.0</version>
|
<version>12.1.3</version>
|
||||||
<executions>
|
<executions>
|
||||||
<execution>
|
<execution>
|
||||||
<phase>none</phase>
|
<phase>none</phase>
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ public class CipherStreamLoggingAspect{
|
|||||||
@AfterReturning(pointcut = "cipherMethod() && postFunction()", returning = "returnedJson")
|
@AfterReturning(pointcut = "cipherMethod() && postFunction()", returning = "returnedJson")
|
||||||
public void getCipherInfo(ObjectNode returnedJson){
|
public void getCipherInfo(ObjectNode returnedJson){
|
||||||
//Extract JSON to MDC
|
//Extract JSON to MDC
|
||||||
returnedJson.fields().forEachRemaining(entry -> {
|
returnedJson.properties().forEach(entry -> {
|
||||||
if(entry.getValue().isTextual()){
|
if(entry.getValue().isTextual()){
|
||||||
MDC.put(entry.getKey(), entry.getValue().asText());
|
MDC.put(entry.getKey(), entry.getValue().asText());
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ package com.mattrixwv.cipherstream.config;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.StringJoiner;
|
import java.util.StringJoiner;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
import org.slf4j.MDC;
|
import org.slf4j.MDC;
|
||||||
import org.springframework.lang.NonNull;
|
import org.springframework.lang.NonNull;
|
||||||
@@ -37,6 +38,9 @@ public class FullFilter extends OncePerRequestFilter{
|
|||||||
if(request.getHeader("X-Request-Id") != null){
|
if(request.getHeader("X-Request-Id") != null){
|
||||||
MDC.put("requestId", request.getHeader("X-Request-Id"));
|
MDC.put("requestId", request.getHeader("X-Request-Id"));
|
||||||
}
|
}
|
||||||
|
else{
|
||||||
|
MDC.put("requestId", UUID.randomUUID().toString());
|
||||||
|
}
|
||||||
|
|
||||||
//Get IP address
|
//Get IP address
|
||||||
if(request.getHeader("X-Forwarded-For") != null){
|
if(request.getHeader("X-Forwarded-For") != null){
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"msg_timestamp": {
|
"timestamp": {
|
||||||
"$resolver": "timestamp",
|
"$resolver": "timestamp",
|
||||||
"pattern": {
|
"pattern": {
|
||||||
"format": "yyyy-MM-dd HH:mm:ss.SSSZ"
|
"format": "yyyy-MM-dd HH:mm:ss.SSSZ"
|
||||||
@@ -9,10 +9,6 @@
|
|||||||
"$resolver": "level",
|
"$resolver": "level",
|
||||||
"field": "name"
|
"field": "name"
|
||||||
},
|
},
|
||||||
"requestId": {
|
|
||||||
"$resolver": "mdc",
|
|
||||||
"key": "requestId"
|
|
||||||
},
|
|
||||||
"logger": {
|
"logger": {
|
||||||
"$resolver": "logger",
|
"$resolver": "logger",
|
||||||
"field": "name"
|
"field": "name"
|
||||||
|
|||||||
@@ -56,7 +56,7 @@ public class CipherStreamControllerIntegrationTestBase{
|
|||||||
|
|
||||||
protected void verifyAspectLogging(ObjectNode jsonNode){
|
protected void verifyAspectLogging(ObjectNode jsonNode){
|
||||||
//Verify the MDC
|
//Verify the MDC
|
||||||
jsonNode.fields().forEachRemaining(entry -> {
|
jsonNode.properties().forEach(entry -> {
|
||||||
if(entry.getValue().isTextual()){
|
if(entry.getValue().isTextual()){
|
||||||
verify(mdc, times(1)).put(entry.getKey(), entry.getValue().asText());
|
verify(mdc, times(1)).put(entry.getKey(), entry.getValue().asText());
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user