Skip to content

Commit b839add

Browse files
CatalinSnykj-luong
andauthored
feat: support IAW when rendering sarif or human readable output (#343)
Co-authored-by: JSON <[email protected]>
1 parent 133c9ea commit b839add

30 files changed

+7097
-372
lines changed

.gitleaksignore

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,4 +35,12 @@ d5da1e7b3eb6676acca2021e4f3da07b1ff0d9a6:pkg/auth/oauth_test.go:jwt:30
3535
57ac8440ab40cf8cf6eaa6600c3c5acd1b0272d2:internal/presenters/testdata/with-ignores-with-status.json:generic-api-key:474
3636
57ac8440ab40cf8cf6eaa6600c3c5acd1b0272d2:internal/presenters/testdata/with-ignores-with-status.json:generic-api-key:539
3737
57ac8440ab40cf8cf6eaa6600c3c5acd1b0272d2:internal/presenters/testdata/with-ignores-with-status.json:generic-api-key:159
38-
pkg/auth/tokenauthenticator_test.go:generic-api-key:33
38+
pkg/auth/tokenauthenticator_test.go:generic-api-key:33
39+
internal/presenters/testdata/with-ignores-with-status-rejected.json:generic-api-key:159
40+
internal/presenters/testdata/with-ignores-with-status-rejected.json:generic-api-key:224
41+
internal/presenters/testdata/with-ignores-with-status-rejected.json:generic-api-key:474
42+
internal/presenters/testdata/with-ignores-with-status-rejected.json:generic-api-key:539
43+
internal/presenters/testdata/with-ignores-with-status-underReview.json:generic-api-key:159
44+
internal/presenters/testdata/with-ignores-with-status-underReview.json:generic-api-key:224
45+
internal/presenters/testdata/with-ignores-with-status-underReview.json:generic-api-key:474
46+
internal/presenters/testdata/with-ignores-with-status-underReview.json:generic-api-key:539

Makefile

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,12 @@ tools: $(GO_BIN)/golangci-lint
5050
$(GO_BIN)/golangci-lint:
5151
curl -sSfL 'https://raw.githubusercontent.com/golangci/golangci-lint/${OVERRIDE_GOCI_LINT_V}/install.sh' | sh -s -- -b ${GO_BIN} ${OVERRIDE_GOCI_LINT_V}
5252

53+
.PHONY: update-dragonfly
54+
update-dragonfly:
55+
@scripts/pull-down-dragonfly-api-spec.sh
56+
@make generate
57+
58+
5359
.PHONY: update-local-findings
5460
update-local-findings:
5561
@scripts/pull-down-test-api-spec.sh
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
2025-02-04T12:08:26Z feat/local_findings_sarif 7ea0d951f96ab9276d29bba2325e3def97d93871
1+
2025-06-04T11:00:33Z feat/local_findings_sarif cdc057dccb41cc880df02e6262e19445eeda5f28

internal/local_findings/source/openapi/rest/test.spec.yaml

Lines changed: 49 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -570,19 +570,19 @@ components:
570570
- $ref: '#/components/schemas/types.CodeSastFingerprintV1'
571571
- $ref: '#/components/schemas/types.ScaProblemFingerprint'
572572
- $ref: '#/components/schemas/types.IdentityFingerprint'
573-
- $ref: '#/components/schemas/types.FingerprintProjectV1'
574-
- $ref: '#/components/schemas/types.FingerprintRepositoryV1'
575-
- $ref: '#/components/schemas/types.FingerprintAssetV1'
573+
- $ref: '#/components/schemas/types.CodeSastFingerprintProjectV1'
574+
- $ref: '#/components/schemas/types.CodeSastFingerprintRepositoryV1'
575+
- $ref: '#/components/schemas/types.CodeSastFingerprintAssetV1'
576576
discriminator:
577577
propertyName: scheme
578578
mapping:
579579
code-sast-v0: '#/components/schemas/types.CodeSastFingerprintV0'
580580
code-sast-v1: '#/components/schemas/types.CodeSastFingerprintV1'
581581
sca-problem: '#/components/schemas/types.ScaProblemFingerprint'
582582
identity: '#/components/schemas/types.IdentityFingerprint'
583-
snyk/org/project/finding/v1: '#/components/schemas/types.FingerprintProjectV1'
584-
snyk/org/repository/finding/v1: '#/components/schemas/types.FingerprintRepositoryV1'
585-
snyk/asset/finding/v1: '#/components/schemas/types.FingerprintAssetV1'
583+
snyk/org/project/finding/v1: '#/components/schemas/types.CodeSastFingerprintProjectV1'
584+
snyk/org/repository/finding/v1: '#/components/schemas/types.CodeSastFingerprintRepositoryV1'
585+
snyk/asset/finding/v1: '#/components/schemas/types.CodeSastFingerprintAssetV1'
586586
LinkProperty:
587587
oneOf:
588588
- $ref: '#/components/schemas/io.snyk.api.common.LinkString'
@@ -816,6 +816,42 @@ components:
816816
type: array
817817
items:
818818
$ref: '#/components/schemas/types.ThreadFlow'
819+
types.CodeSastFingerprintAssetV1:
820+
type: object
821+
required:
822+
- scheme
823+
- value
824+
properties:
825+
scheme:
826+
type: string
827+
enum:
828+
- snyk/asset/finding/v1
829+
value:
830+
type: string
831+
types.CodeSastFingerprintProjectV1:
832+
type: object
833+
required:
834+
- scheme
835+
- value
836+
properties:
837+
scheme:
838+
type: string
839+
enum:
840+
- snyk/org/project/finding/v1
841+
value:
842+
type: string
843+
types.CodeSastFingerprintRepositoryV1:
844+
type: object
845+
required:
846+
- scheme
847+
- value
848+
properties:
849+
scheme:
850+
type: string
851+
enum:
852+
- snyk/org/repository/finding/v1
853+
value:
854+
type: string
819855
types.CodeSastFingerprintV0:
820856
type: object
821857
required:
@@ -1620,42 +1656,6 @@ components:
16201656
items:
16211657
$ref: '#/components/schemas/types.Coverage'
16221658
description: Summary statistics about a Test's Findings.
1623-
types.FingerprintAssetV1:
1624-
type: object
1625-
required:
1626-
- scheme
1627-
- value
1628-
properties:
1629-
scheme:
1630-
type: string
1631-
enum:
1632-
- snyk/asset/finding/v1
1633-
value:
1634-
type: string
1635-
types.FingerprintProjectV1:
1636-
type: object
1637-
required:
1638-
- scheme
1639-
- value
1640-
properties:
1641-
scheme:
1642-
type: string
1643-
enum:
1644-
- snyk/org/project/finding/v1
1645-
value:
1646-
type: string
1647-
types.FingerprintRepositoryV1:
1648-
type: object
1649-
required:
1650-
- scheme
1651-
- value
1652-
properties:
1653-
scheme:
1654-
type: string
1655-
enum:
1656-
- snyk/org/repository/finding/v1
1657-
value:
1658-
type: string
16591659
types.GitCommit:
16601660
type: string
16611661
example: 23ee663c96889a1ce6f62217adf4dea2bea1b09e
@@ -1992,14 +1992,16 @@ components:
19921992
types.Suppression:
19931993
type: object
19941994
required:
1995-
- kind
1995+
- status
19961996
properties:
1997-
kind:
1997+
id:
1998+
type: string
1999+
status:
19982000
type: string
19992001
enum:
2000-
- ignored
2001-
- pending_ignore_approval
2002-
- other
2002+
- accepted
2003+
- underReview
2004+
- rejected
20032005
justification:
20042006
type: string
20052007
details:
@@ -2008,7 +2010,6 @@ components:
20082010
types.SuppressionDetails:
20092011
type: object
20102012
required:
2011-
- expiration
20122013
- category
20132014
- ignoredOn
20142015
- ignoredBy

0 commit comments

Comments
 (0)