Skip to content

Commit cc27573

Browse files
chore: clean up vulnerabilities (#160)
* clean up vulnerabilities * docs * update document store version
1 parent ed4d0db commit cc27573

10 files changed

Lines changed: 118 additions & 125 deletions

File tree

config-service/build.gradle.kts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ dependencies {
6363

6464
// Integration test dependencies
6565
integrationTestImplementation(projects.configServiceImpl)
66+
integrationTestImplementation(projects.configProtoConverter)
6667
integrationTestImplementation(libs.junit.jupiter)
6768
integrationTestImplementation(libs.guava)
68-
integrationTestImplementation(libs.snakeyaml)
6969
integrationTestImplementation(libs.hypertrace.framework.integrationtest)
7070
integrationTestImplementation(libs.hypertrace.grpcutils.client)
7171
integrationTestImplementation(libs.hypertrace.grpcutils.context)

config-service/src/integrationTest/java/org/hypertrace/config/service/ConfigServiceIntegrationTest.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,9 +77,9 @@ public static void setup() throws IOException {
7777
.withCallCredentials(
7878
RequestContextClientCallCredsProviderFactory.getClientCallCredsProvider().get());
7979

80-
config1 = getConfigValue("config1.yaml");
81-
config2 = getConfigValue("config2.yaml");
82-
config3 = getConfigValue("config3.yaml");
80+
config1 = getConfigValue("config1.json");
81+
config2 = getConfigValue("config2.json");
82+
config3 = getConfigValue("config3.json");
8383
}
8484

8585
@AfterAll
Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,29 @@
11
package org.hypertrace.config.service;
22

3+
import static org.hypertrace.config.proto.converter.ConfigProtoConverter.mergeFromJsonString;
4+
35
import com.google.common.io.Resources;
4-
import com.google.protobuf.ListValue;
5-
import com.google.protobuf.Struct;
66
import com.google.protobuf.Value;
77
import java.io.IOException;
88
import java.nio.charset.Charset;
9-
import java.util.List;
10-
import java.util.Map;
11-
import org.yaml.snakeyaml.Yaml;
129

1310
public class IntegrationTestUtils {
1411

1512
/**
16-
* Reads the YAML file and converts it into {@link Value} object
13+
* Reads the Json file and converts it into {@link Value} object
1714
*
18-
* @param yamlFileName
15+
* @param jsonFileName
1916
* @return
2017
* @throws IOException
2118
*/
22-
public static Value getConfigValue(String yamlFileName) throws IOException {
23-
String yamlConfigString = getConfigString(yamlFileName);
24-
Yaml yaml = new Yaml();
25-
Object yamlObject = yaml.load(yamlConfigString);
26-
return getConfigValue(yamlObject);
19+
public static Value getConfigValue(String jsonFileName) throws IOException {
20+
String jsonConfigString = getConfigString(jsonFileName);
21+
Value.Builder valueBuilder = Value.newBuilder();
22+
mergeFromJsonString(jsonConfigString, valueBuilder);
23+
return valueBuilder.build();
2724
}
2825

2926
private static String getConfigString(String resourceName) throws IOException {
3027
return Resources.toString(Resources.getResource(resourceName), Charset.defaultCharset());
3128
}
32-
33-
private static Value getConfigValue(Object yamlObject) {
34-
Value.Builder configValueBuilder = Value.newBuilder();
35-
if (yamlObject instanceof Map) {
36-
Struct.Builder structBuilder = Struct.newBuilder();
37-
for (Map.Entry<String, Object> entry : ((Map<String, Object>) yamlObject).entrySet()) {
38-
structBuilder.putFields(entry.getKey(), getConfigValue(entry.getValue()));
39-
}
40-
configValueBuilder.setStructValue(structBuilder.build());
41-
} else if (yamlObject instanceof List) {
42-
ListValue.Builder listValueBuilder = ListValue.newBuilder();
43-
for (Object element : (List) yamlObject) {
44-
listValueBuilder.addValues(getConfigValue(element));
45-
}
46-
configValueBuilder.setListValue(listValueBuilder.build());
47-
} else {
48-
configValueBuilder.setStringValue(String.valueOf(yamlObject));
49-
}
50-
return configValueBuilder.build();
51-
}
5229
}
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
{
2+
"invoice": 34843,
3+
"date": "2001-01-11",
4+
"bill_to": {
5+
"given": "C1",
6+
"family": "D1",
7+
"address": {
8+
"lines": "111 Walkman Dr.Suite #111",
9+
"city": "Royal Oak",
10+
"postal": 48046
11+
}
12+
},
13+
"ship_to": {
14+
"given": "C1",
15+
"family": "D1",
16+
"address": {
17+
"lines": "111 Walkman Dr.Suite #111",
18+
"city": "Royal Oak",
19+
"postal": 48046
20+
}
21+
},
22+
"product": [
23+
{
24+
"sku": "BL394D",
25+
"quantity": 4,
26+
"description": "Basketball",
27+
"price": 450.00
28+
}
29+
],
30+
"tax": 251.42,
31+
"comments": "Late afternoon is best.\n Backup contact is Nancy\n Billsmer @ 338-4338."
32+
}

config-service/src/integrationTest/resources/config1.yaml

Lines changed: 0 additions & 22 deletions
This file was deleted.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
{
2+
"invoice": 34843,
3+
"date": "2002-02-22",
4+
"bill_to": {
5+
"given": "C2",
6+
"family": "D2",
7+
"address": {
8+
"lines": "222 Walkman Dr.Suite #292",
9+
"city": "Royal Oak",
10+
"state": "MI"
11+
}
12+
},
13+
"product": [
14+
{
15+
"sku": "BL222D",
16+
"quantity": 4,
17+
"description": "Basketball",
18+
"price": 450.00
19+
},
20+
{
21+
"sku": "BL333H",
22+
"quantity": 1,
23+
"description": "Super Hoop",
24+
"price": 2392.00
25+
}
26+
],
27+
"total": 4443.52,
28+
"comments": "Late afternoon is best.\n Backup contact is Nancy\n Billsmer @ 338-4338."
29+
}

config-service/src/integrationTest/resources/config2.yaml

Lines changed: 0 additions & 25 deletions
This file was deleted.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"invoice": 34843,
3+
"date": "2002-02-22",
4+
"bill_to": {
5+
"given": "C2",
6+
"family": "D2",
7+
"address": {
8+
"lines": "222 Walkman Dr.Suite #292",
9+
"city": "Royal Oak",
10+
"state": "MI",
11+
"postal": 48046
12+
}
13+
},
14+
"ship_to": {
15+
"given": "C1",
16+
"family": "D1",
17+
"address": {
18+
"lines": "111 Walkman Dr.Suite #111",
19+
"city": "Royal Oak",
20+
"postal": 48046
21+
}
22+
},
23+
"product": [
24+
{
25+
"sku": "BL222D",
26+
"quantity": 4,
27+
"description": "Basketball",
28+
"price": 450.00
29+
},
30+
{
31+
"sku": "BL333H",
32+
"quantity": 1,
33+
"description": "Super Hoop",
34+
"price": 2392.00
35+
}
36+
],
37+
"tax": 251.42,
38+
"total": 4443.52,
39+
"comments": "Late afternoon is best.\n Backup contact is Nancy\n Billsmer @ 338-4338."
40+
}

config-service/src/integrationTest/resources/config3.yaml

Lines changed: 0 additions & 37 deletions
This file was deleted.

gradle/libs.versions.toml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[versions]
2-
protoc = "3.21.7"
2+
protoc = "3.21.12"
33
grpc = "1.50.0"
44
gson = "2.9.0"
55
hypertrace-grpcutils = "0.11.2"
6-
hypertrace-framework = "0.1.47"
6+
hypertrace-framework = "0.1.48"
77
lombok = "1.18.22"
8-
jackson = "2.13.2.2"
8+
jackson = "2.14.1"
99
kafka = "6.0.1-ccs"
1010
kotlin = "1.4.32"
1111

@@ -24,7 +24,7 @@ hypertrace-grpc-framework = { module = "org.hypertrace.core.serviceframework:pla
2424
hypertrace-framework-metrics = { module = "org.hypertrace.core.serviceframework:platform-service-framework", version.ref = "hypertrace-framework" }
2525
hypertrace-framework-integrationtest = { module = "org.hypertrace.core.serviceframework:integrationtest-service-framework", version.ref = "hypertrace-framework" }
2626

27-
hypertrace-documentstore = { module = "org.hypertrace.core.documentstore:document-store", version = "0.7.23" }
27+
hypertrace-documentstore = { module = "org.hypertrace.core.documentstore:document-store", version = "0.7.25" }
2828
hypertrace-eventstore = { module = "org.hypertrace.core.eventstore:event-store", version = "0.1.2" }
2929

3030
guava = { module = "com.google.guava:guava", version = "31.1-jre" }
@@ -33,7 +33,6 @@ guice = { module = "com.google.inject:guice", version = "5.0.1" }
3333
javax-annotation = { module = "javax.annotation:javax.annotation-api", version = "1.3.2" }
3434
typesafe-config = { module = "com.typesafe:config", version = "1.4.1" }
3535
lombok = { module = "org.projectlombok:lombok", version.ref = "lombok" }
36-
snakeyaml = { module = "org.yaml:snakeyaml", version = "1.28" }
3736
jackson-databind = { module = "com.fasterxml.jackson.core:jackson-databind", version.ref = "jackson" }
3837
rxjava3 = { module = "io.reactivex.rxjava3:rxjava", version = "3.0.11" }
3938
google-re2j = { module = "com.google.re2j:re2j", version = "1.6" }

0 commit comments

Comments
 (0)