Skip to content

Commit cd81ee8

Browse files
artursouzasnyk-bot
andauthored
[Snyk] Fix for 9 vulnerabilities (#1008)
* fix: examples/pom.xml to reduce vulnerabilities The following vulnerabilities are fixed with an upgrade: - https://snyk.io/vuln/SNYK-JAVA-CHQOSLOGBACK-6094942 - https://snyk.io/vuln/SNYK-JAVA-CHQOSLOGBACK-6094943 - https://snyk.io/vuln/SNYK-JAVA-CHQOSLOGBACK-6097492 - https://snyk.io/vuln/SNYK-JAVA-CHQOSLOGBACK-6097493 - https://snyk.io/vuln/SNYK-JAVA-COMJAYWAYJSONPATH-6140361 - https://snyk.io/vuln/SNYK-JAVA-NETMINIDEV-1078499 - https://snyk.io/vuln/SNYK-JAVA-NETMINIDEV-1298655 - https://snyk.io/vuln/SNYK-JAVA-NETMINIDEV-3369748 - https://snyk.io/vuln/SNYK-JAVA-ORGYAML-3152153 Signed-off-by: Artur Souza <[email protected]> * Fix Examples not to depend on Springboot version for json path. Signed-off-by: Artur Souza <[email protected]> * Fix new required dependencies. Signed-off-by: Artur Souza <[email protected]> --------- Signed-off-by: Artur Souza <[email protected]> Co-authored-by: snyk-bot <[email protected]>
1 parent b2968af commit cd81ee8

File tree

3 files changed

+17
-10
lines changed

3 files changed

+17
-10
lines changed

examples/pom.xml

+12-2
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<maven.deploy.skip>true</maven.deploy.skip>
2525
<spotbugs.fail>false</spotbugs.fail>
2626
<opentelemetry.version>0.14.0</opentelemetry.version>
27-
<springboot.version>3.0.13</springboot.version>
27+
<springboot.version>3.2.0</springboot.version>
2828
</properties>
2929

3030
<dependencies>
@@ -77,7 +77,7 @@
7777
<dependency>
7878
<groupId>com.jayway.jsonpath</groupId>
7979
<artifactId>json-path</artifactId>
80-
<version>2.4.0</version>
80+
<version>2.9.0</version>
8181
</dependency>
8282
<dependency>
8383
<groupId>io.opentelemetry</groupId>
@@ -140,6 +140,16 @@
140140
<artifactId>javax.annotation-api</artifactId>
141141
<version>1.3.2</version>
142142
</dependency>
143+
<dependency>
144+
<groupId>org.springframework</groupId>
145+
<artifactId>spring-context</artifactId>
146+
<version>6.1.1</version>
147+
</dependency>
148+
<dependency>
149+
<groupId>org.springframework</groupId>
150+
<artifactId>spring-core</artifactId>
151+
<version>6.1.1</version>
152+
</dependency>
143153
</dependencies>
144154

145155
<build>

examples/src/main/java/io/dapr/examples/tracing/Validation.java

+4-7
Original file line numberDiff line numberDiff line change
@@ -19,16 +19,13 @@
1919
import com.evanlennick.retry4j.config.RetryConfigBuilder;
2020
import com.jayway.jsonpath.DocumentContext;
2121
import com.jayway.jsonpath.JsonPath;
22-
import net.minidev.json.JSONArray;
2322
import okhttp3.HttpUrl;
2423
import okhttp3.OkHttpClient;
2524
import okhttp3.Request;
2625
import okhttp3.Response;
2726

28-
import java.text.DateFormat;
29-
import java.text.SimpleDateFormat;
30-
import java.util.Calendar;
31-
import java.util.TimeZone;
27+
import java.util.List;
28+
import java.util.Map;
3229

3330
import static java.time.temporal.ChronoUnit.SECONDS;
3431

@@ -112,7 +109,7 @@ private static Void doValidate() throws Exception {
112109
}
113110

114111
private static Object readOne(DocumentContext documentContext, String path) {
115-
JSONArray arr = documentContext.read(path);
112+
List<Map<String, Object>> arr = documentContext.read(path);
116113
if (arr.size() == 0) {
117114
throw new RuntimeException("No record found for " + path);
118115
}
@@ -121,7 +118,7 @@ private static Object readOne(DocumentContext documentContext, String path) {
121118
}
122119

123120
private static void assertCount(DocumentContext documentContext, String path, int expectedCount) {
124-
JSONArray arr = documentContext.read(path);
121+
List<Map<String, Object>> arr = documentContext.read(path);
125122
if (arr.size() != expectedCount) {
126123
throw new RuntimeException(
127124
String.format("Unexpected count %d vs expected %d for %s", arr.size(), expectedCount, path));

pom.xml

+1-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
which conflict with dapr-sdk's jackson dependencies
3131
https://github.com/microsoft/durabletask-java/blob/main/client/build.gradle#L16
3232
-->
33-
<jackson.version>2.12.3</jackson.version>
33+
<jackson.version>2.16.1</jackson.version>
3434
<gpg.skip>true</gpg.skip>
3535
<spotbugs.fail>true</spotbugs.fail>
3636
<spotbugs.exclude.filter.file>../spotbugs-exclude.xml</spotbugs.exclude.filter.file>

0 commit comments

Comments
 (0)