File tree 4 files changed +19
-19
lines changed
dd-java-agent/agent-iast/src
main/java/com/datadog/iast
test/groovy/com/datadog/iast
4 files changed +19
-19
lines changed Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ private void reportVulnerability(
81
81
String stackId =
82
82
addVulnerabilityStackTrace (span , String .valueOf (batch .getVulnerabilities ().size ()));
83
83
if (stackId != null ) {
84
- vulnerability .setStackId (stackId );
84
+ vulnerability .getLocation (). setStackId (stackId );
85
85
}
86
86
}
87
87
}
Original file line number Diff line number Diff line change @@ -15,6 +15,8 @@ public final class Location {
15
15
16
16
@ Nullable private transient String serviceName ;
17
17
18
+ private @ Nullable String stackId ;
19
+
18
20
private Location (
19
21
@ Nullable final Long spanId ,
20
22
@ Nullable final String path ,
@@ -86,6 +88,15 @@ public void updateSpan(@Nullable final AgentSpan span) {
86
88
}
87
89
}
88
90
91
+ @ Nullable
92
+ public String getStackId () {
93
+ return stackId ;
94
+ }
95
+
96
+ public void setStackId (@ Nullable String stackId ) {
97
+ this .stackId = stackId ;
98
+ }
99
+
89
100
@ Nullable
90
101
private static Long spanId (@ Nullable AgentSpan span ) {
91
102
return span != null ? span .getSpanId () : null ;
Original file line number Diff line number Diff line change @@ -12,8 +12,6 @@ public final class Vulnerability {
12
12
13
13
private final @ Nullable Evidence evidence ;
14
14
15
- private @ Nullable String stackId ;
16
-
17
15
private long hash ;
18
16
19
17
public Vulnerability (@ Nonnull final VulnerabilityType type , @ Nonnull final Location location ) {
@@ -45,15 +43,6 @@ public Evidence getEvidence() {
45
43
return evidence ;
46
44
}
47
45
48
- @ Nullable
49
- public String getStackId () {
50
- return stackId ;
51
- }
52
-
53
- public void setStackId (@ Nullable String stackId ) {
54
- this .stackId = stackId ;
55
- }
56
-
57
46
public long getHash () {
58
47
return hash ;
59
48
}
Original file line number Diff line number Diff line change @@ -78,9 +78,9 @@ class ReporterTest extends DDSpecification {
78
78
"spanId":123456,
79
79
"line":1,
80
80
"path": "foo",
81
- "method": "foo"
81
+ "method": "foo",
82
+ "stackId":"1"
82
83
},
83
- "stackId":"1",
84
84
"type":"WEAK_HASH"
85
85
}
86
86
]
@@ -187,9 +187,9 @@ class ReporterTest extends DDSpecification {
187
187
"spanId":123456,
188
188
"line":1,
189
189
"path":"foo",
190
- "method": "foo"
190
+ "method": "foo",
191
+ "stackId":"1"
191
192
},
192
- "stackId":"1",
193
193
"type":"WEAK_HASH"
194
194
},
195
195
{
@@ -199,9 +199,9 @@ class ReporterTest extends DDSpecification {
199
199
"spanId":123456,
200
200
"line":2,
201
201
"path":"foo",
202
- "method": "foo"
202
+ "method": "foo",
203
+ "stackId":"2"
203
204
},
204
- "stackId":"2",
205
205
"type":"WEAK_HASH"
206
206
}
207
207
]
@@ -578,7 +578,7 @@ class ReporterTest extends DDSpecification {
578
578
StackTraceEvent currentStackTrace = null
579
579
for (int i = 0 ; i < vulnerabilities. size(); i++ ) {
580
580
for (StackTraceEvent event : batch. get(" vulnerability" )) {
581
- if (event. getId() == vulnerabilities[i]. getStackId()) {
581
+ if (event. getId() == vulnerabilities[i]. getLocation() . getStackId()) {
582
582
currentStackTrace = event
583
583
break
584
584
}
You can’t perform that action at this time.
0 commit comments