Skip to content

Commit 453d9c4

Browse files
committed
feat: SCA-69 add murphyjson reference type to dependency graph
1 parent 140238d commit 453d9c4

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

inspector/textual_formatter.go

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,12 @@ package inspector
33
import (
44
"encoding/json"
55
"fmt"
6-
"github.com/murphysecurity/murphysec/env"
7-
"github.com/murphysecurity/murphysec/model"
86
"strings"
97
"time"
8+
9+
"github.com/murphysecurity/murphysec/env"
10+
"github.com/murphysecurity/murphysec/model"
11+
"github.com/murphysecurity/murphysec/utils/must"
1012
)
1113

1214
type DependencyGraph struct {
@@ -91,6 +93,11 @@ func BuildSpdx(task *model.ScanTask) []byte {
9193
"referenceType": "purl",
9294
})
9395
}
96+
externalRefs = append(externalRefs, map[string]any{
97+
"referenceCategory": "PACKAGE-MANAGER",
98+
"referenceLocator": string(must.A(json.Marshal(node))),
99+
"referenceType": "murphyjson",
100+
})
94101
if len(externalRefs) != 0 {
95102
m["externalRefs"] = externalRefs
96103
}

0 commit comments

Comments
 (0)