1717//nolint:revive,tagliatelle // These are all SARIF documented types that need to match the exact JSON format.
1818package codeclient
1919
20+ // SarifResponse matches the spec in https://docs.oasis-open.org/sarif/sarif/v2.1.0/os/schemas/sarif-schema-2.1.0.json
2021type SarifResponse struct {
2122 Type string `json:"type"`
2223 Progress float64 `json:"progress"`
@@ -101,6 +102,7 @@ type Result struct {
101102 Fingerprints Fingerprints `json:"Fingerprints"`
102103 CodeFlows []CodeFlow `json:"codeFlows"`
103104 Properties ResultProperties `json:"properties"`
105+ Suppressions []Suppression `json:"suppressions"`
104106}
105107
106108type ExampleCommitFix struct {
@@ -164,7 +166,7 @@ type Tool struct {
164166 Driver Driver `json:"Driver"`
165167}
166168
167- type runProperties struct {
169+ type RunProperties struct {
168170 Coverage []struct {
169171 Files int `json:"files"`
170172 IsSupported bool `json:"isSupported"`
@@ -175,5 +177,30 @@ type runProperties struct {
175177type Run struct {
176178 Tool Tool `json:"Tool"`
177179 Results []Result `json:"results"`
178- Properties runProperties `json:"RuleProperties"`
180+ Properties RunProperties `json:"RuleProperties"`
181+ }
182+
183+ type Suppression struct {
184+ Justification string `json:"justification"`
185+ Properties SuppressionProperties `json:"properties"`
186+ }
187+
188+ type SuppressionProperties struct {
189+ Category Category `json:"category"`
190+ Expiration * string `json:"expiration"`
191+ IgnoredOn string `json:"ignoredOn"` // https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/sarif-v2.1.0-errata01-os-complete.html#_Toc141790703
192+ IgnoredBy IgnoredBy `json:"ignoredBy"`
193+ }
194+
195+ type Category string
196+
197+ const (
198+ WontFix Category = "wont-fix"
199+ NotVulnerable Category = "not-vulnerable"
200+ TemporaryIgnore Category = "temporary-ignore"
201+ )
202+
203+ type IgnoredBy struct {
204+ Name string `json:"name"`
205+ Email * string `json:"email"`
179206}
0 commit comments