Skip to content

Commit d5b5a76

Browse files
authored
feature: Add scanType field to Pattern object [TAROT-2624]
1 parent 56ef958 commit d5b5a76

File tree

4 files changed

+11
-4
lines changed

4 files changed

+11
-4
lines changed

pattern.go

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ type Pattern struct {
55
ID string `json:"patternId"`
66
Category string `json:"category,omitempty"`
77
SubCategory string `json:"subcategory,omitempty"`
8+
ScanType string `json:"scanType,omitempty"`
89
Level string `json:"level,omitempty"`
910
Parameters []PatternParameter `json:"parameters,omitempty"`
1011
Languages []string `json:"languages,omitempty"`

tests/tool/docs/patterns.json

+2-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@
1111
"default": "nofunc"
1212
}
1313
],
14-
"level": "Warning"
14+
"level": "Warning",
15+
"scanType": "SAST"
1516
}
1617
]
1718
}

tests/unmatched_tools/docs/patterns.json

+2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
{
66
"patternId": "secret",
77
"category": "Security",
8+
"subCategory": "Cryptography",
9+
"scanType": "Secrets",
810
"level": "Critical"
911
}
1012
]

tool_test.go

+6-3
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ func TestNewToolExecution(t *testing.T) {
2323
{
2424
ID: "foo",
2525
Category: "ErrorProne",
26+
ScanType: "SAST",
2627
Level: "Warning",
2728
Parameters: []PatternParameter{
2829
{
@@ -87,9 +88,11 @@ func TestNewToolExecution_NoMatchingToolConfigured(t *testing.T) {
8788
Version: "1.0.0",
8889
Patterns: &[]Pattern{
8990
{
90-
ID: "secret",
91-
Category: "Security",
92-
Level: "Critical",
91+
ID: "secret",
92+
Category: "Security",
93+
Level: "Critical",
94+
SubCategory: "Cryptography",
95+
ScanType: "Secrets",
9396
},
9497
},
9598
},

0 commit comments

Comments
 (0)